\documentclass[11pt]{amsart}
\usepackage{amssymb, amsmath, amsfonts, amsthm, booktabs}
\usepackage[abbrev]{amsrefs}
%\usepackage[notref]{showkeys}
\usepackage[margin=0.8 in]{geometry}
\usepackage[colorlinks=true,
        linkcolor=blue]{hyperref}
        
\def \k {K\"ahler }
\def \s {Szeg\H{o} }
\def \d {\partial}
\def \y {{\tilde{y}}}
\def \dbar {\oo\partial}
\def \dd {\partial}
\def \dt {\frac{\partial}{\partial t}}
\def \eps {\varepsilon}
\DeclareMathOperator{\Tr}{Tr} 
\DeclareMathOperator{\Ric}{Ric}
\DeclareMathOperator{\Real}{Re}
\DeclareMathOperator{\Sym}{Sym}
\DeclareMathOperator{\vol}{vol}
\DeclareMathOperator{\Hess}{Hess}
\DeclareMathOperator{\Rm}{Rm}
\DeclareMathOperator{\osc}{osc}
\DeclareMathOperator{\id}{id}
\DeclareMathOperator{\sn}{sn}
\DeclareMathOperator{\cs}{cs}
\DeclareMathOperator{\tn}{tn}
\DeclareMathOperator{\dist}{dist}

\newcommand{\oo}[1]{\overline{#1}}
\newcommand{\f}[2]{\frac{#1}{#2}}
\newtheorem{claim}{Claim}
\newtheorem{aside}{Aside}
%\newtheorem{example}{Example}

\title{Midterm 2}
\date{}


\theoremstyle{definition} 
\newtheorem{definition}{Definition}[section]
\newtheorem{conjecture}{Conjecture}[section]
\newtheorem{example}{Example}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{remark}{Remark}[section]
\newtheorem{question}{Question}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[section]
\newtheorem*{notation}{Notation}

\begin{document}
\maketitle
Please write your name on each page of your answer sheet and \textbf{do not fold the pages together}.
\begin{enumerate}
\item Show the uniqueness to the solution of
\begin{equation*}
\begin{cases}
u_t - ku_{xx} = f(x,t) & \text{for }0<x<L, \ \ t> 0\\
u(x,0) = \phi(x) \\
u(0,t) = g(t)\\
u(L,t) = h(t)
\end{cases}
\end{equation*}
for sufficiently nice functions $f,g,h,\phi$.  You can use whatever method you want.  A useful energy for the heat equation is the $L^2$ energy given by $E[u](t) = \int_0^L u^2(x,t)dx$.

\item Solve in terms of the error function
\begin{equation*}
\begin{cases}
u_t-ku_{xx} = 0 & \text{ on }0 < x <\infty, t> 0\\
u(x,0) = 0\\
u(0,t) = 1.
\end{cases}
\end{equation*}
Hint: First consider $v := u-1$.  What equation does $v$ satisfy? Then solve that equation, keeping in mind that we are solving this on the half-line.  The error function is given by
\begin{equation*}
\mathcal{E}\text{rf}(x) = \frac{2}{\sqrt{\pi}}\int_0^x e^{-s^2}ds.
\end{equation*}

\item Solve by finding an explicit formula.  Make sure to integrate out the solution of 
\begin{equation*}
\begin{cases}
u_{tt}-u_{xx} = e^{2x} & \text{ on } (x,t) \in \mathbb{R}^2\\
u(x,0) = 0 \\
u_t(x,0) = 0.
\end{cases}
\end{equation*}
Note that $\sinh(x) = \frac{e^{x}-e^{-x}}{2}$, $\cosh(x) = \frac{e^x + e^{-x}}{2}$ and that $(\sinh(x))' = \cosh(x)$.

\item Let $L,T>0$.  Suppose $u$ is twice differentiable on the open rectangle $(0,L)\times (0,T)$ and satisfies the partial differential inequality
\begin{equation*}
u_t - u_{xx} + u < 0.
\end{equation*}
Suppose further that $u$ is continuous on $R=[0,L]\times [0,T]$.  If $M$ is the maximum on of $u$ on $R$ and $M\geq 0$, then show that $u$ attains the value $M$ on the sides $x=0$ or $x=L$ or on the bottom $t=0$ of $R$.  Hint: Consider the sign or value of each quantity in the partial differential inequality at a maximum point if it were to occur in the interior.  No $v=u+\eps$ trick is necessary for this problem.
\textbf{Bonus +2} Do the same problem but with $<$ replaced with $\leq$ in the PDE. (Make sure to justify each step).
\end{enumerate}

\newpage

\section{Solutions}
\begin{enumerate}
\item Let $u_1$ and $u_2$ be two solutions. Let $w = u_1-u_2$. Then $w$ satisfies the PDE
\begin{equation*}
\begin{cases}
w_t - kw_{xx} = 0 & \text{for }0<x<L, \ \ t>0,\\
w(x,0)=0\\
w(0,t) = 0\\
w(L,t) = 0.
\end{cases}
\end{equation*}
\textbf{Method 1}  By the maximum principle, we have that $w(x,t)\leq 0$ for $x,t$ in the domain.  Since $-w$ satisfies the same equation with the same initial conditions, we know that $w(x,t) \geq 0$, hence $0 = w = u_1-u_2$, hence $u_1 = u_2$.

\noindent \textbf{Method 2} Taking the derivative of the energy gives us
\begin{align*}
\frac{d}{dt}E[w](t) &= \int_0^L 2uu_tdx\\
&= 2k\int_0^Luu_{xx}dx\\
&= -2k\int_0^L(u_x)^2dx \leq 0.
\end{align*}
Hence energy is nonincreasing.  By definition, we have $0\leq E[w](t)$.  When $t=0$, we have $E[w](0) = \int_0^L w(x,0)^2dx= 0$, so
\begin{equation*}
E[w](t) = \int_0^Lw(x,t)^2 = 0,
\end{equation*}
which implies that $w(x,t) = 0$.

\item Let $v = u-1$.  Then $v$ satisfies
\begin{equation*}
\begin{cases}
v_t - kv_{xx} = 0 &\text{for } 0 < x < \infty, \ \ t>0\\
v(x,0) = -1\\
v(0,t) = 0.
\end{cases}
\end{equation*}
Since $v(0,t) = 0$, we can use the odd extension of the initial condition to obtain the half-line solution:
\begin{equation*}
v(x,t) = \frac{1}{\sqrt{4k\pi t}}\int_0^\infty e^{-\frac{(x+y)^2}{4kt}}dy - \frac{1}{\sqrt{4k\pi t}}\int_0^\infty e^{-\frac{(x-y)^2}{4kt}}dy.
\end{equation*}
Changing variables, we get
\begin{align*}
v(x,t) &= \frac{1}{\sqrt{\pi}}\int_{\frac{x}{\sqrt{4kt}}}^\infty e^{-s^2}ds - \frac{1}{\sqrt{\pi}}\int_{-\infty}^{\frac{x}{\sqrt{4kt}}}e^{-s^2}ds \\
&= \frac{1}{\sqrt{\pi}}\int_0^\infty e^{-s^2}ds - \frac{1}{\sqrt{\pi}}\int_{0}^{\frac{x}{\sqrt{4kt}}}e^{-s^2}ds - \frac{1}{\sqrt{\pi}}\int_{-\infty}^0 e^{-s^2}ds - \frac{1}{\sqrt{\pi}}\int_{0}^{\frac{x}{\sqrt{4kt}}}e^{-s^2}ds \\
&= -\frac{2}{\sqrt{\pi}}\frac{1}{\sqrt{\pi}}\int_{0}^{\frac{x}{\sqrt{4kt}}}e^{-s^2} = -\mathcal{E}\text{rf}\left( \frac{x}{\sqrt{4kt}} \right)
\end{align*}
Therefore,
\begin{equation*}
u(x,t) = 1-\mathcal{E}\text{rf}\left( \frac{x}{\sqrt{4kt}} \right)
\end{equation*}

\item Using the nonhomogeneous solution to the wave equation on the whole line, we have
\begin{equation*}
u(x,t) = \frac{1}{2}\iint_{T} e^{2y}dyds
\end{equation*}
where $T$ is the two dimensional characteristic triangle.  The double integral can be parametrized and computing in the following way
\begin{align*}
\iint_{T} e^{2y}dyds &= \int_0^t\iint_{x-(t-s)}^{x+(t-s)}e^{2y}dyds \\
&=\frac{1}{2}\int_0^t \left( e^{2y}\biggr|_{x-(t-s)}^{x+(t-s)}\right)ds \\
&= \frac{e^{2x}}{2}\int_0^t (e^{2(t-s)}-e^{-2(t-s)}ds \\
&= e^{2x}\int_0^t \sinh(2(t-s))ds \\
&= -\frac{e^{2x}}{2}\cosh(2(t-s))\biggr|_{s=0}^{s=t} \\
&=\frac{e^{2x}}{2}(\cosh(2t)-1).
\end{align*}
Hence the solution is given by
\begin{equation*}
u(x,t) = \frac{e^{2x}}{4}(\cosh(2t)-1)
\end{equation*}

\item Suppose $u$ attains a nonnegative maximum at some point in the interior, say $(x_0,t_0)$ and first assume $t_0 < T$.  Then 
\begin{align*}
u(x_0,t_0) &= M \geq 0 \\
u_t(x_0,t_0) &= 0\\
-u_{xx}(x_0,t_0) &\geq 0.
\end{align*}
Plugging in to the PDE, at the maximum point we have
\begin{align*}
0 \leq u_t(x_0,t_0)-u_{xx}(x_0,t_0) + u(x_0,t_0) <0
\end{align*}
which is a contradiction.  If the maximum occurs at the interior of $(0,L)$ but at $t=T$, then the one-sided derivative at $T$ of $u_t$ is $u_t(x_0,T) \geq 0$ since this is a maximum.  We get the same contradiction hence the maximum cannot occur in the interior.  Since $R$ is compact, $u$ must obtain a maximum somewhere in $R$, which must be the sides or the bottom.

For the bonus, consider $v_\eps = v - \eps t$.
\end{enumerate}

\end{document}


