Midterm 1: Sample solutions
1. Say whether the following operators acting on functions $u(x, y)$ are linear or nonlinear. Justify your answers. (a) $L u=u_{x x}+u_{y y}+1$; (b) $L u=$ $y u_{x x}+u_{y y}+u$; (c) $L u=u u_{x x}+u_{y y}$.
• (a) Nonlinear because of the nonhomogeneous term 1. For example,$$
L(u+v)=L u+L v-1 \neq L u+L v .
$$• (b) Linear. For every constant $c$ and all functions $u, v$ :$$
L(c u) &=y(c u)_{x x}+(c u)_{y y}+c u \\
&=c\left(y u_{x x}+u_{y y}+u\right) \\
&=c L u ; \\
L(u+v) &=y(u+v)_{x x}+(u+v)_{y y}+u+v \\
&=y u_{x x}+u_{y y}+u+y v_{x x}+v_{y y}+v \\
&=L u+L v .
$$• (c) Nonlinear because of the $u u_{x x}$ term. For example, if $c \neq 1$,$$
L(c u)=c^{2} u u_{x x}+c u_{y y}=c\left(c u u_{x x}+u_{y y}\right) \neq c L u .
$$2. Solve the following IVP for the wave equation$$
u_{t t}=c^{2} u_{x x}, \quad u(x, 0)=0, \quad u_{t}(x, 0)=\cos x .
• D'Alembert's solution of the wave equation with initial data$$
u(x, 0)=\phi(x), \quad u_{t}(x, 0)=\psi(x)
u(x, t)=\frac{1}{2}[\phi(x+c t)+\phi(x-c t)]+\frac{1}{2 c} \int_{x-c t}^{x+c t} \psi(\xi) d \xi
$$• Setting $\phi(x)=0$ and $\psi(x)=\cos x$, we get$$
u(x, t) &=\frac{1}{2 c} \int_{x-c t}^{x+c t} \cos \xi d \xi \\
&=\frac{1}{2 c}[\sin (x+c t)-\sin (x-c t)] .
$$3. Look for solutions of the heat equation$$
u_{t}=k u_{x x}
$$of the form$$
u(x, t)=f(x) e^{-a^{2} t}
$$where $a>0$ is a constant. Find the most general function $f(x)$ for which this is a solution. Give a physical explanation, in terms of heat flow, of why this solution decays exponentially in time.
• For functions $u$ of the form given in the question, we have$$
u_{t}=-a^{2} f e^{-a^{2} t}, \quad u_{x x}=f^{\prime \prime} e^{-a^{2} t} .
$$Thus, canceling the nonzero exponential factor, we see that $u$ satisfies the heat equation if and only if $-a^{2} f=k f^{\prime \prime}$, or$$
f^{\prime \prime}+\frac{a^{2}}{k} f=0 .
$$• The general solution of this equation (we assume $k>0$ ) is$$
f(x)=A \cos \left(\frac{a x}{\sqrt{k}}\right)+B \sin \left(\frac{a x}{\sqrt{k}}\right),
$$where $A, B$ are arbitrary constants. (The characteristic equation is $r^{2}+a^{2} / k=0$, with roots $r=\pm i a / \sqrt{k}$.)

• The solution decays because heat flows from hot spots where $f>0$ to cold spots where $f<0$. The faster $u$ oscillates in space, the faster it decays in time. More quantitatively, if $u(x, t)$ has wavelength $\lambda=$ $2 \pi \sqrt{k} / a$ in $x$, then it decays at at rate $e^{-\beta t}$ in time, where $\beta=4 \pi^{2} k / \lambda^{2}$. The rate of decay is also larger for larger thermal diffusivities $k$. 4. For what values of the constants $m, n$ does the PDE$$
u_{t}+u u_{x}+u_{x x x}=0
$$have similarity solutions of the form$$
u(x, t)=\frac{1}{t^{m}} f\left(\frac{x}{t^{n}}\right) ?
$$In that case, find an ODE for $f(z)$. (Don't try to solve it!)
• For similarity solutions of the form given in the question, we have (by the chain rule)$$
u_{t} &=-\frac{m}{t^{m+1}} f-\frac{n x}{t^{m+n+1}} f^{\prime}, \\
u_{x} &=\frac{1}{t^{m+n}} f^{\prime}, \\
u_{x x x} &=\frac{1}{t^{m+3 n}} f^{\prime \prime \prime} .
$$• It follows that $u$ is a solution of the PDE if$$
-\frac{m}{t^{m+1}} f-\frac{n x}{t^{m+n+1}} f^{\prime}+\frac{1}{t^{m}} f \cdot \frac{1}{t^{m+n}} f^{\prime}+\frac{1}{t^{m+3 n}} f^{\prime \prime \prime}=0 .
$$After multiplting this equation by $t^{m+1}$, we get$$
-m f-\frac{n x}{t^{n}} f^{\prime}+\frac{1}{t^{m+n-1}} f f^{\prime}+\frac{1}{t^{3 n-1}} f^{\prime \prime \prime}=0 .
$$• We get a self-consistent solution of the PDE only if $f$ does not depend on $t$ except through $z=x / t^{n}$. This is the case only if the powers of $t$ in front of the terms $f f^{\prime}$ and $f^{\prime \prime \prime}$ are zero, meaning that $m+n-1=0$ and $3 n-1=0$, or$$
m=\frac{2}{3}, \quad n=\frac{1}{3} .
$$• In that case, $f(z)$ satisfies the ODE$$
f^{\prime \prime \prime}+f f^{\prime}-\frac{1}{3} z f^{\prime}-\frac{2}{3} f=0 .
$$5. Suppose that $u(x, t)$ is a solution of the initial value problem$$
u_{t}+c u_{x}+u=0, \quad u(x, 0)=\phi(x) .
$$such that $u$ and its derivatives approach zero as $|x| \rightarrow \infty$. Show that$$
\int_{-\infty}^{\infty} u^{2}(x, t) d x=e^{-2 t} \int_{-\infty}^{\infty} \phi^{2}(x) d x .
• Multiplying the PDE by $u$ and using $u u_{t}=\left(u^{2} / 2\right)_{t}$ (and similarly for $x$-derivatives), we get$$
\left(\frac{1}{2} u^{2}\right)_{t}+\left(\frac{1}{2} c u^{2}\right)_{x}+u^{2}=0 .
$$Integrating this equation with respect to $x$ and using$$
\int_{-\infty}^{\infty}\left(u^{2}\right)_{t} d x=\frac{d}{d t} \int_{-\infty}^{\infty} u^{2} d x, \quad \int_{-\infty}^{\infty}\left(u^{2}\right)_{x} d x=\left.u^{2}\right|_{-\infty} ^{\infty}=0
$$we get that$$
\frac{d}{d t} \int_{-\infty}^{\infty} u^{2} d x+2 \int_{-\infty}^{\infty} u^{2} d x=0
$$or $y_{t}+2 y=0$ where $y(t)=\int_{-\infty}^{\infty} u^{2}(x, t) d x$. Solving this ODE, we get$$
\int_{-\infty}^{\infty} u^{2} d x=C e^{-2 t},
$$and evaluating this expression at $t=0$, we find that$$
C=\int_{-\infty}^{\infty} \phi^{2}(x) d x
$$which proves the result.

• An alternative method is to solve the IVP exactly, which gives$$
u(x, t)=e^{-t} \phi(x-c t) \text {, }
$$and then note that$$
\int_{-\infty}^{\infty} u^{2}(x, t) d x=e^{-2 t} \int_{-\infty}^{\infty} \phi^{2}(x-c t) d x=e^{-2 t} \int_{-\infty}^{\infty} \phi^{2}(x) d x,
$$where we change the integration variable from $x-c t$ to $x$ in the last step. The first method doesn't depend on having an explicit solution. 6. Suppose that algae on a (one-dimensional) lake has population density $u(x, t)$. Assume that the algae grows at a rate proportional to its population density and diffuses from high-density to low density regions at a rate proportional to its population gradient $u_{x}$. Derive a PDE for $u(x, t)$.
• For an arbitray interval $a \leq x \leq b$, we have$$
\text { rate of change of algae population in } a \leq x \leq b & \\
&=(\text { flux of algae into } a \leq x \leq b) \\
&+(\text { growth rate of population in } a \leq x \leq b)
$$• Assume that $q=-k u_{x}$ is the flux of algae and $r=c u$ is the growth rate density. Then$$
\frac{d}{d t} \int_{a}^{b} u(x, t) d x &=q(a, t)-q(b, t)+\int_{a}^{b} r(x, t) d x \\
&=-k u_{x}(a, t)+k u_{x}(b, t)+\int_{a}^{b} c u(x, t) d x .
$$• Using the fundamental theorem of calculus to write$$
-k u_{x}(a, t)+k u_{x}(b, t)=\int_{a}^{b} k u_{x x}(x, t) d x,
$$and combining the terms, we get that$$
\int_{-\infty}^{\infty}\left(u_{t}-k u_{x x}-c u\right) d x=0 .
$$• Since this equation holds for all $a<b$, the integrand $u_{t}-k u_{x x}-c u$ must be zero (assuming it's continuous), so the PDE is$$
u_{t}=k u_{x x}+c u .