Solution (source code)

= Solution

With constant positive <thermal diffusivity> $\nu$, no internal heat source and one spatial coordinate, the <heat equation> is
$$
\boxed{\partial_t\theta=\nu\partial_x^2\theta,\qquad0<x<L.}
$$
<Separation of variables> makes each spatial mode decay by $e^{-\nu k^2t}$. The endpoint conditions determine whether the initial triangular profile is expanded in a <Fourier sine series> or a <Fourier cosine series>.

\Image[/past-exam-of-the-mathematics-course-of-the-year-2-of-the-natural-sciences-course-of-the-university-of-cambridge/2004/paper-1-triangular-heat-boundaries.png]
{title=The same triangular initial temperature with cooled and insulated ends}
{description=Original heat-equation solutions for several dimensionless times. Fixed zero-temperature ends cool the bar to zero; insulated ends preserve its initial mean and approach a uniform temperature.}