Put one unit of heat at the point x=0 of an endless rod at time 0, and let it spread under ut=uxx. The temperature it makes is a bell curve, called the fundamental solution or heat kernel.
Rule: Fundamental solution
Φ(x,t)=4πt1e−x2/(4t),t>0
It solves ut=uxx at every x and every t>0. The capital Φ (phi) is this bell; the normal distribution function keeps its name N, as in lesson 2.6.3.
Check it by computing partials (lesson 4.1.2). The chain rule gives Φx; the product rule then gives Φxx; and differentiating both factors in t gives Φt:
ΦxΦxxΦt=−2txΦ=(4t2x2−2t1)Φ=(4t2x2−2t1)Φ
The last two agree. Both are 0 at x=±2t, where the bell changes from bending down to bending up (lesson 5.4.3). By lesson 6.4.1 those two points are still for a moment; between them the bell sinks, and outside them it rises.
time t
0.01
0.05
0.25
1
height Φ(0,t)=4πt1
2.820948
1.261566
0.56419
0.282095
width 2t
0.141421
0.316228
0.707107
1.414214
The bell is a normal density
Lesson 5.4.3's density of N(μ,σ2) is σ2π1e−(x−μ)2/(2σ2). With μ=0 and σ2=2t it is exactly Φ(x,t). So Φ(⋅,t) is the density of N(0,2t), and three facts follow.
Its area is 1 for every t (lesson 2.6.3): the heat is conserved, as lesson 6.4.1 said.
Its variance is 2t and its width 2t: lesson 6.4.1's spreading, now exact.
As t shrinks to 0 it narrows into a spike of area 1 at 0, which is how the heat started.
Heat reaches everywhere at once
Φ(x,t)>0 for every x as soon as t>0. At t=0.01 the heat at distance 1 is Φ(1,0.01)≈3.9×10−11: positive, but far too small to notice. So heat travels at infinite speed, in amounts that fall off like e−x2/(4t).
The heat from one point at three times. Each bell has area 1; as t grows four times, the width 2t doubles and the height halves.
Try it
SymPy prints Φt, Φx and Φxx, each divided by Φ, then Φt−Φxx, the area and the variance.
The loop checks the equation by central differences (lesson 2.8.1) at two points. Then the table; True says that norm.pdf with standard deviation 2t equals Φ.
⌘/Ctrl + Enter runs the cell
Building any profile from spikes
A spike of heat 1 at y instead of 0 spreads into Φ(x−y,t): the same bell, centred at y. A spike of heat q gives qΦ(x−y,t). The equation is linear (lesson 6.3.1), so several spikes spread independently and their bells add up.
Two spikes. Put heat 1 at x=−1 and heat 2 at x=1. Then u(x,t)=Φ(x+1,t)+2Φ(x−1,t), with total heat 3 at every time.
u(x,t)
x=−1
x=0
x=1
x=2
t=0.05
1.2616
0.0255
2.5231
0.017
t=0.25
0.5849
0.6227
1.1387
0.4152
t=1
0.4896
0.6591
0.668
0.4691
At t=0.05 the two bumps are separate, with almost nothing between them. By t=1 they have merged into one broad hump, slightly higher on the right.
A whole profile
Any starting profile u0(x) can be cut into thin strips of width Δy. The strip at y holds heat u0(y)Δy, and spreads into a bell. Adding the bells is a Riemann sum (lesson 2.5.1), and as Δy shrinks it becomes an integral.
Rule: Solution by the fundamental solution
u(x,t)=∫−∞∞u0(y)Φ(x−y,t)dy
u0 is the profile at t=0. For t>0, u(x,t) is an average of u0 near x, weighted by a bell centred at x with width 2t. As t shrinks to 0 it tends to u0(x) wherever u0 is continuous.
The next section's step profile shows the sum settling. At x=1, t=0.5, strips on [0,10] give 0.843903 for Δy=0.5, 0.841446 for 0.1 and 0.841346 for 0.01. The integral itself is 0.841345.
Try it
The loop prints the two-spike table, with the total heat by quad in the last column.
Then the strips: each adds Δy⋅Φ(1−y,0.5), with y at the middle of the strip.
⌘/Ctrl + Enter runs the cell
The step
Start with a rod that is cold on the left and hot on the right: u0=0 for x<0 and u0=1 for x>0. The integral keeps only y>0:
u(x,t)=∫0∞Φ(x−y,t)dy
Substitute z=2ty−x, a linear inner function with dy=2tdz (lesson 2.6.1). The integrand becomes φ(z), the standard normal density, and the lower limit y=0 becomes z=−2tx. The area under φ above −w is N(w), by symmetry (lesson 5.4.3).
Rule: The step spreads into N
u(x,t)=N(2tx)
For the step that is 0 on the left of 0 and 1 on the right. At x=0 the value is 21 for every t>0, halfway up the jump. It tends to 1 far to the right and to 0 far to the left.
At t=0.5 the width 2t is 1, so u(x,0.5)=N(x): 0.02275, 0.158655, 0.5, 0.841345 and 0.97725 at x = −2, −1, 0, 1 and 2. Now follow the fixed point x=1 as the jump spreads past it. Its value falls from 1.0 (to 4 decimals) at t=0.01 to 0.9214 at 0.25, 0.7602 at 1 and 0.6915 at 2.
Try it
norm.cdf is N. The first loop compares N(2tx) with quad of the integral at t=0.5.
The second loop follows the point x=1 over time.
⌘/Ctrl + Enter runs the cell
The kink
Now start from the kink u0=max(x,0): zero on the left, the line y=x on the right. Then u(x,t)=∫0∞yΦ(x−y,t)dy. Split the y in front as x+(y−x).
The x part is x times the step's integral, xN(2tx). The same substitution turns the (y−x) part into 2t times the integral of zφ(z) above −2tx. Since −φ(z) is an antiderivative of zφ(z) (lesson 2.6.1), that integral is φ(2tx).
Rule: The kink spreads
u0=max(x,0)u=xN(2tx)+2tφ(2tx)
The corner is rounded and lifted: at x=0 the value is 2tφ(0)=t/π. Far from 0 the solution hugs the two straight pieces.
At t=0.5 the values at x = −2, −1, 0, 1 and 2 are 0.008491, 0.083315, 0.398942, 1.083315 and 2.008491. Each is above max(x,0), by 0.008491, 0.083315, 0.398942, 0.083315 and 0.008491. That fits lesson 6.4.1: the kink never bends down, so it can only rise.
Its slope is the step's solution: ux=N(2tx), since the slope of the kink is the step. Case study 6.4.4 turns a call option's payoff into a profile very like this kink.
The step and the kink, with their solutions at three times. The step's curves all pass through one half at 0. The kink's corner is rounded and lifted by t/π, while far from 0 the straight pieces barely move.
Try it
kink is the rule above. The loop compares it with quad at t=0.5 and prints how far it lies above max(x,0).
The next lines check that its slope, by a central difference, is the step's solution. Then t/π at three times.
⌘/Ctrl + Enter runs the cell
Growing profiles: ecx
The integral also works for profiles that grow, if they grow slowly enough. Take u0=ecx for a number c. Completing the square in the exponent (lesson 1.2.2), as case study 2.6.5 did, moves the bell:
ecyΦ(x−y,t)=ecx+c2tΦ(x+2ct−y,t)
The bell is now centred at x+2ct and scaled by ecx+c2t. Its area is 1, so the whole integral is that scale.
Rule: Exponential profiles
u0=ecx⇒u=ecx+c2t
Check: ut=c2u and uxx=c2u. The profile bends up everywhere, so it rises everywhere. If u0=ecx only for x>0, and 0 elsewhere, only the moved bell's area above 0 counts; by the step's rule, u=ecx+c2tN(2tx+2ct).
For c=1 at x=0, t=1, the value is e≈2.718282; for c=2 at t=0.5 it is e2≈7.389056. With the cut at 0, c=1 at x=0, t=0.5 gives e0.5N(1)≈1.387143. Case study 6.4.4 needs exactly this cut version.
Where the integral fails
A profile that grows like ex2 is too fast. For u0=ex2 at x=0 the integral is 1−4t1, which is 2.236068 at t=0.2; from t=41 on it diverges, and there is no solution. The kink, polynomials and every ecx are fine.
Try it
quad integrates ecyΦ(x−y,t) over a window of 12 widths around the moved centre x+2ct, against ecx+c2t. Then the cut version from 0.
The last lines integrate ey2Φ(−y,t) over [−L,L] for growing L: it settles at t=0.2 and explodes at t=0.3.
⌘/Ctrl + Enter runs the cell
The same answer from random draws
Φ(⋅,t) is the density of a normal variable X∼N(0,2t), so the rule reads u(x,t)=E[u0(x+X)]: the starting profile, averaged over a random normal shift (module 5.4). That shift is like the end of a random walk of many small steps (lessons 5.11.1 and 5.7.3). Heat spreads the way a crowd of random walkers does.
Try it
200,000 seeded draws of X with variance 2t=1, at x=1. The share with 1+X>0 estimates the step's N(1), and the average of max(1+X,0) the kink's value.
This run gives 0.841 and 1.0834, against 0.841345 and 1.083315. Their standard errors are about 0.0008 and 0.0019 (lesson 5.7.3).
⌘/Ctrl + Enter runs the cell
Common mistakes
The variance is 2t, not t.Φ(⋅,t) is the N(0,2t) density, with width 2t.
Φ here is the heat kernel, a density. The normal distribution function is N.
Centre the bell where you want the answer.u(x,t) weights u0(y) by Φ(x−y,t), a bell centred at x.
Only for t>0.Φ(x,0) divides by 0; at t=0 the answer is u0 itself.
The step stays at 21 at its jump, for every t>0.
The kink's solution lies above the kink, by t/π at the corner.
Mind the growth of u0.ecx is fine; ex2 has a solution only until t=41.
The fundamental solution
0 of 13 correct
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
How to type answers
Powers with ^: x^7, 2^(1/3), a^-2.
Multiply with * or by writing side by side: 3x^2, 2(x+1).
ln(x) is the natural log, log(x, 2) is log base 2, e is Euler's number, sqrt(x) is a square root.
sin(x), cos(x) and tan(x) take radians; write pi for π and sin(x)^2 for sin²x.
Your first answer to each question is saved: it counts towards your score and brings the question back for review.
Exact answers like ln(20)/ln(3) are best. Decimals need about 4 significant figures.
Summary card
The fundamental solution Φ(x,t)=4πt1e−x2/(4t) solves ut=uxx. It is the N(0,2t) density: area 1, width 2t, positive everywhere for t>0.
Any profile is a sum of spikes: u(x,t)=∫u0(y)Φ(x−y,t)dy, an average of u0 near x.
The step spreads into N(2tx); the kink into xN(2tx)+2tφ(2tx).
ecx becomes ecx+c2t; cut at 0, it becomes ecx+c2tN(2tx+2ct). Profiles like ex2 grow too fast.
u(x,t)=E[u0(x+X)] with X∼N(0,2t): heat spreads like a crowd of random walkers.