Get AI summaries of any video or article — Sign up free
Solving the heat equation | DE3 thumbnail

Solving the heat equation | DE3

3Blue1Brown·
5 min read

Based on 3Blue1Brown's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.

TL;DR

The heat equation determines how temperature evolves only in the interior; boundary conditions are required to select physically valid solutions.

Briefing

The heat equation’s solutions aren’t determined by the differential equation alone: the temperature profile must satisfy the PDE in the rod’s interior and also obey boundary conditions that encode how heat behaves at the ends. That distinction matters because even functions that satisfy the heat equation can evolve in physically wrong ways if they ignore what happens at x = 0 and x = L.

In one dimension, the heat equation links time change to spatial curvature: the rate of temperature change at a point is proportional to the second derivative of temperature with respect to position. This creates a natural search for “nice” spatial shapes. Fourier’s key move was to treat the problem like an orchestra of modes: sine waves are simple building blocks because their second spatial derivatives reproduce the same shape (up to a constant factor). Starting with an idealized initial profile T(x,0) = sin(x), the second derivative in x turns sin(x) into −sin(x), so the PDE reduces to an exponential-in-time scaling. That leads to a candidate solution of the form T(x,t) = sin(x)·e^{−αt}, where α is the proportionality constant in the heat equation. Checking derivatives confirms it satisfies the PDE: differentiating twice in space brings down a negative factor, while differentiating once in time brings down the same factor times −α.

But the story breaks when physical boundary behavior is imposed. A straight-line temperature profile (proportional to x) has zero second derivative in space, so it would seem to stay constant under the PDE. Yet a simulation that models the ends correctly shows it slowly flattens toward a uniform temperature. The culprit is the boundary: at the rod’s ends there’s no neighbor on one side, so the “curvature drives change” intuition must be modified. For insulated ends—no heat flowing in or out—the slope at both endpoints must be zero for all times after the start. In mathematical terms, ∂T/∂x must vanish at x = 0 and x = L.

To satisfy those Neumann-type boundary conditions, sine waves need adjustment. Using cosine instead of sine shifts the wave so it’s flat at x = 0. The remaining task is to tune the spatial frequency so the derivative also vanishes at x = L. Introducing a factor ω inside the cosine changes the second derivative by ω², which forces the time-decay rate to pick up the same ω² factor: sharper spatial variation decays faster, with decay proportional to ω². The lowest allowed frequency occurs when ω = π/L, and higher modes come from harmonics—whole-number multiples of π/L—plus the constant mode (ω = 0). This produces an infinite family of functions that satisfy both the PDE and the insulated-end boundary conditions.

The payoff is strategic rather than final: once these mode solutions are in hand, the next step is to combine them to match arbitrary initial temperature distributions. The heat equation becomes solvable by decomposing complex starting shapes into sums of sine/cosine modes whose time evolution is exponential, with rates set by the spatial frequencies and the boundary constraints.

Cornell Notes

The heat equation ties how temperature changes over time to the curvature of temperature in space, using second derivatives in x. Simple spatial shapes like sine waves behave especially well because taking two spatial derivatives reproduces the same sine shape up to a constant factor, leading to exponential decay in time. However, satisfying the PDE in the interior is not enough: insulated ends require zero heat flux, which translates to zero slope at x = 0 and x = L for all t > 0. Enforcing those boundary conditions forces the spatial frequency to take discrete values (harmonics of π/L), producing an infinite family of cosine-based modes with time decay rates proportional to ω². These modes set up the Fourier-series-style method for building solutions that match any initial temperature profile.

Why does a sine wave naturally lead to exponential decay under the heat equation?

For an idealized start T(x,0)=sin(x), the second spatial derivative gives d²/dx²[sin(x)] = −sin(x). The heat equation relates ∂T/∂t to that second derivative, so the time derivative becomes proportional to −T itself. When a quantity’s rate of change is proportional to the quantity (with a constant factor), the solution is exponential: T(x,t)=sin(x)·e^{−αt}. The same logic persists for later times because the exponential factor doesn’t change the spatial shape—only its overall scale.

What goes wrong if a function satisfies the PDE but not the boundary conditions?

A straight line T(x,t) ∝ x has zero second derivative in x, so the PDE alone would predict no time change. Yet physically accurate simulations show it evolves toward a uniform temperature. The mismatch comes from how the ends are treated: at x=0 and x=L there’s no neighbor on one side, so the “curvature drives change” mechanism must be adjusted. For insulated ends, the correct constraint is that the slope at both endpoints must be zero for all t>0, which the straight line violates.

How do insulated ends translate into a mathematical boundary condition?

Insulated ends mean no heat flows into or out of the rod, which corresponds to zero spatial heat flux at the boundaries. In this setup, that becomes a zero-slope requirement: ∂T/∂x evaluated at x=0 and at x=L must equal 0 for all times T>0. This is why the boundary condition is essential: it restricts which spatial modes are physically allowed.

Why switch from sine to cosine when enforcing zero slope at x=0?

Sine waves are not flat at x=0, but cosine waves are. Cosine is a phase-shifted sine: using cos(x) instead of sin(x) makes the derivative at x=0 vanish. Since the second derivative of cosine also reproduces the same function shape (up to a constant), cos(x)·e^{−αt} still satisfies the PDE; only the frequency must be tuned so the slope also vanishes at x=L.

How does changing the spatial frequency ω affect the time decay rate?

Replacing cos(x) with cos(ωx) changes derivatives via the chain rule. The second spatial derivative brings down a factor of ω², so the heat equation requires the time-decay exponential to include ω² as well. The result is that higher-frequency (sharper) spatial profiles decay faster—doubling ω makes the decay rate four times larger. The insulated boundary at x=L then quantizes ω into harmonics of π/L (including ω=0 for the constant mode).

Review Questions

  1. What role do boundary conditions play in determining a unique solution to the heat equation, and why can the PDE alone be insufficient?
  2. Derive (conceptually) why a mode like cos(ωx) must have a time factor whose exponent involves ω².
  3. How does the insulated-end condition lead to discrete allowed frequencies such as ω=π/L and its harmonics?

Key Points

  1. 1

    The heat equation determines how temperature evolves only in the interior; boundary conditions are required to select physically valid solutions.

  2. 2

    For insulated ends, zero heat flux becomes a zero-slope condition: ∂T/∂x must vanish at x=0 and x=L for all t>0.

  3. 3

    Sine waves are useful because their second spatial derivatives reproduce the same shape up to a constant, yielding exponential time decay.

  4. 4

    Cosine modes satisfy the “flat at x=0” requirement automatically, but the frequency must be tuned to also flatten at x=L.

  5. 5

    Introducing a spatial frequency ω changes the second derivative by ω², forcing the time decay rate to scale with ω².

  6. 6

    Insulated-end boundary conditions quantize ω into harmonics of π/L, producing an infinite family of mode solutions.

  7. 7

    Once mode solutions exist, arbitrary initial temperature profiles can be built by combining them (the setup for Fourier-series-style reconstruction).

Highlights

Satisfying the heat equation in the interior doesn’t guarantee correct physics at the ends; boundary conditions can force the solution to change form.
Insulated boundaries translate into ∂T/∂x = 0 at x=0 and x=L, eliminating many candidate functions that would otherwise solve the PDE.
A spatial mode cos(ωx) decays like an exponential whose rate grows with ω², so sharper temperature variations fade faster.
The allowed spatial frequencies become discrete: ω = π/L and its whole-number multiples, plus the constant mode ω=0.

Topics

Mentioned