%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% MATH 54, Lenstra, Spring 96
%% Solutions to Problem set 13
%% by William Stein
\documentclass{article}
\usepackage{amsmath}
\textwidth=1.4\textwidth
\textheight=1.3\textheight
\hoffset=-1.2 in
\voffset=-1.28in
\author{William Stein}
\title{Solutions to Problem Set 13}
\newcommand{\problem}[1]{\vspace{.3in}\par\noindent{\Large \bfseries #1. }}
\newcommand{\soln}{\par {\em Solution.} }
\newcommand{\dx}{\hspace{.5em}dx}
\begin{document}
\maketitle
This document contains the solutions to the 13th homework set
along with a list of theoretically inclined problems that
resemble what could be on the final. The final examination
is on Friday, May 17, 5--8 p.m. (room to be announced).
The final examination covers differential equations.
\section{Theoretically Inclined Problems}
The TAs received the following letter from Prof. Lenstra.
\begin{quote}
Dear TAs,
As Diane suggested, I drew up a list of problems from
Boyce and DiPrima that students who wish to prepare themselves
for questions with a theoretical flavor may try their hands at.
I am not saying that a problem of exactly one of these types
will appear on the final; only that the theoretical thinking
required for the problems below will be good preparation.
Best, Hendrik
\end{quote}
All problems are from Boyce-DiPrima and harder problems are starred.
\begin{center}
\begin{tabular}{|l|l|}\hline
3.1&15,16,33--38\\\hline
3.3&9,10,11,19,22*\\\hline
3.4&23,26\\\hline
3.5&16*, 33*\\\hline
4.1&7--12, 13--19\\\hline
4.2&1--10, 27\\\hline
7.1&1--4,15\\\hline
7.4&3*\\\hline
7.7&13*\\\hline
10.1&3,14,16*\\\hline
10.2&11,12,29\\\hline
\end{tabular}
\end{center}
\section{Homework Solutions. Chapter 10; 1 -- 4,5; 2 -- 1,10,21,22;
3 -- 3,7; 4 -- 17,29}
\problem{10.1.4}
{\em Find the solution to the heat conduction problem
$$100u_{xx}=u_t, \quad 00$$
$$u(0,t)=0, \quad u(1,t)=0, \quad t>0$$
$$u(x,0)=\sin 2\pi x - 2 \sin 5\pi x, \quad 0\leq x\leq 1.$$ }
\soln From the equation $100u_{xx}=u_t$ we see that $\alpha^2=100$.
From the fact that $u(x,t)$ is defined for $00$$
$$u(0,t)=0, \quad u(2,t)=0, \quad t>0$$
$$u(x,0)=2\sin(\pi x/2)-\sin(\pi x)+4\sin(2\pi x), \quad 0\leq x\leq 2.$$}
\soln Everything proceeds in the same general way as above. This time
$\alpha^2=4$, $\ell=2$, $c_1=2$, $c_2=-1$, $c_4=4$, and all other $c_n=0$.
Thus the solution is
$$u(x,t)=2 e^{-\pi^2 t}\sin (\pi x/2) - e^{-4\pi^2 t}\sin(\pi x)
+ 4 e^{-16\pi^2 t}\sin(2\pi x).$$
\problem{10.1.7}
{\em In each of the following problems determine whether the
method of separation
of variables can be used to replace the given partial differential equation
by a pair of ordinary differential equations. If so, find the equations.}
7. $xu_{xx}+u_t=0$
\soln
Let $u=X(x)T(t)$. Then the differential equation becomes
$$xX''T+XT'=0.$$
A little algebra transforms this into
$$\frac{xX''}{X}=-\frac{T'}{T}.$$
Since the left side does not depend on $t$ and the right
side does not depend on $x$ it follows that both sides
most equal some constant, call it $a$. Multiplying through we
obtain the pair of ordinary differential equations
$$xX''-aX=0, \quad T'+aT=0.$$
11. $u_{xx}+(x+y)u_{yy}=0$
\soln Let $u=X(x)Y(y)$. Then the differential equation becomes
$$X''Y+(x+y)XY''=0.$$
It is impossible to apply separation of variables to the equation.
\problem{10.2.1}
{\em Determine whether the function $\sin \pi x/\ell$ is periodic.
If so, find its fundamental period.}
\soln The function is periodic with period $2\ell$ since
$\sin \pi x$ is periodic with period $2$. The factor of $1/\ell$ rescales
the graph of $\sin\pi x$ horizontally by a factor of $\ell$. Thus the
period increases by a factor of $\ell$.
\problem{10.2.10}
{\em Determine whether the function
$$f(x)=\begin{cases}(-1)^n,&2n-1\leq x<2n,\\
1,&2n\leq x<2n+1;\end{cases}$$
is periodic. If so, find its fundamental period. }
\soln
Sketching the graph of $f(x)$ we see that $f$ is periodic
with fundamental period $4$.
\problem{10.2.21}
{\em Find the Fourier series corresponding to the function
$$f(x)=\begin{cases}x+1&-1\leq x<0,\\ 1-x&0\leq x<1;\end{cases}
\quad f(x+2)=f(x).$$}
\soln
This is just a translation of example 1 on page 524 so we
can easily derive the fourier series of $f(x)$ from that. We present
the full derivation instead.
The Fourier series of $f$ is the projection of $f$ onto the
subspace spanned by the functions
$1$, $\sin(n\pi x/2)$, and $\cos(n\pi x/2)$, $n=1,2,\ldots$.
Note that these functions are not orthonormal although they are orthogonal
(see page 522). Recall the projection formula
$$\text{Proj} v=\sum_{n=1}^{\infty} \frac{\langle v,u_n\rangle}
{\langle u_n,u_n\rangle} u_n$$
of $v$ onto the subspace spanned by an orthogonal basis $u_n$.
Since the inner product in our situation
is $$\langle g,h\rangle =\int_{-1}^{1}g(x)h(x)\dx$$ we see that
the Fourier series of $f$ is
$$\frac{a_0}{2}+\sum_{n=1}^{\infty} a_n\cos(n\pi x)
+\sum_{n=1}^{\infty} b_n\sin(n\pi x).$$
Here the coefficients $a_n$ and $b_n$ for $n\geq 1$ are as follows.
$$a_n=\frac{\langle f,\cos(n\pi x)\rangle}
{\langle \cos(n\pi x), \cos(n\pi x)\rangle}
= \int_{-1}^{1}f(x)\cos(n\pi x) \dx$$
and
$$b_n=\frac{\langle f,\sin(n\pi x)\rangle}
{\langle \sin(n\pi x), \sin(n\pi x)\rangle}
=\int_{-1}^{1}f(x)\sin(n\pi x) \dx.$$
(Note that the factor of $1/\ell$ which one would find in the book
is simply one in our situation.)
Here we have used the computation
$$\langle \cos(n\pi x), \cos(n\pi x)\rangle = 1$$
which can be found on page 522.
The case $n=0$ is treated separately. We have
$$\frac{a_0}{2} = \frac{\langle f, 1\rangle}
{\langle 1, 1\rangle}
=\frac{1}{2} \langle f, 1\rangle
=\frac{1}{2} \int_{-1}^{1} f(x)\dx$$
so $$a_0=\int_{-1}^{1}f(x)\dx.$$
Now that we have the formulas and a firm grasp of what is going
on we need to compute the coefficients $a_n$ and $b_n$.
We compute
\begin{eqnarray*}
a_0&=&\int_{-1}^1 f(x)\dx \\
&=&\int_{-1}^0 x+1 \dx + \int_0^1 1-x \dx\\
&=&\Bigl[\frac{1}{2}x^2+x\Bigr]^0_{-1} + \Bigl[x-\frac{1}{2}x^2\Bigr]^1_0\\
&=& -\Bigl(\frac{1}{2}-1\Bigr)+\frac{1}{2}=1.\end{eqnarray*}
Next computing $a_n$ we have
\begin{eqnarray*}
a_n&=&\int_{-1}^{1}f(x)\cos(n\pi x)\dx\\
&=&\int_{-1}^{0}(x+1)\cos(n\pi x)\dx + \int_{0}^{1}(1-x)\cos(n\pi x)\dx\\
&=&\int_{-1}^{0}x\cos(n\pi x)\dx + \int_{-1}^{0}\cos(n\pi x)\dx +
\int_{0}^{1}\cos(n\pi x)\dx - \int_{0}^{1}x\cos(n\pi x) \dx\\
&=&\int_{-1}^{0}x\cos(n\pi x)\dx - \int_{0}^{1}x\cos(n\pi x) \dx.
\end{eqnarray*}
To compute this we apply integration by parts yielding
\begin{eqnarray*}
\int_{-1}^{0}x\cos(n\pi x)\dx
&=& \Bigl[ \frac{x}{n\pi}\sin(n\pi x)\Bigr]^0_{-1}
- \frac{1}{n\pi}\int_{-1}^{0}\sin(n\pi x)\dx\\
&=& 0 - \frac{1}{n\pi}\Bigl[\frac{-1}{n\pi}\cos(n\pi x)\Bigr]^0_{-1}\\
&=& \frac{1}{n^2\pi^2}-\frac{1}{n^2\pi^2}\cos(-n\pi)
= \begin{cases} 0 & \text{if $n$ is even}\\
\frac{2}{n^2\pi^2}&\text{if $n$ is odd}
\end{cases}
\end{eqnarray*}
Similiarly,
\begin{eqnarray*}
\int_{0}^{1}x\cos(n\pi x)\dx
&=& \Bigl[ \frac{x}{n\pi}\sin(n\pi x)\Bigr]^1_{0}
- \frac{1}{n\pi}\int_{0}^{1}\sin(n\pi x)\dx\\
&=& 0 - \frac{1}{n\pi}\Bigl[\frac{-1}{n\pi}\cos(n\pi x)\Bigr]^0_{1}\\
&=& \frac{1}{n^2\pi^2}\cos(n\pi)-\frac{1}{n^2\pi^2}
= \begin{cases} 0 & \text{if $n$ is even}\\
-\frac{2}{n^2\pi^2}&\text{if $n$ is odd}
\end{cases}
\end{eqnarray*}
It follows that
$$a_n=\begin{cases} 0&\text{if $n$ is even}\\
\frac{4}{n^2\pi^2}&\text{if $n$ is odd}
\end{cases}$$
One checks that $f(x)$ is an even function
so $f(x)\sin(n\pi x)$ is an odd function and hence
$$b_n=\int_{-1}^{1}f(x)\sin(n\pi x)\dx=0.$$
Putting this all together we conclude that the Fourier expansion of $f$ is
$$f(x)=\frac{1}{2}+\frac{4}{\pi^2}\sum_{n=1}^{\infty}
\frac{\cos(2n-1)\pi x}{(2n-1)^2}.$$
\problem{10.2.22}
{\em Find the Fourier series corresponding to the function
$$f(x)=\begin{cases}x+\ell,&-\ell\leq x\leq 0,\\
\ell,&00),$$
with boundary conditions
$$u(0,t)=u(\pi,t)=0\quad (t>0)$$
and initial conditions
$$u(x,0)=\sin(3x), \quad u_t(x,0)=0\quad (0