\documentclass[12pt]{article}
\usepackage{amsfonts}


%new commands

% reference for equation labels
\newcommand{\eq}[1]{(\ref{#1})}

% abbreviations for equation environments
\newcommand{\be}{\begin{equation}}
\newcommand{\ee}{\end{equation}}
\newcommand{\bea}{\begin{eqnarray}}
\newcommand{\eea}{\end{eqnarray}}
\newcommand{\beann}{\begin{eqnarray*}}
\newcommand{\eeann}{\end{eqnarray*}}


% abbreviation for reals

\def\Cx{\mathbb{C}}
\def\Nl{\mathbb{N}}
\def\Ra{\mathbb{Q}}
\def\Rl{\mathbb{R}}
\def\Ts{\mathbb{T}}
\def\Ir{\mathbb{Z}}
\def\DD{\mathcal{D}}

% abbreviations for \varepsilon and \varphi
\newcommand{\eps}{\varepsilon}
\newcommand{\vphi}{\varphi}


\pagestyle{empty}

\begin{document}

\centerline{\textbf{Solutions to Sample Midterm 2}}
\centerline{\textbf{Math 121}, \textbf{Fall 2004}}

\bigskip\bigskip
\noindent
\textbf{1.} Use Fourier series to find the solution $u(x,y)$ of the following boundary value problem
for Laplace's equation in the semi-infinite strip $0<x<1$, $y>0$:
\beann
&&\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} = 0,\\
&&u(0,y) = u(1,y) = 0,\\
&&u(x,0) = 1,\\
&&u(x,y) \to 0\quad \mbox{as $y\to\infty$}.
\eeann

\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item The separated solutions of Laplace's equation that satisfy the boundary conditions
at $x=0,1$ and as $y\to\infty$ are $\sin (n\pi x) e^{-n\pi y}$, where $n$ is a positive
integer. We therefore look for a solution of the form
\[
u(x,y) = \sum_{n=1}^\infty  b_n\sin (n\pi x) e^{-n\pi y}.
\]
Imposing the boundary condition at $y=0$, we obtain
\[
\sum_{n=1}^\infty  b_n\sin (n\pi x)  = 1,
\]
so
\beann
b_n &=& 2\int_0^1 \sin (n\pi x)\, dx\\
&=& 2\left[\frac{-\cos (n\pi x)}{n\pi}\right]_0^1\\
&=& 2\left[\frac{(-1)^{n+1}}{n\pi} + \frac{1}{n\pi} \right]_0^1\\
&=& \cases{4/(n\pi) & for $n$ odd,\cr
0 & for $n$ even.}
\eeann
The solution is therefore
\[
u(x,y) = \frac{4}{\pi}\left\{\sin (\pi x) e^{-\pi y} + \frac{1}{3}\sin (3\pi x) e^{-3\pi y}
+ \frac{1}{5}\sin (5\pi x) e^{-5\pi y} + \dots\right\}.
\]
\end{itemize}



\newpage
\noindent
\textbf{2.} Use Fourier series to find the solution $u(x,t)$ of the following initial-boundary value problem
for the wave equation in $0<x<1$ and $t >0$:
\beann
&&\frac{\partial^2 u}{\partial t^2} - \frac{\partial^2 u}{\partial x^2} = 0,\\
&&\frac{\partial u}{\partial x}(0,t) = \frac{\partial u}{\partial x}(1,t) = 0,\\
&&u(x,0) = 0,\\
&&\frac{\partial u}{\partial t}(x,0) = x.
\eeann

\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item The separated solutions of the wave equation that are zero at $t=0$ and
satisfy the boundary conditions at $x=0,1$ 
are $t$ and $\cos (n\pi x) \sin (n\pi t)$, where $n= 1,2,\dots$.
We therefore look for a solution of the form
\[
u(x,t) = \frac{1}{2} a_0 t + \sum_{n=1}^\infty a_n \cos (n\pi x) \sin (n\pi t).
\]
Differentiating this series with respect to $t$, we find that
\[
\frac{\partial u}{\partial t}(x,t) = \frac{1}{2}a_0 + \sum_{n=1}^\infty n\pi a_n \cos (n\pi x) \cos (n\pi t).
\]
Imposing the initial condition for $\partial u/\partial t$ at $t=0$, we get the
Fourier cosine expansion:
\[
\frac{1}{2} a_0 + \sum_{n=1}^\infty n\pi a_n \cos (n\pi x) = x.
\]
Hence, for $n\ge 1$ we have
\beann
n \pi a_n &=& 2\int_0^1 x\cos (n\pi x)\, dx\\
&=& 2\left[\frac{x\sin (n\pi x)}{n\pi} + \frac{\cos (n\pi x)}{(n\pi)^2}\right]_0^1\\
&=& 2\left[\frac{(-1)^{n}}{(n\pi)^2} - \frac{1}{(n\pi)^2} \right]_0^1\\
&=& \cases{-4/(n\pi)^2 & for $n$ odd,\cr
0 & for $n$ even,}
\eeann
and
\[
a_n = \cases{-4/(n\pi)^3 & for $n$ odd,\cr
0 & for $n$ even.}
\]
For $n=0$, we get
\beann
a_0 &=& 2\int_0^1 x\, dx\\
&=& 2\left[\frac{1}{2} x^2\right]_0^1\\
&=& 1.
\eeann
Hence, the solution is
\[
u(x,t) = \frac{1}{2} t -\frac{4}{\pi^3}\left\{ \cos (\pi x) + \frac{1}{3^3} \cos (3\pi x) +  \frac{1}{5^3} \cos (5\pi x)
+ \dots\right\}.
\]
\end{itemize}



\newpage
\noindent
\textbf{3.} Use Fourier transforms to solve the following initial value problem
for $u(x,t)$ in $-\infty < x < \infty$, $t >0$:
\beann
&&\frac{\partial u}{\partial t} = -\frac{\partial^4 u}{\partial x^4},\\
&&u(x,0) = f(x).
\eeann
Write the solution for $u(x,t)$ as a convolution, but do not compute any inverse transforms explicitly.
How smooth is the solution for $t>0$?

\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item Let
\[
\widehat{u} (k,t) = \frac{1}{2\pi} \int_{-\infty}^{\infty} u(x,t) e^{-ikx}\, dx
\]
be the Fourier transform of $u$ with respect to $x$. Then, taking the Fourier transform of the initial
value problem, we get
\beann
&&\frac{\partial \widehat{u}}{\partial t} = -(-ik)^4\widehat{u},\\
&&\widehat{u} (k,0) = \widehat{f} (k),
\eeann
where $\widehat{f}$ is the Fourier transform of $f$. It follows that
\beann
&&\frac{\partial \widehat{u}}{\partial t} = -k^4\widehat{u},\\
&&\widehat{u} (k,0) = \widehat{f} (k),
\eeann
which has the solution
\[
\widehat{u} (k,t) = \widehat{f} (k) e^{-k^4 t}.
\]
According to the convolution theorem, if $f$, $g$ have Fourier transforms $\widehat{f}$, $\widehat{g}$ respectively
then $\widehat{f}\cdot\widehat{g}$ is the Fourier transform of $\frac{1}{2\pi} f\ast g$. It follows that
\[
u(x,t) = \int_{-\infty}^\infty G(x-y,t) f(y)\, dy
\]
where
\[
\widehat{G}(k,t) = \frac{1}{2\pi} e^{-k^4 t}.
\]
The solution is smooth (infinitely differentiable with respect to $x$) for $t >0$ since its Fourier transform decays exponentially
quickly as $k\to \infty$ (assuming, for example, that $\widehat{f} (k)$ is a bounded function of $k$).
\end{itemize}



\newpage
\noindent
\textbf{4.} (a) Give the formulas for the Fourier transform $\widehat{f}(k)$ of a function $f(x)$ and the
inverse Fourier transform.

\smallskip\noindent
(b) Compute the Fourier transform of $e^{-|x|}$.


\smallskip\noindent
(c) State Parseval's theorem, and use it to evaluate
\[
\int_0^\infty\frac{1}{(1+k^2)^2}\, dk.
\]


\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item
(a) A function $f(x)$ and its Fourier transform $\widehat{f}(k)$ are related by
\beann
\widehat{f} (k) &=& \frac{1}{2\pi} \int_{-\infty}^{\infty} f(x) e^{-ikx}\, dx,\\
{f} (x) &=& \int_{-\infty}^{\infty} \widehat{f}(k) e^{ikx}\, dk,
\eeann

\item (b) If $f(x) = e^{-|x|}$, then using
\[
|x| = \cases{x & for $x\ge 0$,\cr
-x & for $x\le 0$,}
\]
and changing $x\to -x$ in the integral for $-\infty < x < 0$, we find that
\beann
\widehat{f} (k) &=& \frac{1}{2\pi} \int_{-\infty}^{\infty} e^{-|x|} e^{-ikx}\, dx,\\
&=& \frac{1}{2\pi}\left\{ \int_{-\infty}^{0} e^{(1-ik)x}\, dx
+ \int_0^{\infty} e^{-(1+ik)x}\, dx\right\}\\
&=&  \frac{1}{2\pi} \int_0^{\infty} \left\{ e^{-(1-ik)x}
+ e^{-(1+ik)x}\right\}\, dx\\
&=& - \frac{1}{2\pi} \left[\frac{e^{-(1-ik)x}}{1-ik} + \frac{e^{-(1+ik)x}}{1+ik}\right]_0^{\infty}\\
&=&  \frac{1}{2\pi} \left[\frac{1}{1-ik} + \frac{1}{1+ik}\right]_0^{\infty}\\
&=&  \frac{1}{\pi} \frac{1}{1+k^2}.
\eeann


\item
(c) Parseval's theorem states that 
\[
\int_{-\infty}^{\infty} \left|\widehat{f}(k)\right|^2\,dk
=
\frac{1}{2\pi} \int_{-\infty}^{\infty} \left|f(x)\right|^2\,dx.
\]
For $f(x) = e^{-|x|}$, we compute that
\beann
\int_{-\infty}^{\infty} \left|f(x)\right|^2\,dx &=& 2 \int_{0}^{\infty} e^{-2x}\,dx \\
 &=&   -\left[e^{-2x}\right]_0^{\infty}\\
 &=& 1.
 \eeann
 It follows from Parsevals theorem and (b) that
 \[
 \frac{2}{\pi^2} \int_0^\infty \frac{1}{(1+k^2)^2}\, dk = \frac{1}{2\pi}\cdot 1,
 \]
 so
  \[
 \int_0^\infty \frac{1}{(1+k^2)^2}\, dk = \frac{\pi}{4}.
 \]
 
\item \textbf{Remark.} The integral in (c) can also be evaluated directly by use of the
substitution $k = \tan \theta$, which gives
\beann
 \int_0^\infty \frac{1}{(1+k^2)^2}\, dk &=& \int_0^{\pi/2} \frac{1}{(1+ \tan^2\theta)^2} \sec^2\theta\,d\theta\\
 &=& \int_0^{\pi/2} \frac{1}{\sec^4\theta} \sec^2\theta\,d\theta\\
 &=& \int_0^{\pi/2} \frac{1}{\sec^2\theta}\,d\theta\\
 &=& \int_0^{\pi/2} {\cos^2\theta}\,d\theta\\
    &=&  \frac{\pi}{2} \cdot \frac{1}{2}\\
    &=& \frac{\pi}{4},
 \eeann
which verifies Parseval's theorem explicitly in this case.
\end{itemize}



\newpage
\noindent
\textbf{5.} Use Laplace transforms to solve the following initial value problem:
\beann
&&y^{\prime\prime} +2 y^\prime + 2 y = 1,\\
&&y(t) = 0,\quad y^\prime(0) = 1.
\eeann

\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item Let $Y(p)$ be the Laplace transform of $y(t)$. Then, taking the Laplace transform of the ODE
and using the initial conditions, we get that
\[
p^2 Y - 1 + 2p Y +2Y = \frac{1}{p}.
\]
Solving for $Y$, we get
\[
Y(p) = \frac{1}{p^2 + 2p + 2} + \frac{1}{p(p^2 + 2p + 2)}.
\]
We have $p^2 + 2p + 2 = (p+1)^2 +1$, so (from L13 of the table)
\[
L^{-1}\left[\frac{1}{p^2 + 2p + 2}\right] = e^{-t}\sin t.
\]
Also
\beann
\frac{1}{p(p^2 + 2p + 2)} &=& \frac{1}{2}\left[\frac{1}{p} -  \frac{p+2}{p^2 + 2p + 2} \right]\\
&=& \frac{1}{2}\left[\frac{1}{p} - \frac{p+1}{(p+1)^2 +1} - \frac{1}{(p+1)^2 +1}\right].
\eeann
So (from L1, L13, L14) we have
\[
L^{-1}\left[\frac{1}{p(p^2 + 2p + 2)}\right] = \frac{1}{2}\left[1 - e^{-t}\cos t - e^{-t}\sin t\right]
\]
Hence, combining these inverse transforms, we get
\[
y(t) =  \frac{1}{2}\left[1 - e^{-t}\cos t + e^{-t}\sin t\right].
\]


\end{itemize}

\bigskip
\noindent
\textbf{6.}
(a) Say what jump conditions the solution of
$y(t)$ of the following initial value problem satisfies
at $t=0$, and find the solution directly (do not use Laplace transforms):
\beann
&&y^{\prime\prime} - 4 y = \delta(t),\\
&&y(t) = 0\quad\mbox{for $t<0$}.
\eeann

\smallskip\noindent
(b) Write the solution of the following initial value problem, where $f(t)$ is an arbitrary function,
as a convolution (you don't need to derive your answer):
\beann
&&y^{\prime\prime} - 4 y = f(t),\\
&&y(0) = y^\prime(0) = 0.
\eeann

\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item  (a) The derivative of $y$ has a jump discontinuity of size one at $t=0$.
The solution is therefore
\[
y(t) = \cases{y_+(t) & for $t\ge 0$,\cr
0 & for $t < 0$,}
\]
where
\beann
&&y_+^{\prime\prime} - 4 y_+ = 0\qquad\mbox{for $t>0$},\\
&&y_+(0) = 0,\qquad  y_+^\prime(0) = 1.
\eeann
The general solution of the ODE is $y_+(t) = a\cosh 2t + b\sinh 2t$, and the initial conditions
imply that $a=0$ and $b=1/2$. Hence,
\[
y(t) = \frac{1}{2} \sinh 2t\qquad \mbox{for $t\ge 0$}.
\]

\item  (b) The solution is
\[
y(t) = \frac{1}{2}\int_0^t \sinh 2(t-s) f(s)\, ds.
\]

\end{itemize}


\end{document}
