= Solution
For the <heat equation> $\Theta_t=\kappa\Theta_{xx}$, <separation of variables> with homogeneous <Neumann boundary condition> at both ends gives spatial modes $\cos(n\pi x/L)$ and decay factors $e^{-\kappa(n\pi/L)^2t}$. The $n=0$ mode is constant and does not decay.
The initial profile already contains only two such modes:
$$
T_0\sin^2\frac{\pi x}{L}=\frac{T_0}{2}-\frac{T_0}{2}\cos\frac{2\pi x}{L}.
$$
Evolving each mode therefore yields
$$
\boxed{\Theta(x,t)=\frac{T_0}{2}\left[1-e^{-4\kappa\pi^2t/L^2}\cos\frac{2\pi x}{L}\right].}
$$
The endpoint <derivatives> vanish, and substitution checks both the equation and the initial profile. The spatial <integral> remains $LT_0/2$: no heat escapes through insulated ends, so the limiting uniform temperature is $T_0/2$.
\Image[/past-exam-of-the-mathematics-course-of-the-year-1-of-the-natural-sciences-course-of-the-university-of-cambridge/2021/paper-2-q20-heat.png]
{title=Insulated and zero-temperature endpoints evolve the same initial heat profile differently}
{description=Original mode calculations. Both panels start from the same squared sine. Insulated endpoints conserve the mean temperature and approach $T_0/2$; zero-temperature endpoints remove heat and the profile decays to zero. Times are expressed as $\tau=\kappa\pi^2t/L^2$.}
Back to article page