Originally Posted by

**TheEmptySet** This is exactly what you need! The solution is

$\displaystyle u(x,t)=\frac{1}{2}+\sum_{n=1}^{\infty}\left( \frac{2}{n^2\pi^2}[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}$

With what I said above we take take derivatives inside the sum this gives

$\displaystyle \frac{\partial }{\partial x} u(x,t)=\frac{\partial }{\partial x} \frac{1}{2}+\frac{\partial }{\partial x} \sum_{n=1}^{\infty}\left( \frac{2}{n^2\pi^2}[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}$

$\displaystyle \frac{\partial }{\partial x} u(x,t)=\sum_{n=1}^{\infty}\frac{\partial }{\partial x} \left( \frac{2}{n^2\pi^2}[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}=-\sum_{n=1}^{\infty}\left( \frac{2}{n\pi}[(-1)^n-1]\right)\sin(n \pi x)e^{-kn^2\pi^2t}$

Now if we take one more derivative with respect to x we get

$\displaystyle \frac{\partial^2 }{\partial x^2} u(x,t)=-\sum_{n=1}^{\infty}\left( 2[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}$

Now if you do the same thing with respect to t we get

$\displaystyle \frac{\partial }{\partial t} u(x,t)=-k\sum_{n=1}^{\infty}\left( 2[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}$

Now if you plug these into the ode you get

$\displaystyle u_t-ku_{xx}=-k\sum_{n=1}^{\infty}\left( 2[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}-k\left( -\sum_{n=1}^{\infty}\left( 2[(-1)^n-1]\right)\cos(n \pi x)e^{-kn^2\pi^2t}\right)=0$

The key idea is we need to exchange limits eg bring the derivative inside the infinite sum.

We actually need more than just uniform convergence of the function, they must also be continuous and their derivatives must be uniformly convergent.