\documentclass{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{amssymb}
\usepackage{amsmath}
\setcounter{MaxMatrixCols}{10}
%TCIDATA{OutputFilter=LATEX.DLL}
%TCIDATA{Version=5.00.0.2606}
%TCIDATA{}
%TCIDATA{BibliographyScheme=Manual}
%TCIDATA{LastRevised=Tuesday, December 13, 2005 12:56:38}
%TCIDATA{}
\input{tcilatex}
\begin{document}
\begin{center}
\bigskip Diffusion - half line
\end{center}
\begin{align*}
\frac{\partial u}{\partial t}& =k\frac{\partial ^{2}u}{\partial x^{2}}\qquad
\text{k constant \ \ \ \ \ }x>0 \\
u(x,0)& =\varphi (x)\text{ \ \ \ initial condition} \\
\text{Dirichlet}& \text{: }u(0,t)=0\text{ \ \ \ \ boundary conditions} \\
\text{Neumann}& \text{: }\frac{\partial u}{\partial x}(0,t)=0
\end{align*}
\bigskip
Def: \ \ \ odd function \ \ \ \ \ \ $\varphi (-x)=-\varphi (x)$
\ \ \ \ \ \ \ \ \ even function \ \ \ \ \ \ $\varphi (-x)=+\varphi (x)$
\begin{equation*}
\varphi _{\text{odd}}(x)=%
\begin{cases}
\varphi (x) & x>0 \\
-\varphi (-x) & x<0 \\
0 & x=0%
\end{cases}%
\end{equation*}
\textbf{Important: }$\varphi _{\text{odd}}(0)=0$
\begin{equation*}
\varphi _{\text{even}}(x)=%
\begin{cases}
\varphi (x) & x>0 \\
\varphi (-x) & x<0%
\end{cases}%
\end{equation*}
\bigskip
CASE I: Dirichlet \ \ \ $u(0,t)=0$
Solve%
\begin{align*}
\frac{\partial u_{\text{odd}}}{\partial t} &= k\frac{\partial ^{2}u_{\text{%
odd}}}{\partial x^2} \qquad -\infty 0 \\
u(x,0)& =\varphi (x)\text{ \ \ \ } \\
u_{t}(x,0)& =\psi (x)\text{ \ \ \ \ \ \ \ \ \ \ initial condition} \\
\text{Dirichlet}& \text{: }u(0,t)=0\text{ \ \ \ \ boundary conditions} \\
\text{Neumann}& \text{: }\frac{\partial u}{\partial x}(0,t)=0
\end{align*}
\bigskip
\noindent Consider the Dirichlet problem: As before we wish $u(x,t)$ to be
an odd function%
\begin{equation*}
u(x,t)=\frac{\varphi _{\text{odd}}(x+ct)+\varphi _{\text{odd}}(x-ct)}{2}+%
\frac{1}{2c}\int_{x-ct}^{x+ct}\psi _{\text{odd}}(z)dz
\end{equation*}
\bigskip
\noindent Note: \ \ for $x>c|t|$ \ \ \ \ \ \ \ $\varphi _{\text{odd}%
}=\varphi $
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $0c \vert t \vert \\
\frac{\varphi (ct+x)-\varphi (ct-x)}{2}+\frac{1}{2c}\int_{ct-x}^{ct+x}\psi
(z)dz & x\,0 \\
u(x,0) &= \varphi (x)
\end{align*}
\bigskip
\noindent Split $u$ into two parts. One satisfies the inhomogenous RHS and
the other the inhomeogenous initial conditions, Hence,
$u=v+w$ \qquad with
\begin{align*}
v_{t} &= k v_{xx}+q(x,t) \\
v(x,0) &= 0 \\
w_{t} &= k w_{xx} \\
u(x,0) &= \varphi (x)
\end{align*}
So%
\begin{equation*}
w(x,t)=\dint\limits_{-\infty }^{\infty }S(x-y,t)\varphi (y)dy=\frac{1}{\sqrt{%
4k\pi t}}\dint\limits_{-\infty }^{\infty }e^{-\frac{\left( x-y\right) ^{2}}{%
4kt}}\varphi (y)dy
\end{equation*}
\bigskip
For $v$ we first consider the ODE case
\bigskip
\begin{align*}
(\ast )\qquad \frac{du}{dt}+Au& =q \\
u(0)& =\varphi
\end{align*}
\noindent Define $S(t)=e^{-At}$. Then use the integrating factor $e^{At}$
\quad i.e.
\begin{align*}
e^{At}\frac{du}{dt}+e^{At}Au& =e^{At}q \\
\frac{d}{dt}\left( e^{At}u\right) & =e^{At}q \\
e^{At}u& =\dint\limits_{0}^{t}e^{As}q(s)ds+\varphi \\
u(t)& =e^{-At}\varphi +\dint\limits_{0}^{t}e^{-A(t-s)}q(s)ds \\
u(t)& =S(t)\varphi +\dint\limits_{0}^{t}S(t-s)q(s)ds
\end{align*}
\bigskip
\noindent Returning to the diffusion, the solution to the homogenous problem
(w) is given by%
\begin{equation*}
\left( \mathcal{S}(t)\varphi \right) (x)=
\dint\limits_{-\infty}^{\infty}S(x-y,t)\varphi (y)dy
\end{equation*}
\noindent i.e. $\mathcal{S}$ denotes an operator that turns the function
$\varphi $ into the above integral.
\noindent Hence, we guess that the solution to (*) is given by%
\begin{align*}
u(x,t)& =\mathcal{S}(t)\varphi +\dint\limits_{0}^{t}\mathcal{S}(t-s)q(s)ds \\
& =\dint\limits_{-\infty }^{\infty }S(x-y,t)\varphi
(y)dy+\dint\limits_{0}^{t}\dint\limits_{-\infty }^{\infty
}S(x-y,t-s)q(y,s)dyds \\
& =\frac{1}{\sqrt{4k\pi t}}\dint\limits_{-\infty }^{\infty }e^{-\frac{\left(
x-y\right) ^{2}}{4kt}}\varphi
(y)dy+\dint\limits_{0}^{t}\dint\limits_{-\infty }^{\infty }\frac{1}{\sqrt{%
4k\pi \left( t-s\right) }}e^{-\frac{\left( x-y\right) ^{2}}{4k\left(
t-s\right) }}q(y,s)dyds
\end{align*}
\noindent We are only going to verify that this is indeed the solution.
By linearity we need only consider the case with zero initial conditions. Then%
\begin{equation*}
u(x,t)=\dint\limits_{0}^{t}\dint\limits_{-\infty }^{\infty
}S(x-y,t-s)q(y,s)dyds
\end{equation*}
Therefore%
\begin{equation*}
\frac{\partial u}{\partial t}=\dint\limits_{0}^{t}\dint\limits_{-\infty
}^{\infty }\frac{\partial S}{\partial t}(x-y,t-s)q(y,s)dyds+\lim_{s%
\rightarrow t}\dint\limits_{-\infty }^{\infty }S(x-y,t-s)q(y,s)dy
\end{equation*}
\noindent However, \quad $S_{t}=kS_{xx}$. \quad Therefore,
\begin{align*}
\frac{\partial u}{\partial t}& =\dint\limits_{0}^{t}\dint\limits_{-\infty
}^{\infty }k\frac{\partial ^{2}S}{\partial x^{2}}(x-y,t-s)q(y,s)dyds+\lim_{%
\varepsilon \rightarrow 0}\dint\limits_{-\infty }^{\infty }S(x-y,\varepsilon
)q(y,t)dy \\
& =k\frac{\partial ^{2}}{\partial x^{2}}\dint\limits_{0}^{t}\dint\limits_{-%
\infty }^{\infty }S(x-y,t-s)q(y,s)dyds+q(x,t) \\
& =k\frac{\partial ^{2}u}{\partial x^{2}}+q(x,t)
\end{align*}
\newpage
\begin{center}
Nonhomogenous boundary condition:
\end{center}
\begin{align*}
\frac{\partial u}{\partial t}& =k\frac{\partial ^{2}u}{\partial x^{2}}%
+q(x,t)\qquad \text{k constant \ \ \ \ \ }x>0\quad t>0 \\
u(x,0)& =\varphi (x) \\
u(0,t)& =h(t)\qquad \text{boundary condition}
\end{align*}
Define $V(x,t)=u(x,t)-h(t)$ , \ \ $u(x,t)=V(x,t)+h(t)$. \ Then%
\begin{equation*}
\frac{\partial V}{\partial t}+h^{^{\prime }}(t)=k\frac{\partial ^{2}V}{%
\partial x^{2}}+q(x,t)
\end{equation*}
\noindent or we have the following set
\begin{align*}
\frac{\partial V}{\partial t} &= k\frac{\partial ^{2}V}{\partial x^{2}}%
+q(x,t)-h^{^{\prime }}(t) \\
V(x,0) &= \varphi (x)-h(0) \\
V(0,t) &= 0
\end{align*}
\noindent As before we now introduce $\varphi _{odd}(x)$ and $q_{\text{odd}%
}(x,t)$.
\bigskip
\noindent Note: If $\varphi (0)\neq h(0)$ we have a discontinuity at the
corner $x=0,t=0$ which disappears immediately, i.e. the solution is analytic
in the interior.
\noindent Example: consider sticking hot iron bar into a cold bath
\newpage
\begin{center}
Waves with a Source
\end{center}
\bigskip
\begin{align*}
\frac{\partial ^{2}u}{\partial t^{2}}& =c^{2}\frac{\partial ^{2}u}{\partial
x^{2}}+q(x,t)\text{\ \ \ \ \ }-\infty