Sharedwww / 54soln4.texOpen in CoCalc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% MATH 54, Lenstra, Spring 96
%% Solutions to Problem set 14
%% by William Stein

\documentclass[12pt]{article}
\usepackage{amsmath}
%\textwidth=1.4\textwidth
\textwidth=1.2\textwidth
\textheight=1.3\textheight
%\hoffset=-1.2 in
\hoffset=-.7 in
\voffset=-1.28in

\author{For Lenstra's Math 54\\by William Stein}
\title{Solutions to Problem Set 14 and Practice Final}
\newcommand{\problem}[1]{\vspace{.3in}\par\noindent{\Large \bfseries #1. }}
\newcommand{\soln}{\par {\em Solution.} }
\newcommand{\dx}{\hspace{.5em}dx}
\newcommand{\vx}{\mathbf{x}}
\DeclareMathOperator{\cm}{cm}
\DeclareMathOperator{\C}{C}

\begin{document}
\maketitle
This document contains the solutions to the 14th homework set.
It also contains solutions to the practice final exam.
The final examination is on Friday, May 17, 5--8 p.m. (room to
be announced). The final examination covers differential
equations.

\section{Homework Solutions to 10.5.1, 10.5.7, 10.6.4}

\problem{10.5.1} {\em Consider the conduction of
heat in a copper rod $100\cm$ in length whose
ends are maintained at $0^{\circ}\C$ for all $t>0$. Find an expression for
the temperature $u(x,t)$ if the initial temperature distribution in the
rod is given by
\begin{itemize}
\item[(a)] $u(x,0) = 50, \quad 0\leq x \leq 100$
\item[(b)] $u(x,0) = \begin{cases} x, & 0\leq x < 50\\ 100 - x, & 50 \leq x \leq 100\end{cases}$
\item[(c)] $u(x,0) = \begin{cases} 0, & 0\leq x < 25 \\ 50, & 25\leq x \leq 75 \\ 0, & 75 < x \leq 100\end{cases}$
\end{itemize}
}
\soln
{\em Summary.} (See page 543.) First find the
sine series for $f(x)=u(x,0)$. Then the
solution is $$u(x,t)=\sum_{n=1}^{\infty}b_ne^{-(n\pi\alpha/\ell)^2 t} \sin\frac{n\pi x}{\ell},$$
where the coefficients $b_n$ are the same as in the series
$$f(x)=\sum_{n=1}^{\infty} b_n \sin\frac{n\pi x}{\ell}.$$
The $b_n$ are given by
$$b_n=\frac{2}{\ell}\int_{0}^{\ell}f(x)\sin\frac{n\pi x}{\ell}\dx.$$

(a) We compute the Fourier coefficients $b_n$.
\begin{eqnarray*}
b_n &=& \frac{2}{100}\int_{0}^{100} u(x,0)\sin\frac{n\pi x}{100}\dx\\
&=& \frac{1}{50}\int_{0}^{100} 50 \sin\frac{n\pi x}{100}\dx\\
&=& \Bigl[-\frac{100}{n\pi}\cos\frac{n\pi x}{100}\Bigr]_0^{100}
= \begin{cases}\frac{200}{n\pi}&\text{$n$ odd}\\
0&\text{$n$ even}\end{cases}
\end{eqnarray*}
Thus the solution is
$$u(x,t) = \sum_{\text{n odd}} \frac{200}{n\pi}e^{-(.0107n\pi)^2 t} \sin\frac{n\pi x}{100}.$$
Here we have used the value $\alpha^2=1.14$ from page 513 to find
$$\frac{\alpha}{\ell}=\frac{\sqrt{1.14}}{100}\approx .0107.$$

(b) We compute
\begin{eqnarray*}
b_n &=& \frac{2}{100}\int_{0}^{100}u(x,0)\sin\frac{n\pi x}{100}\dx\\
&=& \frac{1}{50}\int_{0}^{50}x\sin\frac{n\pi x}{100}\dx
+\frac{1}{50}\int_{50}^{100}100\sin\frac{n\pi x}{100}\dx
-\frac{1}{50}\int_{50}^{100}x\sin\frac{n\pi x}{100}\dx\\
&=& \frac{1}{50}\Bigl\{ \Bigl[-\frac{100}{n\pi}x\cos\frac{n\pi x}{100}
\Bigr]_0^{50}
+\frac{100}{n\pi}\int_{0}^{50}\cos\frac{n\pi x}{100}\dx\Bigr\}
+ 2\Bigl[-\frac{100}{n\pi}\cos\frac{n\pi x}{100}\Bigr]_{50}^{100} \\
&& -\frac{1}{50}\Bigl\{\Bigl[-\frac{100}{n\pi}x\cos\frac{n\pi x}{100}
\Bigr]_{50}^{100}
+\frac{100}{n\pi}\int_{50}^{100}\cos\frac{n\pi x}{100}\dx\Bigr\}\\
&=&-\frac{2}{n\pi}\Bigl(50\cos\frac{n\pi}{2}\Bigr)+\frac{2}{n\pi}
\Bigl[\frac{100}{n\pi}\sin\frac{n\pi x}{100}\Bigr]_{0}^{50}
-\frac{200}{n\pi}\Bigl(\cos n\pi - \cos \frac{n\pi}{2}\Bigr)\\
& &     +\frac{2}{n\pi}\Bigl(100\cos n\pi - 50 \cos\frac{n\pi}{2}\Bigr)
-\frac{2}{n\pi}\Bigl[\frac{100}{n\pi}\sin\frac{n\pi x}{100}\Bigr]^{100}_{50}\\
&=& -\frac{100}{n\pi}\cos\frac{n\pi}{2} +
\frac{200}{n^2\pi^2}\sin\frac{n\pi}{2}
- \frac{200}{n\pi}\cos n\pi + \frac{200}{n\pi}\cos \frac{n\pi}{2} \\
&& + \frac{200}{n\pi}\cos n\pi - \frac{100}{n\pi}\cos \frac{n\pi}{2}
+ \frac{200}{n^2\pi^2}\sin \frac{n\pi}{2}\\
&=& \frac{400}{n^2\pi^2}\sin\frac{n\pi}{2}
\end{eqnarray*}
Thus the solution is
$$u(x,t) = \sum_{n=1}^{\infty} \frac{400}{n^2\pi^2}\sin\frac{n\pi}{2} e^{-(.0107n\pi)^2 t} \sin\frac{n\pi x}{100}.$$

(c) We compute
\begin{eqnarray*}
b_n&=&\frac{2}{100}\int_{0}^{100}u(x,0)\sin\frac{n\pi x}{100}\dx\\
&=&\frac{2}{100}\int_{25}^{75}50\sin\frac{n\pi x}{100}\dx\\
&=&\Bigl[-\frac{100}{n\pi}\cos\frac{n\pi x}{100}\Bigr]_{25}^{75}
=\frac{100}{n\pi}\Bigl(\cos\frac{n\pi}{4}-\cos\frac{3n\pi}{4}\Bigr).
\end{eqnarray*}
The solution is thus
$$u(x,t) = \sum_{n=1}^{\infty} \frac{100}{n\pi} \Bigl(\cos\frac{n\pi}{4}-\cos\frac{3\pi{}n}{4}\Bigr) e^{-(.0107n\pi)^2 t} \sin\frac{n\pi x}{100}.$$

\problem{10.5.7} {\em Consider a uniform rod of length $\ell$ with an
initial temperature given by $sin(\pi x/\ell)$, $0\leq x \leq \ell$. Assume
that both ends of the bar are insulated. Find a formal series expansion
for the temperature $u(x,t)$. What is the steady state temperature as
$t\rightarrow\infty$?}
\soln
{\em Summary.} (See page 547.) Using separation of variables as in section 1
Boyce-DiPrima derive the solution to the heat conduction problem
with insulated ends. [Study this derivation. Understanding this type of
derivation is essential if you want to do well on the final exam.]
The solution is
$$u(x,t)=\frac{c_0}{2}+\sum_{n=1}^{\infty} c_n e^{-(n\pi\alpha/\ell)^2t} \cos\frac{n\pi x}{\ell}.$$
The coefficients $c_n$ are determined by the requirement that
$$u(x,0)=\frac{c_0}{2} + \sum_{n=1}^{\infty} c_n\cos\frac{n\pi x}{\ell}=f(x).$$
Thus to solve this problem we just need to find the cosine series
expansion of $f(x)=\sin(\pi x/\ell)$.
This is computed using equation (7) page 536. As it turns out,
to integrate we must do the cases $n=1$ and $n\neq 1$ separately.
First suppose $n\neq 1$. Then substituting
$\sin\frac{\pi x}{\ell}$ for $f(x)$ we obtain
\begin{eqnarray*}
c_n&=&\frac{2}{\ell}\int_0^{\ell}
\sin\frac{\pi x}{\ell}\cos\frac{n\pi x}{\ell}\dx\\
&=&\frac{1}{\ell}\int_{0}^{\ell}\sin\frac{(n+1)\pi x}{\ell}
+\sin\frac{(1-n)\pi x}{\ell}\dx\\
&=&\frac{1}{\ell}\Bigl[-\frac{\ell}{(n+1)\pi}\cos\frac{(n+1)\pi x}{\ell}
-\frac{\ell}{(1-n)\pi}
\cos\frac{(1-n)\pi x}{\ell}\Bigr]^{\ell}_{0}\\
&=&-\frac{1}{(n+1)\pi}\cos(n+1)\pi - \frac{1}{(1-n)\pi}\cos(1-n)\pi
-\Bigl(-\frac{1}{(n+1)\pi}+\frac{1}{\pi(n-1)}\Bigr)\\
&=& \begin{cases} 0&\text{if $n$ odd}\\
-\frac{4}{(n^2-1)\pi}&\text{if $n$ even}
\end{cases}
\end{eqnarray*}
Next suppose $n=1$. Then
\begin{eqnarray*}
c_1&=&\frac{2}{\ell}\int_0^{\ell}
\sin\frac{\pi x}{\ell}\cos\frac{\pi x}{\ell}\dx\\
&=&\frac{1}{\ell}\int_{0}^{\ell}\sin\frac{2\pi x}{\ell}\dx\\
&=&-\frac{1}{2\pi}\Bigl[\cos\frac{2\pi x}{\ell}\Bigr]^{\ell}_{0}=0.
\end{eqnarray*}

To integrate $\sin\frac{\pi x}{\ell}\cos\frac{n\pi x}{\ell}$
we have used the trigonometric identity
$$\sin A \cos B = \frac{1}{2}(\sin (A+B) + \sin(A-B)).$$
This identity follows by adding the two identities
$$\sin(A+B)=\sin A \cos B + \sin B \cos A$$
$$\sin(A-B)=\sin A \cos B - \sin B \cos A.$$
The solution to this insulated heat conduction problem is thus
$$u(x,t)=\frac{2}{\pi}-\frac{4}{\pi}\sum_{\text{n even}} \frac{1}{n^2-1} e^{-(n\pi\alpha/\ell)^2t} \cos\frac{n\pi x}{\ell}.$$
Finally $\lim_{t\rightarrow\infty}u(x,t)=\frac{2}{\pi}$ so
the steady state temperature is $\frac{2}{\pi}$.

\problem{10.6.4} {\em Find the displacement $u(x,t)$ in an elastic string of
length $\ell$, fixed at both ends, that is set in motion from its straight
equilibrium position with the initial velocity $g$ defined by
$$g(x)=\begin{cases} Ax,&0\leq x \leq \ell/2\\ A(\ell-x),& \ell/2 < x \leq \ell.\end{cases}$$}
\soln
{\em Summary.} (See pages 554-559.) Using separation of variables
the authors find solutions to the elastic string problem
$a^2u_{xx}=u_{tt}$.
Their solution is
$$u(x,t)=\sum_{n=1}^{\infty}\sin\frac{n\pi x}{\ell} \Bigl(c_n\sin\frac{n\pi a t}{\ell} + k_n\cos\frac{n\pi a t}{\ell}\Bigr).$$
Let $f(x)$ be the initial displacement of the string and $g(x)$
be the initial velocity of the string. Then
$$k_n=\frac{2}{\ell}\int_{0}^{\ell} f(x)\sin\frac{n\pi x}{\ell}\dx$$
and
$$\frac{n\pi a}{\ell} c_n = \frac{2}{\ell}\int_{0}^{\ell}g(x)\sin\frac{n\pi x}{\ell}\dx.$$
Note that $c_n$ is the $n$th coefficient of the sine series for $g(x)$
{\em divided} by $\frac{n\pi a}{\ell}$.
In our situation $f(x)=0$ so $k_n=0$ for all $n$. Thus to find the solution
$u(x,t)$ we just need to find the sine series expansion of $g(x)$.
Fortunately problem (10.5.1 b) involves almost the same integral.
Looking at our work there we see that
$b\frac{4\ell}{n^2\pi^2}\sin\frac{n\pi}{2}$
is the $n$th Fourier coefficient
of the sine series expansion of
$$h(x)=\begin{cases}x,&0\leq x < \ell/2 \\ \ell-x, & \ell/2\leq x \leq \ell\end{cases}.$$
Multiplying by $A$ we see that the $n$th Fourier coefficient of $g(x)$
is $$b_n=\frac{4A\ell}{n^2\pi^2}\sin\frac{n\pi}{2}.$$
Thus $$c_n=\frac{\ell}{n\pi a}b_n =\frac{4\ell^2A}{n^3\pi^3a}\sin\frac{n\pi}{2}.$$
So the solution to the elastic string problem is
$$u(x,t)=\frac{4A\ell^2}{a\pi^3}\sum_{n=1}^{\infty} \frac{1}{n^3}\sin\frac{n\pi}{2} \sin\frac{n\pi x}{\ell}\sin\frac{n\pi a t}{\ell}.$$

\section{Solutions to the Final Exam}
\problem{Problem 1} Solve the system of differential equations
$$x_1'(t)=3x_1(t)+3x_2(t),$$
$$x_2'(t)=-2x_1(t)-4x_2(t)$$
with the initial conditions
$$x_1(0)=1, \quad x_2(0)=3.$$
\soln
Let $\vx(t)=(x_1(t),x_2(t))$. Then the system of equation becomes
$\vx'=A\vx$ where
$A=\Bigl(\begin{smallmatrix}3&3\\-2&-4\end{smallmatrix} \Bigr).$
First compute the characteristic polynomial of $A$,
$$|A-\lambda I|=\Bigl| \begin{matrix}3-\lambda&3\\-2&-4-\lambda\end{matrix}\Bigr| =\lambda^2+\lambda-6=(\lambda+3)(\lambda-2).$$
Thus the eigenvalues are $-3$ and $2$. The eigenvalue $-3$ has associated
eigenvector $v_1=(1,-2)$ and the eigenvalue $2$ has associated eigenvector
$v_2=(3,-1)$. It follows that the general solution is
$$\vx(t)=c_1e^{-3t}\Bigl[\begin{matrix}1\\-2\end{matrix}\Bigr] +c_2e^{2t}\Bigl[\begin{matrix}3\\-1\end{matrix}\Bigr].$$
To find $c_1$ and $c_2$ use the initial condition $\vx(0)=(1,3)$.
This gives $c_1=-2$ and $c_2=1$. Thus
$$\vx(t)=\Bigl[\begin{matrix}-2e^{-3t}+3e^{2t}\\ 4e^{-3t}-e^{2t}\end{matrix}\Bigr]$$
so $x_1(t)=-2e^{-3t}+3e^{2t}$ and
$x_2(t)=4e^{-3t}-e^{2t}$.

\problem{Problem 2}

(a) Find three functions $y_1(x), y_2(x), y_3(x)$ defined on $(-\infty,\infty)$
whose Wronskian is given by
$$W(y_1,y_2,y_3)(x)=e^{4x}.$$

(b) Are the functions $y_1,y_2,y_3$ that you found linearly independent
on $(-\infty,\infty)$? Justify your answer.
\soln
(a) There are many ways to solve this problem. One way is to
write down a matrix whose diagonal is $1,1,e^{4t}$
$$\left|\begin{matrix}1&*&*\\ 0&1&*\\ 0&0&e^{4t}\end{matrix}\right|.$$
Then integrate to fill in what the $*$'s must be to obtain
$$\left|\begin{matrix}1&x&\frac{1}{16}e^{4t}\\ 0&1&\frac{1}{4}e^{4t}\\ 0&0&e^{4t}\end{matrix}\right|.$$
Taking $y_1=1, y_2=x, y_3=\frac{1}{16}e^{4t}$ we see
at once that $W(y_1,y_2,y_3)=e^{4t}$.

(b) Yes, since their Wronskian is nonzero at some point.
\problem{Problem 3}

Find a homogeneous third-order linear differential equation with constant
coefficients that has
$$y(x)=3\cdot e^{-x}-cos(2x)$$
as a solution. Explain how you found it.

What is the general solution of that differential equation?

\soln
One way to solve this problem is to compute $y, y', y''$, and $y'''$ then
try to find a linear relation between them. In general this amounts
to solving a system of four equations in four unknowns.

Another way to solve this is to note that $y(x)$ is a solution to a
third order homogeneous linear differential equation which has fundamental
solution set $e^{-x}$, $\cos(2x)$ and $\sin(2x)$. The roots of the
characteristic equation associated to this differential equation must
be $1$, $2i$ and $-2i$. Thus the characteristic equation is
$$0=(r-1)(r-2i)(r+2i)=(r-1)(r^2+4)=r^3-r^2+4r-4$$
It follows that the differential equation is
$$y'''-y''+4y'-4y=0.$$

The general solution is
$$y=c_1e^{-x}+c_2\cos(2x)+c_3\sin(2x).$$

\problem{Problem 4}
For the function $f(x)=e^{x/\pi}$, draw a careful sketch of the graphs of the
functions to which the following Fourier series converge on the interval
$[0,4\pi]$:

(a) the Fourier sine series of $f$ on $[0,\pi]$;

(b) the Fourier cosine series of $f$ on $[0,\pi]$;

(c) the ordinary Fourier series of $f$ on $[-\pi,\pi]$.
\vspace{3in}

\problem{Problem 5}

Find a function $u=u(x,t)$, defined for $0\leq x\leq \pi$ and
$t\geq 0$, satisfying the partial differential equation
$$u_{xx}=-u_{tt}\quad (0<x<\pi, \quad t>0),$$
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<x<\pi).$$

\soln
Apply separation of variables. Let $u(x,t)=X(x)T(t)$.

The initial conditions
$$u(0,t)=u(\pi,t)=0\quad (t>0)$$
imply $0=X(0)T(t)$ and $0=X(\pi)T(t)$ for all $t$ so, to avoid
triviality, $X(0)=X(\pi)=0$.

Substituting $u=XT$ into the differential equation yields
$X''T=-XT''$ which becomes
$$\frac{X''}{-X}=\frac{T''}{T}.$$
Because the left hand side does not depend on $t$ and the right
side does not depend on $x$ we conclude that there is a constant
$a$ such that
$$\frac{X''}{-X}=a \text{ and } \frac{T''}{T}=a.$$
Thus
$$X''+aX=0 \text{ and } T'' - aT=0.$$
Since we are looking for a solution $u(x,t)$ for which
$u(x,0)=\sin(3x)$
we know that $a>0$ is probably going to be the right choice
since it gives sine and cosine type solutions.
Making this choice and solving yields
$$X(x)=c_1\cos(\sqrt{a} x)+c_2\sin(\sqrt{a} x).$$
Since $X$ must satisfy the initial conditions $X(0)=X(\pi)=0$
it follows that
$c_1=0$ and $c_2\sin(\sqrt{a}\pi)=0$. Thus
$\sqrt{a}\pi=n\pi$ for some integer $n$. Thus $\sqrt{a}=n$
so $a=n^2$. We see that $X(x)=\sin(nx)$ after setting the
arbitrary factor $c_2$ equal to $1$.

Next consider $T''-n^2T=0$. This has general solution
$$T(t)=c_1e^{nt}+c_2e^{-nt}.$$

Multiplying $X$ and $T$ together again we see that
$$u_n=\sin (nx)e^{nt}\text{ and } v_n=\sin(nx)e^{-nt}$$
for various integers $n$ give a bunch of solutions to the
differential equation $u_{xx}=-u_{tt}$ satisfying the
initial conditions $u(0,t)=u(\pi,t)=0$. [You should verify
this assertion by substituting $u_n$ and then $v_n$ into
$u_{xx}=-u_{tt}$.]

Can we find some linear combination of the $u_n$ and $v_n$
which satisfies the additional conditions $u(x,0)=\sin(3x)$
and $u_t(x,0)=0$? Yes. Setting $t=0$ shows that it will have
to be of the form
$$c_1\sin(3x)e^{3t}+c_2\sin(3x)e^{-3t}$$
for some constants $c_1$ and $c_2$.
A little algebra shows that $c_1=c_2=\frac{1}{2}$ does the trick.
Thus the solution is
$$u(x,t)=\frac{1}{2}\sin(3x)(e^{3t}+e^{-3t}).$$

\end{document}