\documentclass{article}
\usepackage{amsmath}

\setcounter{MaxMatrixCols}{10}
%TCIDATA{OutputFilter=LATEX.DLL}
%TCIDATA{Version=5.00.0.2606}
%TCIDATA{<META NAME="SaveForMode" CONTENT="1">}
%TCIDATA{BibliographyScheme=Manual}
%TCIDATA{LastRevised=Monday, December 19, 2005 10:17:59}
%TCIDATA{<META NAME="GraphicsSave" CONTENT="32">}

\input{tcilatex}

\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
initial conditions, i.e. find $A_{n}(0)$, $B_{n}(0)$, $B_{n}^(0)$ so that 
\begin{align*}
\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}^{\prime}(0) \sin \left( 
\frac{n\pi x}{l}\right) \quad \text{wave equation}
\end{align*}

\bigskip

\begin{center}
Sine Series
\end{center}

\noindent Theorem:

\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\neq n \\ 
\frac{l}{2} & m=n%
\end{cases}%
\end{equation*}

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

\noindent then

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

\bigskip \newpage

\begin{center}
Cosine Series
\end{center}

Theorem:

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

\noindent If%
\begin{equation*}
\varphi (x)=\frac{A_{0}}{2}+\dsum\limits_{n=1}^{\infty }A_{n}\cos \left( 
\frac{n\pi x}{l}\right) \qquad 0<x<l
\end{equation*}

\noindent then

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

\bigskip

\begin{center}
Full interval Series
\end{center}

Theorem:

\begin{align*}
\dint\limits_{-l}^{l}\sin \left( \frac{n\pi x}{l}\right) \sin \left( \frac{%
m\pi x}{l}\right) dx &= 
\begin{cases}
0 & m\neq n \\ 
l & m=n%
\end{cases}
\\
\dint\limits_{-l}^{l}\cos \left( \frac{n\pi x}{l}\right) \cos \left( \frac{%
m\pi x}{l}\right) dx &=%
\begin{cases}
0 & m\neq n \\ 
l & m=n\neq 0 \\ 
2l & m=n=0%
\end{cases}
\\
\dint\limits_{-}^{l}\sin \left( \frac{n\pi x}{l}\right) \cos \left( \frac{%
m\pi x}{l}\right) dx &= 0\text{ \ \ \ \ \ \ all m,n}
\end{align*}

\noindent If%
\begin{equation*}
\varphi (x)=\frac{A_{0}}{2}+\dsum\limits_{n=1}^{\infty }A_{n}\cos \left( 
\frac{n\pi x}{l}\right) +B_{n}\sin \left( \frac{n\pi x}{l}\right) \qquad
-l<x<l
\end{equation*}

\noindent then

\begin{align*}
A_{n} &= \frac{1}{l}\dint\limits_{-l}^{l}\varphi (x)\cos \left( \frac{n\pi x%
}{l}\right) dx \\
B_{n} &= \frac{1}{l}\dint\limits_{-l}^{l}\varphi (x)\sin \left( \frac{n\pi x%
}{l}\right) dx
\end{align*}

\bigskip

\noindent Note: sine series corresponds to odd extension i.e. Dirichlet bc

\noindent cosine series corresponds to even extension i.e. Neumann bc

\bigskip

\begin{center}
Robin Condition
\end{center}

\begin{align*}
X^{^{\prime \prime }}+\beta ^{2}X& =0 \\
u_{x}-a_{0}u& =0\qquad x=0 \\
u_{x}+a_{l}u& =0\qquad x=l
\end{align*}

\noindent Assume%
\begin{align*}
X(x) &= C\cos (\beta x)+D\sin (\beta x) \\
X^{^{\prime }}(x) &= \beta \left[ -C\sin (\beta x)+D\cos (\beta x)\right] \\
X^{^{\prime }}(x)+aX &= \left( \beta D+aC\right) \cos (\beta x)+
\left(-\beta C+aD\right) \sin (\beta x)
\end{align*}

\noindent So

\begin{align*}
\beta D+a_{0}C &= 0\qquad \text{at }x=0 \\
\left( \beta D+a_{l}C\right) \cos (\beta l)+\left( -\beta C+a_{l}D\right)
\sin (\beta l) &= 0\qquad \text{at }x=l
\end{align*}

\noindent To have a nontrivial solution the determinant of the system needs
to be nonzero

\begin{equation*}
-a_{0}\left[ \beta \cos (\beta l)+a_{l}\sin (\beta l)\right] -\beta \left[
a_{l}\cos (\beta l)-\beta \sin (\beta l)\right] =0
\end{equation*}

\noindent or

\begin{equation*}
\tan (\beta l)=\frac{\left( a_{0}+a_{l}\right) \beta }{\beta ^{2}-a_{0}a_{l}}
\end{equation*}

\newpage

\begin{center}
\bigskip Example sin(x) expansion
\end{center}

\begin{equation*}
\phi (x)=1\qquad 0<x<l
\end{equation*}

\noindent Then%
\begin{align*}
B_{m}& =\frac{2}{l}\dint\limits_{0}^{l}\sin \left( \frac{m\pi x}{l}\right) dx
\\
& =\left[ -\frac{2}{m\pi }\cos \left( \frac{m\pi x}{l}\right) \right]
_{0}^{l} \\
& =\frac{2}{m\pi }\left[ 1-\cos \left( m\pi \right) \right] =\frac{2}{m\pi }%
\left[ 1-\left( -1\right) ^{m}\right]  \\
& =\frac{4}{\pi }\left[ \sin \left( \frac{\pi x}{l}\right) +\frac{1}{3}\sin
\left( \frac{3\pi x}{l}\right) +\frac{1}{5}\sin \left( \frac{5\pi x}{l}%
\right) +...\right] 
\end{align*}%
$\phi (x)$is discontinuous at x=0

\noindent Hence, we have proven that%
\begin{equation*}
\frac{\pi }{4}=\sin \left( \frac{\pi x}{l}\right) +\frac{1}{3}\sin \left( 
\frac{3\pi x}{l}\right) +\frac{1}{5}\sin \left( \frac{5\pi x}{l}\right) +...
\end{equation*}

\newpage

\begin{center}
Example: sine series
\end{center}
\begin{equation*}
\phi (x)=x\qquad 0<x<l
\end{equation*}

\noindent Then%
\begin{align*}
B_{m}& =\frac{2}{l}\dint\limits_{0}^{l}x\sin \left( \frac{m\pi x}{l}\right)
dx \\
& =\left[ -\frac{2x}{m\pi }\cos \left( \frac{m\pi x}{l}\right) +\frac{2l}{%
m^{2}\pi ^{3}}\sin \left( \frac{m\pi x}{l}\right) \right] _{0}^{l} \\
& =-\frac{2l}{m\pi }\cos \left( m\pi \right) =\left( -1\right) ^{m+1}\frac{2l%
}{m\pi } \\
& =\frac{2l}{\pi }\left[ \sin \left( \frac{\pi x}{l}\right) -\frac{1}{2}\sin
\left( \frac{2\pi x}{l}\right) +\frac{1}{3}\sin \left( \frac{3\pi x}{l}%
\right) -...\right]
\end{align*}

\noindent This is discontinuous at $x=l$

\bigskip

\begin{equation*}
\phi (x)=x\qquad -l<x<l
\end{equation*}

\noindent Then $\phi (x)$ is ann odd function and $A_{n}=0$%
\begin{align*}
B_{m} &= \frac{1}{l}\dint\limits_{-l}^{l}x\sin \left( \frac{m\pi x}{l}%
\right) dx=\frac{2}{l}\dint\limits_{0}^{l}x\sin \left( \frac{m\pi x}{l}%
\right) dx_{0}^{l} \\
&= \left( -1\right) ^{m+1}\frac{2l}{m\pi }
\end{align*}

\newpage

\begin{center}
Example - PDE
\end{center}

\bigskip

\begin{align*}
u_{tt} &= c^{2}u_{xx}\qquad 0<x<l \\
u(x,0) &= x \\
u_{t}(x,0) &= 0 \\
u(0,t) &= u(l,t)=0
\end{align*}

\noindent Then%
\begin{align*}
u(x,t) &= \dsum\limits_{n=1}^{\infty }\left[ A_{n}\cos \left( \frac{n\pi ct}{%
l}\right) +B_{n}\sin \left( \frac{n\pi ct}{l}\right) \right] \sin \left( 
\frac{n\pi x}{l}\right) \qquad \\
u_{t}(x,t) &= \dsum\limits_{n=1}^{\infty }\frac{n\pi c}{l}\left[ -A_{n}\sin
\left( \frac{n\pi ct}{l}\right) +B_{n}\cos \left( \frac{n\pi ct}{l}\right) %
\right] \sin \left( \frac{n\pi x}{l}\right)
\end{align*}

\noindent set $t=0$ . Then%
\begin{align*}
x &= \dsum\limits_{n=1}^{\infty }A_{n}\sin \left( \frac{n\pi x}{l}\right) \\
0 &= \dsum\limits_{n=1}^{\infty }\frac{n\pi c}{l}B_{n}\sin \left( \frac{n\pi
x}{l}\right)
\end{align*}

\noindent So%
\begin{equation*}
u(x,t)=\frac{2l}{\pi }\dsum\limits_{n=1}^{\infty }\frac{(-1)^{n+1}}{n}\cos
\left( \frac{n\pi ct}{l}\right) \sin \left( \frac{n\pi x}{l}\right)
\end{equation*}

\end{document}
