Differential EquationsPartial Differential Equations3 of 6
Partial Differential Equations · 3

Insulated Ends and Fixed Temperatures

When both ends of a rod are held at 0∘0^\circ, heat drains out of both sides and only sine waves survive. Now we want to find the temperature u(x,t)\temp{u(x,t)} when the ends of the rod are sealed with insulation so no heat can escape.

1

Insulated Ends and Cosine Modes

Because heat flows along the slope of the temperature graph, sealing the ends of a rod of length LL means the curve must meet x=0x = 0 and x=Lx = L with zero slope:

∂u∂x(0,t)\displaystyle \slope{\frac{\partial u}{\partial x}(0,t)} =0and∂u∂x(L,t)\displaystyle = 0 \quad \text{and} \quad \slope{\frac{\partial u}{\partial x}(L,t)} =0\displaystyle = 0
Insulated Ends and Cosine Modes
0\htmlClass{lc-mute}{0}
L\htmlClass{lc-mute}{L}
slope at ends= ?\htmlClass{lc-pink}{\text{slope at ends}} = \,?
cos⁡(0)=1\htmlClass{lc-blue}{\cos(0)} = \htmlClass{lc-blue}{1}
n=0n = 0
cos⁡(πxL)\htmlClass{lc-blue}{\cos\left(\tfrac{\pi x}{L}\right)}
n=1n = 1
cos⁡(2πxL)\htmlClass{lc-blue}{\cos\left(\tfrac{2\pi x}{L}\right)}
n=2n = 2
0\htmlClass{lc-mute}{0}
L2\htmlClass{lc-mute}{\tfrac{L}{2}}
L\htmlClass{lc-mute}{L}

Because cos⁡(ωx)\mode{\cos(\omega x)} starts with zero slope at x=0x = 0 and reaches a flat peak or valley at x=Lx = L whenever ω=nπL\omega = \frac{n\pi}{L}, the natural modes for an insulated rod are cosine waves, including the n=0n = 0 constant mode cos⁡(0)=1\mode{\cos(0)} = \mode{1} that never decays:

u(x,t)\displaystyle \temp{u(x,t)} =a0⏟average startingtemperature+∑n=1∞ancos⁡ ⁣(nπxL)e−k(nπ/L)2t\displaystyle = \underbrace{\steady{a_0}}_{\steady{\substack{\text{average starting} \\ \text{temperature}}}} + \sum_{n=1}^{\infty} a_n \mode{\cos\!\left(\frac{n\pi x}{L}\right)} \decay{e^{-k(n\pi/L)^2 t}}

For any starting temperature curve on an insulated rod, the graph immediately flattens at both insulated ends and settles onto the horizontal line at the rod's starting average temperature.

On an insulated rod, every starting temperature curve bends flat at both ends and levels out to its starting average temperature.
2

Solving the Heat Equation with Insulated Ends

Now let's find u(x,t)\temp{u(x,t)} on an insulated rod of length L=πL = \pi with k=1k = 1, first when the starting temperature is u(x,0)=50+10cos⁡(x)−4cos⁡(3x)\temp{u(x,0)} = \steady{50} + 10\mode{\cos(x)} - 4\mode{\cos(3x)}, and then when it starts as the tilted line u(x,0)=x\temp{u(x,0)} = x.

Solving the Heat Equation with Insulated Ends
40\htmlClass{lc-mute}{40}
50\htmlClass{lc-mute}{50}
60\htmlClass{lc-mute}{60}
0\htmlClass{lc-mute}{0}
π\htmlClass{lc-mute}{\pi}
u(x,0)=50+10cos⁡(x)−4cos⁡(3x)u(x,t)= ?\begin{aligned}\htmlClass{lc-blue}{u(x,0)} &= \htmlClass{lc-green}{50} + 10\htmlClass{lc-blue}{\cos(x)} - 4\htmlClass{lc-blue}{\cos(3x)}\\[4pt] \htmlClass{lc-blue}{u(x,t)} &= \,?\end{aligned}
L=π,    k=1L = \pi,\;\; k = 1

Example 1: L=πL = \pi, k=1k = 1, insulated ends, with u(x,0)=50+10cos⁡(x)−4cos⁡(3x)\temp{u(x,0)} = \steady{50} + 10\mode{\cos(x)} - 4\mode{\cos(3x)}.

Text solution
Attach each cosine mode's time decay e−n2t\decay{e^{-n^2 t}} With L=πL = \pi and k=1k = 1, the insulated modes cos⁡(nπxL)\mode{\cos\left(\tfrac{n\pi x}{L}\right)} are cos⁡(nx)\mode{\cos(nx)} with decay factor e−n2t\decay{e^{-n^2 t}}, and u(x,0)\temp{u(x,0)} is already written as a sum of the n=0n = 0, n=1n = 1, and n=3n = 3 modes.
u(x,t)=50e0⏟1+10cos⁡(x)e−12t−4cos⁡(3x)e−32t=50+10cos⁡(x)e−t−4cos⁡(3x)e−9t\displaystyle \begin{aligned} \temp{u(x,t)} &= \steady{50}\underbrace{\decay{e^{0}}}_{1} + 10\mode{\cos(x)}\decay{e^{-1^2 t}} \\ &\quad - 4\mode{\cos(3x)}\decay{e^{-3^2 t}} \\ &= \steady{50} + 10\mode{\cos(x)}\decay{e^{-t}} \\ &\quad - 4\mode{\cos(3x)}\decay{e^{-9t}} \end{aligned}
So the cos⁡(3x)\mode{\cos(3x)} wave dies out nine times faster than the cos⁡(x)\mode{\cos(x)} wave, and the rod settles to a uniform 50∘\steady{50^\circ}.

Example 2: L=πL = \pi, k=1k = 1, insulated ends, with u(x,0)=x\temp{u(x,0)} = x.

Text solution
Average starting temperature a0\steady{a_0} The constant mode a0\steady{a_0} is the average value of u(x,0)=x\temp{u(x,0)} = x across the rod from 00 to π\pi.
a0\displaystyle \steady{a_0} =1π∫0πx dx\displaystyle = \frac{1}{\pi}\int_0^\pi \temp{x}\,dx =1π[x22]0π\displaystyle = \frac{1}{\pi}\left[\frac{x^2}{2}\right]_0^\pi =π2\displaystyle = \frac{\pi}{2}
Cosine coefficients ana_n by integration by parts To build the tilted line x\temp{x} out of cos⁡(nx)\mode{\cos(nx)} waves, we integrate by parts, differentiating x\temp{x} and integrating cos⁡(nx)\mode{\cos(nx)}, using sin⁡(nπ)=0\sin(n\pi) = 0 and cos⁡(nπ)=(−1)n\cos(n\pi) = (-1)^n at the upper limit.
an=2π∫0πxcos⁡(nx) dx=2π[xsin⁡(nx)n+cos⁡(nx)n2]0π=2πn2((−1)n−1)\displaystyle \begin{aligned} a_n &= \frac{2}{\pi}\int_0^\pi \temp{x}\mode{\cos(nx)}\,dx \\ &= \frac{2}{\pi}\left[\frac{x\sin(nx)}{n} + \frac{\cos(nx)}{n^2}\right]_0^\pi \\ &= \frac{2}{\pi n^2}\big((-1)^n - 1\big) \end{aligned}
Keep odd modes and attach time decay e−n2t\decay{e^{-n^2 t}} Because (−1)n−1(-1)^n - 1 is 00 for even nn and −2-2 for odd n=1,3,5,…n = 1, 3, 5, \dots, only the odd cosine waves survive, each shrinking by e−n2t\decay{e^{-n^2 t}}.
u(x,t)=π2+∑odd n(−4πn2)cos⁡(nx)e−n2t=π2−4π(cos⁡(x)e−t+19cos⁡(3x)e−9t+125cos⁡(5x)e−25t+⋯)\displaystyle \begin{aligned} \temp{u(x,t)} &= \steady{\frac{\pi}{2}} + \sum_{\text{odd } n} \left(-\frac{4}{\pi n^2}\right)\mode{\cos(nx)}\decay{e^{-n^2 t}} \\ &= \steady{\frac{\pi}{2}} - \frac{4}{\pi}\Big(\mode{\cos(x)}\decay{e^{-t}} + \frac{1}{9}\mode{\cos(3x)}\decay{e^{-9t}} \\ &\qquad + \frac{1}{25}\mode{\cos(5x)}\decay{e^{-25t}} + \cdots\Big) \end{aligned}
So the ends of the line u(x,0)=x\temp{u(x,0)} = x bend flat and the rod levels out at its midpoint temperature π2\steady{\frac{\pi}{2}}.
3

Fixed Nonzero Temperatures and Steady State

When the ends of a rod are held at nonzero temperatures, say u(0,t)=100∘\temp{u(0,t)} = 100^\circ on the left and u(L,t)=20∘\temp{u(L,t)} = 20^\circ on the right, we cannot just add waves that match those end values, because adding two solutions would add their boundary temperatures too. We want to find u(x,t)\temp{u(x,t)} for a rod of length LL that starts at u(x,0)=0∘\temp{u(x,0)} = 0^\circ and has its ends held at 100∘100^\circ and 20∘20^\circ.

Fixed Nonzero Temperatures and Steady State
20\htmlClass{lc-mute}{20}
100\htmlClass{lc-mute}{100}
0\htmlClass{lc-mute}{0}
L\htmlClass{lc-mute}{L}
u(0,t)=100∘\htmlClass{lc-blue}{u(0,t)} = 100^\circ
u(L,t)=20∘\htmlClass{lc-blue}{u(L,t)} = 20^\circ
lim⁡t→∞u(x,t)= ?\lim\limits_{t \to \infty} \htmlClass{lc-blue}{u(x,t)} = \,?
Text solution
Steady-state line usteady(x)\steady{u_{\text{steady}}(x)} as t→∞t \to \infty After all the changing waves die out, the temperature settles to the straight line connecting (0,100)(0, 100) to (L,20)(L, 20), where ∂2u∂x2=0\curv{\frac{\partial^2 u}{\partial x^2}} = 0.
usteady(x)\displaystyle \steady{u_{\text{steady}}(x)} =100−80Lx\displaystyle = 100 - \frac{80}{L}x
Starting difference w(x,0)\gap{w(x,0)} with zero endpoints Writing u(x,t)=usteady(x)+w(x,t)\temp{u(x,t)} = \steady{u_{\text{steady}}(x)} + \gap{w(x,t)} makes the difference w(x,t)\gap{w(x,t)} equal to 00 at both x=0x = 0 and x=Lx = L, with starting temperature u(x,0)−usteady(x)\temp{u(x,0)} - \steady{u_{\text{steady}}(x)}.
w(x,0)=0−(100−80Lx)=−100+80Lx\displaystyle \begin{aligned} \gap{w(x,0)} &= \temp{0} - \steady{\left(100 - \frac{80}{L}x\right)} \\ &= -100 + \frac{80}{L}x \end{aligned}
Sine coefficients bnb_n for the difference Since w(x,t)\gap{w(x,t)} is 00 at both ends, we expand w(x,0)\gap{w(x,0)} in sin⁡(nπxL)\mode{\sin\left(\tfrac{n\pi x}{L}\right)} using integration by parts, differentiating −100+80Lx\gap{-100 + \frac{80}{L}x} and integrating sin⁡(nπxL)\mode{\sin\left(\tfrac{n\pi x}{L}\right)}.
bn=2L∫0L(−100+80Lx)sin⁡ ⁣(nπxL)dx=2L[(−100+80Lx)(−Lnπcos⁡ ⁣(nπxL))]0L−2L∫0L80L(−Lnπcos⁡ ⁣(nπxL))dx⏟0 (whole half-cycles)=2L(20L(−1)nnπ−100Lnπ)=2nπ(20(−1)n−100)\displaystyle \begin{aligned} b_n &= \frac{2}{L}\int_0^L \gap{\left(-100 + \frac{80}{L}x\right)}\mode{\sin\!\left(\frac{n\pi x}{L}\right)}dx \\ &= \frac{2}{L}\left[\gap{\left(-100 + \frac{80}{L}x\right)}\left(-\frac{L}{n\pi}\cos\!\left(\frac{n\pi x}{L}\right)\right)\right]_0^L \\ &\qquad - \underbrace{\frac{2}{L}\int_0^L \frac{80}{L}\left(-\frac{L}{n\pi}\cos\!\left(\frac{n\pi x}{L}\right)\right)dx}_{0 \text{ (whole half-cycles)}} \\ &= \frac{2}{L}\left(\frac{20L(-1)^n}{n\pi} - \frac{100L}{n\pi}\right) \\ &= \frac{2}{n\pi}\big(20(-1)^n - 100\big) \end{aligned}
Add the steady-state line back to the decaying sine series Attaching the decay factor e−k(nπ/L)2t\decay{e^{-k(n\pi/L)^2 t}} to each sine mode gives w(x,t)\gap{w(x,t)}, which we add to usteady(x)\steady{u_{\text{steady}}(x)}.
u(x,t)=100−80Lx⏟usteady(x)+∑n=1∞2nπ(20(−1)n−100)sin⁡ ⁣(nπxL)e−k(nπ/L)2t\displaystyle \begin{aligned} \temp{u(x,t)} &= \underbrace{\steady{100 - \frac{80}{L}x}}_{\steady{u_{\text{steady}}(x)}} \\ &\quad + \sum_{n=1}^{\infty} \frac{2}{n\pi}\big(20(-1)^n - 100\big)\mode{\sin\!\left(\frac{n\pi x}{L}\right)}\decay{e^{-k(n\pi/L)^2 t}} \end{aligned}
So the sine sum fades away over time, leaving the tilted steady-state line 100−80Lx\steady{100 - \frac{80}{L}x}.

For any pair of fixed end temperatures, the steady-state line connects the two endpoints directly, and the vertical difference w(x,t)\gap{w(x,t)} between the temperature curve and that line stays at zero at both ends as it decays away.

For any fixed end temperatures, subtracting the straight steady-state line connecting them leaves a decaying gap that is zero at both ends.
4

One End Fixed, One End Insulated

Finally, we want to find u(x,t)\temp{u(x,t)} when the two ends have different boundary conditions: the left end is held at u(0,t)=0∘\temp{u(0,t)} = 0^\circ, while the right end is insulated, ∂u∂x(L,t)=0\slope{\frac{\partial u}{\partial x}(L,t)} = 0.

One End Fixed, One End Insulated
0\htmlClass{lc-mute}{0}
L\htmlClass{lc-mute}{L}
u(0,t)=0∘\htmlClass{lc-blue}{u(0,t)} = 0^\circ
∂u∂x(L,t)=0\htmlClass{lc-pink}{\frac{\partial u}{\partial x}(L,t)} = 0
u(x,t)= ?\htmlClass{lc-blue}{u(x,t)} = \,?
sin⁡(πxL)\htmlClass{lc-blue}{\sin\left(\tfrac{\pi x}{L}\right)}
half-wave\text{half-wave}
sin⁡(πx2L)\htmlClass{lc-blue}{\sin\left(\tfrac{\pi x}{2L}\right)}
quarter-wave\text{quarter-wave}
0\htmlClass{lc-mute}{0}
L\htmlClass{lc-mute}{L}

Holding x=0x = 0 at 0∘0^\circ gives us sin⁡(ωx)\mode{\sin(\omega x)}, and insulating x=Lx = L means sin⁡(ωx)\mode{\sin(\omega x)} must reach a flat peak or valley at x=Lx = L, where ωL\omega L is an odd multiple of π2\frac{\pi}{2}. So the rod fits an odd number of quarter-waves:

ωn\displaystyle \omega_n =(2n−1)π2L(n=1,2,3,… )\displaystyle = \frac{(2n - 1)\pi}{2L} \quad (n = 1, 2, 3, \dots)
u(x,t)\displaystyle \temp{u(x,t)} =∑n=1∞bnsin⁡ ⁣((2n−1)πx2L)e−k((2n−1)π/(2L))2t\displaystyle = \sum_{n=1}^{\infty} b_n \mode{\sin\!\left(\frac{(2n - 1)\pi x}{2L}\right)} \decay{e^{-k((2n - 1)\pi/(2L))^2 t}}

Each bnb_n comes from the same idea as the half-wave sine coefficients: the product of two different quarter-wave sines integrates to 00 over [0,L][0, L], and each one squared integrates to L2\frac{L}{2}, so

bn\displaystyle b_n =2L∫0Lu(x,0)sin⁡ ⁣((2n−1)πx2L)dx\displaystyle = \frac{2}{L}\int_0^L \temp{u(x,0)}\mode{\sin\!\left(\frac{(2n-1)\pi x}{2L}\right)}dx

Because the first mode sin⁡ ⁣(πx2L)\mode{\sin\!\left(\frac{\pi x}{2L}\right)} has half the frequency of sin⁡ ⁣(πxL)\mode{\sin\!\left(\frac{\pi x}{L}\right)}, its decay exponent has (12)2=14\curv{\left(\frac{1}{2}\right)^2} = \frac{1}{4}, so insulating one end makes the first mode decay four times slower. And if the left end is held at a nonzero temperature like 100∘100^\circ while the right end is insulated, no heat can cross x=Lx = L, so the steady state is the flat line usteady(x)=100∘\steady{u_{\text{steady}}(x)} = 100^\circ.

For a sine wave held at zero on the left end, the slope at the right end is nonzero and lets heat escape unless an odd number of quarter-waves fits into the rod, putting a flat peak or valley right at x=Lx = L.

With the left end held at 0°, only odd quarter-wave sines reach a flat peak or valley at the insulated right end and keep heat from leaking out through the cap.

Key concepts

Every heat equation problem on a rod of length LL comes down to two steps: subtract the t→∞t \to \infty steady state to make the boundary conditions zero, then match the waves to the zero conditions at the two ends.

Nonzero boundary temperatures: subtract the steady state first

Find the straight line usteady(x)\steady{u_{\text{steady}}(x)} that the rod settles to as t→∞t \to \infty, then solve for the difference w(x,t)=u(x,t)−usteady(x)\gap{w(x,t)} = \temp{u(x,t)} - \steady{u_{\text{steady}}(x)} starting from w(x,0)=u(x,0)−usteady(x)\gap{w(x,0)} = \temp{u(x,0)} - \steady{u_{\text{steady}}(x)}.

  • Both ends fixed (u(0,t)=100, u(L,t)=20\temp{u(0,t)} = 100,\, \temp{u(L,t)} = 20): tilted line usteady(x)=100−80Lx\steady{u_{\text{steady}}(x)} = 100 - \frac{80}{L}x.
  • One end fixed, one end insulated (u(0,t)=100, ∂u∂x(L,t)=0\temp{u(0,t)} = 100,\, \slope{\frac{\partial u}{\partial x}(L,t)} = 0): flat horizontal line usteady(x)=100\steady{u_{\text{steady}}(x)} = 100, because an insulated end has zero slope.
Zero boundary conditions: choose the modes that fit the ends

  • Both ends fixed at 00 (u(0,t)=0, u(L,t)=0\temp{u(0,t)} = 0,\, \temp{u(L,t)} = 0): half-wave sines sin⁡ ⁣(nπxL)\mode{\sin\!\left(\frac{n\pi x}{L}\right)}, decaying to 00.
  • Both ends insulated (∂u∂x(0,t)=0, ∂u∂x(L,t)=0\slope{\frac{\partial u}{\partial x}(0,t)} = 0,\, \slope{\frac{\partial u}{\partial x}(L,t)} = 0): average temperature plus half-wave cosines,
    u(x,t)=a0+∑n=1∞ancos⁡ ⁣(nπxL)e−k(nπ/L)2t,a0=1L∫0Lu(x,0) dx\displaystyle \begin{aligned} \temp{u(x,t)} &= \steady{a_0} \\ &\quad + \sum_{n=1}^{\infty} a_n \mode{\cos\!\left(\frac{n\pi x}{L}\right)} \\ &\qquad\quad \decay{e^{-k(n\pi/L)^2 t}}, \\ \steady{a_0} &= \frac{1}{L}\int_0^L \temp{u(x,0)}\,dx \end{aligned}
    which settles to the starting average a0\steady{a_0} (for u(x,0)=x\temp{u(x,0)} = x on [0,π][0,\pi], a0=π2\steady{a_0} = \frac{\pi}{2}).
  • Left end at 00, right end insulated (u(0,t)=0, ∂u∂x(L,t)=0\temp{u(0,t)} = 0,\, \slope{\frac{\partial u}{\partial x}(L,t)} = 0): odd quarter-wave sines sin⁡ ⁣((2n−1)πx2L)\mode{\sin\!\left(\frac{(2n-1)\pi x}{2L}\right)} for n=1,2,3,…n = 1, 2, 3, \dots, decaying to 00, with the n=1n = 1 mode decaying four times slower than with both ends at 00.
When not to integrate

If u(x,0)\temp{u(x,0)} (or w(x,0)\gap{w(x,0)}) is already written out in the rod's matching sine or cosine modes, such as u(x,0)=50+10cos⁡(x)−4cos⁡(3x)\temp{u(x,0)} = \steady{50} + 10\mode{\cos(x)} - 4\mode{\cos(3x)} on an insulated rod of length π\pi, skip the Fourier integrals and attach e−kωn2t\decay{e^{-k\omega_n^2 t}} directly to each term.

5

Practice

1

A rod of length L=πL = \pi with k=1k = 1 and insulated ends (∂u∂x(0,t)=0\slope{\frac{\partial u}{\partial x}(0,t)} = 0 and ∂u∂x(π,t)=0\slope{\frac{\partial u}{\partial x}(\pi,t)} = 0) has initial temperature u(x,0)=40−8cos⁡(x)+3cos⁡(4x)\temp{u(x,0)} = 40 - 8\cos(x) + 3\cos(4x). Find u(x,t)\temp{u(x,t)} and the temperature of the rod as t→∞t \to \infty.

On L=πL = \pi, the insulated modes are cos⁡(nx)\mode{\cos(nx)}. Is u(x,0)\temp{u(x,0)} already written as a sum of those modes, and what is the decay factor for each nn?

With L=πL = \pi and k=1k = 1, the natural cosine modes are cos⁡(nx)\mode{\cos(nx)} and each decays by e−n2t\decay{e^{-n^2 t}}:
40\steady{40} is the n=0n = 0 constant mode (e0=1\decay{e^0} = 1).
−8cos⁡(x)-8\mode{\cos(x)} is the n=1n = 1 mode (e−12t=e−t\decay{e^{-1^2 t}} = \decay{e^{-t}}).
3cos⁡(4x)3\mode{\cos(4x)} is the n=4n = 4 mode (e−42t=e−16t\decay{e^{-4^2 t}} = \decay{e^{-16t}}). (Watch out: a common slip is forgetting to square n=4n = 4 in the exponent and writing e−4te^{-4t}, which gives 40−8cos⁡(x)e−t+3cos⁡(4x)e−4t40 - 8\cos(x)e^{-t} + 3\cos(4x)e^{-4t}, or assuming the rod cools to 00 instead of its average 40\steady{40}.)
u(x,t)=40−8cos⁡(x)e−t+3cos⁡(4x)e−16t;as t→∞, the temperatureapproaches 40.\displaystyle \begin{gathered} \begin{aligned} \temp{u(x,t)} &= \steady{40} - 8\mode{\cos(x)}\decay{e^{-t}} \\ &\quad + 3\mode{\cos(4x)}\decay{e^{-16t}}; \end{aligned} \\ \text{as } t \to \infty, \text{ the temperature} \\ \text{approaches } \steady{40}. \end{gathered}
2

A rod of length L=πL = \pi with k=1k = 1 and insulated ends (∂u∂x(0,t)=0\slope{\frac{\partial u}{\partial x}(0,t)} = 0 and ∂u∂x(π,t)=0\slope{\frac{\partial u}{\partial x}(\pi,t)} = 0) has initial temperature u(x,0)=2π−2x\temp{u(x,0)} = 2\pi - 2x. Find u(x,t)\temp{u(x,t)}.

Start by finding the average temperature a0\steady{a_0} of 2π−2x\temp{2\pi - 2x} on [0,π][0, \pi], then integrate an=2π∫0π(2π−2x)cos⁡(nx) dxa_n = \frac{2}{\pi}\int_0^\pi \temp{(2\pi - 2x)}\mode{\cos(nx)}\,dx by parts.

First find the average starting temperature a0\steady{a_0}:
a0\displaystyle \steady{a_0} =1π∫0π(2π−2x) dx\displaystyle = \frac{1}{\pi}\int_0^\pi \temp{(2\pi - 2x)}\,dx =1π[2πx−x2]0π\displaystyle = \frac{1}{\pi}\left[2\pi x - x^2\right]_0^\pi =π\displaystyle = \pi
Next find ana_n by integrating by parts, differentiating 2π−2x\temp{2\pi - 2x} to get −2-2 and integrating cos⁡(nx)\mode{\cos(nx)} to get sin⁡(nx)n\frac{\sin(nx)}{n}:
an=2π∫0π(2π−2x)cos⁡(nx) dx=2π[(2π−2x)sin⁡(nx)n−2cos⁡(nx)n2]0π=4πn2(1−(−1)n)\displaystyle \begin{aligned} a_n &= \frac{2}{\pi}\int_0^\pi \temp{(2\pi - 2x)}\mode{\cos(nx)}\,dx \\ &= \frac{2}{\pi}\left[\frac{(2\pi - 2x)\sin(nx)}{n} - \frac{2\cos(nx)}{n^2}\right]_0^\pi \\ &= \frac{4}{\pi n^2}\big(1 - (-1)^n\big) \end{aligned}
(Watch out: dropping the minus sign from the derivative −2-2 flips the sign of the 2cos⁡(nx)n2\frac{2\cos(nx)}{n^2} term and gives π−8π(cos⁡(x)e−t+19cos⁡(3x)e−9t+⋯)\pi - \frac{8}{\pi}\big(\cos(x)e^{-t} + \frac{1}{9}\cos(3x)e^{-9t} + \cdots\big).)
For even nn, an=0a_n = 0; for odd n=1,3,5,…n = 1, 3, 5, \dots, an=8πn2a_n = \frac{8}{\pi n^2}. Attaching e−n2t\decay{e^{-n^2 t}} gives:
u(x,t)=π+8π(cos⁡(x)e−t+19cos⁡(3x)e−9t+125cos⁡(5x)e−25t+⋯),orπ+∑n=1∞4πn2(1−(−1)n)cos⁡(nx)e−n2t.\displaystyle \begin{aligned} \temp{u(x,t)} &= \steady{\pi} + \frac{8}{\pi}\Big(\mode{\cos(x)}\decay{e^{-t}} + \frac{1}{9}\mode{\cos(3x)}\decay{e^{-9t}} \\ &\qquad + \frac{1}{25}\mode{\cos(5x)}\decay{e^{-25t}} + \cdots\Big), \quad \text{or} \\ &\quad \steady{\pi} + \sum_{n=1}^{\infty} \frac{4}{\pi n^2}\big(1 - (-1)^n\big)\mode{\cos(nx)}\decay{e^{-n^2 t}}. \end{aligned}
3

A rod of length LL with diffusivity kk starts at a uniform temperature u(x,0)=40\temp{u(x,0)} = 40. At t=0t = 0, the left end is held at u(0,t)=40\temp{u(0,t)} = 40 and the right end is held at u(L,t)=100\temp{u(L,t)} = 100. Find u(x,t)\temp{u(x,t)}.

First write the straight steady-state line usteady(x)\steady{u_{\text{steady}}(x)} connecting (0,40)(0, 40) to (L,100)(L, 100), then subtract it from u(x,0)=40\temp{u(x,0)} = 40 to find the starting difference w(x,0)\gap{w(x,0)}.

The straight steady-state line from 4040 at x=0x = 0 to 100100 at x=Lx = L is:
usteady(x)\displaystyle \steady{u_{\text{steady}}(x)} =40+60Lx\displaystyle = 40 + \frac{60}{L}x
Subtracting usteady(x)\steady{u_{\text{steady}}(x)} from u(x,0)=40\temp{u(x,0)} = 40 gives the starting difference:
w(x,0)=u(x,0)−usteady(x)=40−(40+60Lx)=−60Lx\displaystyle \begin{aligned} \gap{w(x,0)} &= \temp{u(x,0)} - \steady{u_{\text{steady}}(x)} \\ &= \temp{40} - \steady{\left(40 + \frac{60}{L}x\right)} \\ &= -\frac{60}{L}x \end{aligned}
(Watch out: subtracting in the reverse order, usteady(x)−u(x,0)=60Lx\steady{u_{\text{steady}}(x)} - \temp{u(x,0)} = \frac{60}{L}x, flips every coefficient's sign and gives −120(−1)nnπ-\frac{120(-1)^n}{n\pi} inside the sum.)
Expanding w(x,0)=−60Lx\gap{w(x,0)} = -\frac{60}{L}x in a sine series on [0,L][0, L] by integrating by parts, differentiating −60Lx\gap{-\frac{60}{L}x} and integrating sin⁡(nπxL)\mode{\sin\left(\tfrac{n\pi x}{L}\right)}; the leftover integral of a constant times cos⁡(nπxL)\cos\left(\tfrac{n\pi x}{L}\right) over [0,L][0, L] is 00:
bn=2L∫0L(−60Lx)sin⁡ ⁣(nπxL)dx=2L[(−60Lx)(−Lnπcos⁡ ⁣(nπxL))]0L=120(−1)nnπ\displaystyle \begin{aligned} b_n &= \frac{2}{L}\int_0^L \gap{\left(-\frac{60}{L}x\right)}\mode{\sin\!\left(\frac{n\pi x}{L}\right)}dx \\ &= \frac{2}{L}\left[\gap{\left(-\frac{60}{L}x\right)}\left(-\frac{L}{n\pi}\cos\!\left(\frac{n\pi x}{L}\right)\right)\right]_0^L \\ &= \frac{120(-1)^n}{n\pi} \end{aligned}
Attaching the time decay and adding back usteady(x)\steady{u_{\text{steady}}(x)} gives:
u(x,t)=40+60Lx+∑n=1∞120(−1)nnπsin⁡ ⁣(nπxL)e−k(nπ/L)2t.\displaystyle \begin{aligned} \temp{u(x,t)} &= \steady{40 + \frac{60}{L}x} \\ &\quad + \sum_{n=1}^{\infty} \frac{120(-1)^n}{n\pi}\mode{\sin\!\left(\frac{n\pi x}{L}\right)}\decay{e^{-k(n\pi/L)^2 t}}. \end{aligned}
4

A rod of length LL with diffusivity kk has its left end held at u(0,t)=0\temp{u(0,t)} = 0 and its right end insulated, ∂u∂x(L,t)=0\slope{\frac{\partial u}{\partial x}(L,t)} = 0. Write the fundamental (n=1n = 1) mode and compare its exponential decay rate to the fundamental mode of the same rod with both ends held at 00.

What fraction of a sine wave starts at 00 at x=0x = 0 and reaches its first flat peak at x=Lx = L, and what happens to that frequency in the decay exponent?

For n=1n = 1, a single quarter-wave sin⁡ ⁣(πx2L)\mode{\sin\!\left(\frac{\pi x}{2L}\right)} starts at 00 on the left and reaches its first flat peak at x=Lx = L, with frequency ω1=π2L\omega_1 = \frac{\pi}{2L}. Squaring ω1\omega_1 in the exponential factor e−kω12t\decay{e^{-k\omega_1^2 t}} gives a decay rate of:
k(π2L)2\displaystyle \decay{k\left(\frac{\pi}{2L}\right)^2} =kπ24L2\displaystyle = \frac{k\pi^2}{4L^2}
(Watch out: forgetting to square the 12\frac{1}{2} in ω1=π2L\omega_1 = \frac{\pi}{2L} leads to saying the decay rate is 12\frac{1}{2} as large, or two times slower, instead of 14\frac{1}{4}.)
The fundamental mode is b1sin⁡ ⁣(πx2L)e−k(π/(2L))2tb_1\mode{\sin\!\left(\frac{\pi x}{2L}\right)}\decay{e^{-k(\pi/(2L))^2 t}}. Its decay rate kπ24L2\decay{\frac{k\pi^2}{4L^2}} is 14\frac{1}{4} of the decay rate kπ2L2\decay{\frac{k\pi^2}{L^2}} for the rod with both ends at 00, so it cools four times slower.
5

A rod of length L=πL = \pi with k=1k = 1 has its left end held at u(0,t)=90\temp{u(0,t)} = 90 and its right end insulated, ∂u∂x(π,t)=0\slope{\frac{\partial u}{\partial x}(\pi,t)} = 0. Given the initial temperature u(x,0)=90−12sin⁡(x2)+5sin⁡(3x2)\temp{u(x,0)} = 90 - 12\sin\left(\tfrac{x}{2}\right) + 5\sin\left(\tfrac{3x}{2}\right), find u(x,t)\temp{u(x,t)} and the steady-state temperature as t→∞t \to \infty.

Since no heat can cross the insulated right end at x=πx = \pi, what is the steady-state line when the left end is held at 9090? Then check the frequencies ω\omega of the two sine terms.

Because the right end is insulated (∂u∂x(π,t)=0\slope{\frac{\partial u}{\partial x}(\pi,t)} = 0), the steady-state line must have zero slope while matching 9090 at x=0x = 0, so usteady(x)=90\steady{u_{\text{steady}}(x)} = 90. Subtracting 90\steady{90} leaves w(x,0)=−12sin⁡(x2)+5sin⁡(3x2)\gap{w(x,0)} = -12\mode{\sin\left(\tfrac{x}{2}\right)} + 5\mode{\sin\left(\tfrac{3x}{2}\right)}, which is already written in the quarter-wave modes sin⁡ ⁣((2n−1)x2)\mode{\sin\!\left(\frac{(2n-1)x}{2}\right)} for n=1n = 1 (ω1=12\omega_1 = \frac{1}{2}) and n=2n = 2 (ω2=32\omega_2 = \frac{3}{2}).
Attaching e−ω2t\decay{e^{-\omega^2 t}} to each mode gives e−(1/2)2t=e−t/4\decay{e^{-(1/2)^2 t}} = \decay{e^{-t/4}} and e−(3/2)2t=e−9t/4\decay{e^{-(3/2)^2 t}} = \decay{e^{-9t/4}}. (Watch out: forgetting to square the frequencies 12\frac{1}{2} and 32\frac{3}{2} gives 90−12sin⁡(x2)e−t/2+5sin⁡(3x2)e−3t/290 - 12\sin\left(\tfrac{x}{2}\right)e^{-t/2} + 5\sin\left(\tfrac{3x}{2}\right)e^{-3t/2}.)
u(x,t)=90−12sin⁡(x2)e−t/4+5sin⁡(3x2)e−9t/4;as t→∞, the temperatureapproaches the flat steady stateusteady(x)=90.\displaystyle \begin{gathered} \begin{aligned} \temp{u(x,t)} &= \steady{90} - 12\mode{\sin\left(\tfrac{x}{2}\right)}\decay{e^{-t/4}} \\ &\quad + 5\mode{\sin\left(\tfrac{3x}{2}\right)}\decay{e^{-9t/4}}; \end{aligned} \\ \text{as } t \to \infty, \text{ the temperature} \\ \text{approaches the flat steady state} \\ \steady{u_{\text{steady}}(x)} = 90. \end{gathered}