Find the solution $u(x,t)$ How do I find the solution $u(x,t)$ to this problem?
$$\left\{
\begin{array}{l l}
u_t - ku_{xx} = 0 & \quad 0<x<\pi, t>0, \\
\quad u(x,0) = 3\sin x+6\sin 5x &\quad 0\leq x \leq \pi, \\
\quad u(0,t) = u(\pi,t)=0  &\quad t \geq 0. 
\end{array} 
\right. $$
 A: By linearity of this differential equation, it is enough to solve these two initial-value problems separately and then add the two solutions:
$$
\left\{
\begin{array}{l l}
u_t - ku_{xx} = 0 & \quad 0<x<\pi, t>0, \\
\quad u(x,0) = 3\sin x &\quad 0\leq x \leq \pi, \\
\quad u(0,t) = u(\pi,t)=0  &\quad t \geq 0. 
\end{array} 
\right.
$$
$$
\left\{
\begin{array}{l l}
u_t - ku_{xx} = 0 & \quad 0<x<\pi, t>0, \\
\quad u(x,0) = 6\sin 5x &\quad 0\leq x \leq \pi, \\
\quad u(0,t) = u(\pi,t)=0  &\quad t \geq 0. 
\end{array} 
\right.
$$
The second one will admit a solution of the form
$$
u(x,t) = e^{at} 6\sin(5x) \tag 1
$$
provided you get the right value of $a.$ So find $u_t$ and $u_{xx}$ with $u$ as in $(1)$ in order to figure out what number $a$ has to be. The first initial-value problem above is treated similarly, but the value of $a$ will be different.
That this works out so neatly is the reason why Fourier series are the key to understanding diffusion equations of this sort.
A: Separation of variables can be used to solve this problem. Starting with solutions of the form $X(x)T(t)$ gives a parameter $\lambda$ such that
$$
            \frac{T'}{kT}= \lambda = \frac{X''}{X} \\
                 X(0)=0,\;\; X(\pi)=0.
$$
The $X$ equation determines the possible $\lambda$ because only $\lambda=-n^2$ leads to $X$ that satisfies the endpoint conditions. The separated solutions are
$$
           T_n(t)=e^{-n^2k t},\;\; X_n(x)=\sin(n x).
$$
The general solution is
$$
         u(x,t) =\sum_{n=1}^{\infty}C_nT_n(t)X_n(x)
$$
where the constants $C_n$ are chose to satisfy the initial condition
\begin{align}
              \sum_{n=1}^{\infty}C_n T_n(0)X_n(x)&=3\sin x + 6\sin 5x\\
   \sum_{n=1}^{\infty}C_n\sin(nx)& = 3\sin(x)+6\sin(5x).
\end{align}
From this you could guess that $C_n=0$ unless $n=1,5$, and $C_1=3, C_5=6$. This leads to the correct solution:
$$
       u(x,t)=3e^{-kt}\sin(x)+6e^{-25kt}\sin(5x).
$$
