
\documentclass{article}
\usepackage{amsmath}

\begin{document}


\begin{center}
Wave Equation
\end{center}

\begin{align*}
\frac{\partial ^{2}u}{\partial t^{2}}-c^{2}\frac{\partial ^{2}u}{\partial
x^{2}}& =0\qquad 0<x<l\quad 0<t<\infty \\
u(x,0)& =\varphi (x) \\
u_{t}(x,0)& =\psi (x) \\
u(0,t)& =0\quad u(l,t)=0
\end{align*}

\begin{center}
Heat Equation
\end{center}

\begin{align*}
\frac{\partial u}{\partial t}-k\frac{\partial ^{2}u}{\partial x^{2}}&
=0\qquad 0<x<l\quad 0<t<\infty \\
u(x,0)& =\varphi (x) \\
u(0,t)& =0\quad u(l,t)=0
\end{align*}

\bigskip

\noindent We assume that $u$ can be expressed as a Fourier sine series%
\begin{equation*}
u(x,t)=\dsum\limits_{n=1}^{\infty }A_{n}(t)\sin \left( \frac{n\pi x}{l}%
\right)
\end{equation*}

This automatically satisfies the boundary conditions. Also since $\sin $ is
a solution to both the wave and heat equations it will satisfy the PDE. Thus
the main question is the intial conditions. Formally put in the equation.%
\begin{align*}
\frac{\partial ^{2}u}{\partial x^{2}}(x,t)& =-\dsum\limits_{n=1}^{\infty
}\left( \frac{n\pi }{l}\right) ^{2}A_{n}(t)\sin \left( \frac{n\pi x}{l}%
\right) \\
\frac{\partial u}{\partial t}(x,t)& =\dsum\limits_{n=1}^{\infty
}A_{n}^{\prime }(t)\sin \left( \frac{n\pi x}{l}\right) \\
\frac{\partial ^{2}u}{\partial t^{2}}(x,t)& =\dsum\limits_{n=1}^{\infty
}A_{n}^{\prime \prime }(t)\sin \left( \frac{n\pi x}{l}\right)
\end{align*}

\noindent So 
\begin{align*}
\dsum\limits_{n=1}^{\infty }\left[ A_{n}^{\prime }(t)+\left( \frac{n\pi }{l}%
\right) ^{2}A_{n}(t)\right] \sin \left( \frac{n\pi x}{l}\right) &= 0 \qquad 
\text{heat equation} \\
\dsum\limits_{n=1}^{\infty }\left[ B_{n}^{\prime \prime }(t)+\left( \frac{%
n\pi }{l}\right) ^{2}B_{n}(t)\right] \sin \left( \frac{n\pi x}{l}\right) &=
0 \qquad \text{wave equation}
\end{align*}

\noindent or setting the coefficient of each $\sin \left( \frac{n\pi x}{l}%
\right) $ to zero we get

\begin{align*}
A_{n}^{\prime }(t)+\left( \frac{n\pi }{l}\right) ^{2}A_{n}(t) &= 0 \qquad 
\text{all n \quad heat equation} \\
B_{n}^{\prime \prime }(t)+\left( \frac{n\pi }{l}\right) ^{2}B_{n}(t) &= 0
\qquad \text{all n \quad wave equation}
\end{align*}

\noindent so%
\begin{align*}
A_{n}(t)& =A_{n}(0)\text{ }e^{-\left( \frac{n\pi }{l}\right) ^{2}t}\qquad
\qquad \qquad \qquad \qquad \qquad \quad \text{all n \quad heat equation} \\
B_{n}(t)& =B_{n}(0)\cos (\frac{n\pi }{l}t)+\frac{l}{n\pi }B_{n}^{%
%TCIMACRO{\U{b4}}%
%BeginExpansion
{\acute{}}%
%EndExpansion
}(0)\text{ }\sin (\frac{n\pi }{l}t)\qquad \ \text{all n \quad wave equation}
\end{align*}

\bigskip

So we have solved the PDE and boundary conditions. What remains is the
intial conditions, i.e. find $A_{n}(0)$, $B_{n}(0)$, $B_{n}^{%
%TCIMACRO{\U{b4}}%
%BeginExpansion
{\acute{}}%
%EndExpansion
}(0)$ so that 
\begin{eqnarray*}
\varphi (x) &=&u(x,0)=\dsum\limits_{n=1}^{\infty }A_{n}(0)\sin \left( \frac{%
n\pi x}{l}\right) \quad \text{heat equation} \\
\varphi (x) &=&u(x,0)=\dsum\limits_{n=1}^{\infty }B_{n}(0)\sin \left( \frac{%
n\pi x}{l}\right) \quad \text{wave equation} \\
\psi (x) &=&u(x,0)=\dsum\limits_{n=1}^{\infty }B_{n}^{%
%TCIMACRO{\U{b4}}%
%BeginExpansion
{\acute{}}%
%EndExpansion
}(0)\sin \left( \frac{n\pi x}{l}\right) \quad \text{wave equation}
\end{eqnarray*}

\bigskip

\noindent Theorem:

\bigskip 
\begin{equation*}
\dint\limits_{0}^{l} \sin \left( \frac{n\pi x}{l}\right) \sin \left( \frac{%
m\pi x}{l}\right) dx= 
\begin{cases}
0 & m \ne n \\ 
\frac{l}{2} & m=n%
\end{cases}%
\end{equation*}

\noindent If%
\begin{equation*}
\varphi (x)=\dsum\limits_{n=1}^{\infty }A_{n}\sin \left( \frac{n\pi x}{l}%
\right)
\end{equation*}

\noindent then

\begin{equation*}
A_{n}=\frac{2}{l}\dint\limits_{0}^{l}\varphi (x)\sin \left( \frac{n\pi x}{l}%
\right) dx
\end{equation*}%
proof:

\end{document}
