# PDE5

 $u_{t}=ku_{{xx}}\,$ $u(0,t)=0\,$$u(l,t)=0\,$$u(x,0)=f(x)\,$

First separate variables and plug back into the original equation.

$u(x,t)=X(x)T(t)\,$

$XT'=kX''T\,$

Find the separated boundary conditions (worry about the initial condition later).

$X(0)=X(l)=0\,$

Now seperate the two functions on either side of the equation. The reasoning is that if the left side is a function of $t$ and it is equal to the right side, which is a function of $x$, then both sides of the equation must be equal to a constant. It's good to keep higher derivatives on top of lower ones, and keep the $k$ with $T(t)$. When setting the next part equal to a constant, $-\lambda$ works best.

${\frac {T'}{kT}}={\frac {X''}{X}}=-\lambda \,$

This gives the two solutions to the ODEs:

$T(t)=c_{1}e^{{-\lambda kt}}\,$

$X(x)=c_{2}\cos({\sqrt {\lambda }}x)+c_{3}{\frac {\sin({\sqrt {\lambda }}x)}{{\sqrt {\lambda }}}}\,$

In the solution of $X(x)$ the extra square root of $\lambda$ was added in the denominator so that we won't have to make a special case for $\lambda =0\,$, which does not give interesting solutions anyway.

Use the separated boundary conditions on the function $X(x)$.

$X(0)=c_{2}=0\,$

$X(l)=c_{3}{\frac {\sin({\sqrt {\lambda }}l)}{{\sqrt {\lambda }}}}=0\,$

Nothing interesting would come from letting $c_{3}=0\,$, so $\lambda _{n}={\frac {n^{2}\pi ^{2}}{l^{2}}},\,\,\,n=1,2,3,...\,$. $n\neq 0\,$ because $\lambda \neq 0\,$. These values of lambda are the eigenvalues. The eigenfunctions are $\sin({\frac {n\pi x}{l}}),\,\,\,n=1,2,3,...\,$.

For each value of n, a solution is then

$u_{n}(x,t)=c_{1}e^{{-\lambda _{n}kt}}c_{3}{\frac {\sin({\sqrt {\lambda _{n}}}x)}{{\sqrt {\lambda _{n}}}}}\,$

Using the principle of superposition, the formal solution is the sum of all possible solutions:

$u(x,t)=\sum _{{n=1}}^{\infty }u_{n}(x,t)=\sum _{{n=1}}^{\infty }A_{n}e^{{-\lambda _{n}kt}}\sin({\frac {n\pi x}{l}}),A_{n}={\frac {c_{1}c_{3}}{{\frac {n\pi }{l}}}}\,$

The initial condition gives

$u(x,0)=f(x)=\sum _{{n=1}}^{\infty }A_{n}\sin({\frac {n\pi x}{l}})\,$

This series is the Fourier sine series of $f(x)$, so the coefficient is given by

$A_{n}={\frac {2}{l}}\int _{0}^{l}f(x)\sin({\frac {n\pi x}{l}})\,dx\,$

$u(x,t)=\sum _{{n=1}}^{\infty }A_{n}e^{{-\left({\frac {n\pi }{l}}\right)^{2}kt}}\sin({\frac {n\pi x}{l}}),\,\,\,A_{n}={\frac {2}{l}}\int _{0}^{l}f(x)\sin({\frac {n\pi x}{l}})\,dx\,$
$u(x,t)={\frac {2}{l}}\sum _{{n=1}}^{\infty }\left[\int _{0}^{l}f(\xi )\sin({\frac {n\pi \xi }{l}})\,d\xi \right]e^{{-\left({\frac {n\pi }{l}}\right)^{2}kt}}\sin({\frac {n\pi x}{l}})\,$