Feeling the heat
If you've ever picked up a metal spoon from a hot pot of soup you'll have encountered a law of nature: heat flows from hot to cold. That's why the spoon scolds your hand. It's also why we can use radiators to heat rooms, and why refrigeration is so expensive: left to its own devices a cool object in a warm environment will always warm up.
In everyday life we can use our intuition to deal with the behaviour of heat (just don't pick up that spoon). But in order to do physics, build things like fridges, and also just for the pleasure for understanding nature, it's useful to have an equation to tell us exactly how things react to heat. Such an equation exists. It's called the heat equation. In this article we will derive the heat equation for the simplest possible scenario.
What we will end up with is an equation that will allow us to calculate the temperature $T(x,t)$ at each point $x$ of some body that is being heated up, at each time $t$.Basic heat transfer
Let's forget about spoons or the air in a room and instead think about a rectangular block of material. One if its ends is held at a higher temperature than the other end. The other four faces of the block are insulated, so no heat escapes or enters through them, and we also assume that no heat is being generated or lost in the block by some other mechanism. The heat will move from the hot end of the block to the cold one. The direction of heat flow is marked $x$ in the diagram below.
Let's start by working out the rate $q$ at which the heat is transferred. It is measured in joules per second, also known as watts. Assuming that the block is completely uniform and that the temperatures at each end are held constant, this rate is the same everywhere in the block, and it doesn't change in time either.
It turns out that a greater temperature difference, $T_1-T_2$, produces a greater rate of heat transfer. The rate also depends on the cross-sectional area $A$ of the block when it's cut in a direction perpendicular to the direction of heat flow: the greater that area, the greater the rate of transfer. The thickness $B$ of the block in the direction of the heat flow, however, slows the rate down: the thicker the block in that direction, the slower the heat transfer.
Fourier's law
That's the rate of heat transfer through our block of thickness $B$ with constant temperatures at both ends. However, we would like to understand how heat flows at a single point, rather than through an entire block. To find we use calculus. Imagine our body is made up of many very thin slices that all behave like our block above. Let's imagine such a slice running from a point $x$ to a point $x+h$. The idea is to work out the rate $q$ for such a slice and then let $h$ tend to $0$. This will give us the rate $q_x$ of heat transfer at the point $x$ — or, more precisely, the rate $q_x$ of heat transfer at the cross-sectional slice through our body defined by the point $x.$ We assume that $A$ and $k$ are constant throughout the entire block.
is known as Fourier's law of heat conduction, after the French mathematician Jean Baptiste Fourier, who published it in 1822.
Note that the cross-sectional area $A$ and the thermal conductivity $k$ can depend on $x$. In fact, the thermal conductivity depends on the material the block is made up of at point $x$ and it can also depend on temperature. However, the dependence on temperature is slight, so if a body is made up of the same material everywhere, then the thermal conductivity $k$ is usually treated as a constant which doesn't depend on temperature or $x$. That's what we will do from now on. We will also assume that $A$ is the same everywhere.
We now know the rate at which heat energy is transferred through a slice of a body defined by a point $x$. How does this slice change its temperature in response to the heat energy passing through it at that rate?Conservation of energy
To find out, let's again think of our body as made up of many infinitesimally thin slices, each of which is a nice regular block as the one we started out with.
Because each slice is infinitesimally thin, we can assume that the temperature within it is the same everywhere. Let's also assume that time is made up out of lots of infinitesimally short time intervals. Because they are infinitesimally short, we can assume that the rate at which heat energy is transferred doesn't change within the time intervals.
Let's consider one of the infinitesimal slices, running from $x$ to $x+h.$ The law of conservation of energy says that energy can't be created from nothing or destroyed. This means that the change in heat energy contained in the thin slice over some time interval is equal to the energy put into the block over that time interval minus the energy that leaves the block over that time interval. From Fourier's law, we know that $$q_x=-kA\frac{\partial T(x,t)}{\partial x}$$ and that $$q_{x+h} = -kA\frac{\partial T(x+h,t)}{\partial x}.$$ (We are now dealing with partial derivatives as we have introduced the time variable.) Over our time interval of length $l$, the amount of heat energy entering the block is $$-kA\frac{\partial T(x,t)}{\partial x} \times l$$ and the amount of heat energy leaving the block is $$-kA\frac{\partial T(x+h,t)}{\partial x} \times l.$$ The difference between the two is therefore \begin{equation}\tag{4}\label{eq4}\left(-kA\frac{\partial T(x,t)}{\partial x} + kA\frac{\partial T(x+h,t)}{\partial x}\right)l.\end{equation} As we said above, this difference is equal to the change in heat energy over the time interval from $t$ to $t+l.$ The heat energy contained in a body of temperature $T$ is equal to $cmT$, where $m$ is the mass of the body and $c$ is its specific heat, that is, the amount of heat per unit mass required to raise the temperature by one degree Celsius. The mass of the slice is equal to its density $\rho$ times its volume. The volume is equal to the the cross-sectional area $A$ at $x$ times the thickness $h$ of the block. Therefore, the heat energy at time $t$ is $$c\rho A T(x,t) h.$$ (Here we're assuming that the temperature is $T(x,t)$ everywhere within our slice.) Similarly, the heat energy at time $t+l$ is equal to $$c\rho A T(x,t+l) h.$$ The difference is \begin{equation}\tag{5}\label{eq5}\left( c\rho A T(x,t+l)-c\rho A T(x,t) \right) h.\end{equation} Since expression 4 is equal to expression 5 we get $$ \left(c\rho A T(x,t+l) - c\rho A T(x,t)\right) h = \left(-kA\frac{\partial T(x,t)}{\partial x} + kA\frac{\partial T(x+h,t)}{\partial x}\right)l.$$
The heat equation
Now we're nearly there. Dividing expression 5 through by $h$, $l$, $A$, $c$ and $\rho$ gives $$\frac{T(x,t+l) - T(x,t)}{l} =\frac{k}{c \rho}\left( \frac{\frac{\partial T(x+h,t)}{\partial x} -\frac{\partial T(x,t)}{\partial x}}{h}\right).$$ Letting $h$ and $l$ go to $0$ we get \begin{equation}\tag{6}\label{eq6}\frac{\partial T(x,t)}{\partial t} =\frac{k}{c \rho}\frac{\partial^2 T(x,t)}{\partial x^2}.\end{equation} This is the heat equation. If you can solve this equation, that is, if you can find a function $T(x,t)$ that satisfies it, then that function gives you the temperature at any time $t$ and point $x$ of the body.Our derivation of the heat equation works in the simplest of settings. We have have assumed that the cross-sectional area $A$ is the same throughout our object and that the thermal conductivity $k$ stays the same across space and time. We have also assumed that heat only flows in one direction of space. In reality none of these assumptions need to be true. If they are not you end up with more complicated heat equations (to find out more, have a look at Wikipedia).
What about solving the heat equation? Even in our simplistic set-up, that's not an easy task, so we won't do this here. It's interesting to note, however, that the solutions can be written as an infinite sum of sine and/or cosine functions (find out more in this article). That's why the mathematics that was developed by Fourier to understand heat can also be used to understand, analyse and process sound, which is made up of sound waves that can also be represented by sine and cosine function (find out more here). It can even be used to understand, analyse and process images (find out more about this here).
It's interesting where a hot spoon can take you!