\documentclass{article}
\input{macros.tex}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{siunitx}
\newcommand{\tangent}{\mathbf T}
\newcommand{\utangent}{\mathbf t}
\newcommand{\normal}{\mathbf N}
\newcommand{\unormal}{\mathbf n}
\DeclareMathOperator{\diag}{diag}
\DeclareMathOperator{\erf}{erf}
\begin{document}
\pagestyle{empty}
% Name : \rule[-3pt]{6cm}{1pt} \\
\begin{center}
{\Large Homework \# 8 (Final homework!)} \\
\vskip 0.2cm
{\large Math 427/527}
\vskip 0.5cm
\end{center}
{\bf Note : } Math 427 students may do the Math 527 questions for extra credit. You may work in pairs on this assignment, but pairs can only be two 427 students or two 527 students but not mixed pairs.
If you work together (pairs of two only), {\em you may turn in a single homework with both names.}
\begin{enumerate}
\item {\bf Error equation.} The error function is defined as
\begin{equation*}
\erf(x) = \frac{2}{\sqrt{\pi}} \int_{0}^{x} e^{-\omega^2} \; d\omega
\end{equation*}
\begin{enumerate}
\item Show that the error function is an odd function, e.g. $\erf(-x) = -\erf(x)$.
\item Show that
\begin{equation*}
\int_a^b e^{-\omega^2} \; d\omega = \frac{\sqrt{\pi}}{2} \left(\erf(b) - \erf(a)\right)
\end{equation*}
You have to show your work. You can verify this in WolframAlpha, but show that you know how to obtain the expression above.
\item \label{prob:erf} The solution to the 1d heat equation in an infinite domain is given by
\begin{equation*}
u(x,t) = \frac{1}{2\sqrt{D \pi t}} \int_{-\infty}^{\infty} f(p) e^{\frac{-(x-p)^2}{4Dt}}
\; dp
\end{equation*}
where $f(x)$ is the initial condition. For the initial condition $f(x)$ defined as
\begin{equation*}
f(x) = \left\{
\begin{array}{cc}
1 & -1 < x < 1 \\
0 & \mbox{otherwise}
\end{array}\right.
\end{equation*}
write the solution to the 1d heat equation in terms of the error function.
\item Show that your solution in \Prob{erf} satisfies the initial conditions. {\bf Hint:} Use the fact that
\begin{equation*}
\lim_{x \rightarrow \infty} \erf(x) = 1
\end{equation*}
and consider the case for very small (but not zero) value of $t$.
\end{enumerate}
\item {\bf Laplace's equation.} Consider Laplace's equation in the unit square, given by
\begin{equation*}
\nabla^2 u = 0, \quad x \in [0,1] \times [0,1]
\end{equation*}
In class, we used separation of variables to solve the problem with homogeneous boundary conditions on 3 sides (left, bottom and top) and an inhomogeneous boundary condition $u(1,y) = f(y)$ at the right edge. The key to the solution that we found was that in the y-direction, we could match both boundary conditions using the function
\begin{equation*}
G(y) = A \cos(\nu y) + B \sin(\nu y)
\end{equation*}
with an appropriate choice of $\nu$. We could match the left boundary condition using
\begin{equation*}
F(x) = C \cosh(\nu x) + D \sinh(\nu x)
\end{equation*}
\begin{enumerate}
\item Using a technique similar to what we did in class, solve the problem on the unit square, with homogeneous boundary conditions at the left, right and bottom of the square. On the top edge, impose $u(x,1) = g(x) = -4x(1-x)$.
\item Modify the code done in class to plot your solution. Use enough terms so that you get a nice solution. Turn in your plot.
\item Obtain a solution that satisfies $u(0,y) = u(x,0) = 0$, and $u(1,y) = 4y(1-y)$,
$u(x,1) = 4x(1-x)$.
\item Describe a general approach for solving Laplace's equation on the unit square with general Dirichlet boundary conditions.
\end{enumerate}
\item ({\bf Math 527.}) \label{prob:sphere}
Laplace's equation can be used to model electrostatic potential. If we assume symmetry in the longitude direction, Laplace's equation in spherical coordinates is given by
\begin{equation}
\nabla^2 u = \frac{1}{r^2}\left[
\frac{\partial}{\partial r}\left(r^2 \frac{\partial u}{\partial r} \right) +
\frac{1}{\sin \phi}\frac{\partial }{\partial \phi}\left(\sin \phi \frac{\partial u}{\partial \phi} \right)\right] = 0.
\label{eqn:sphere}
\end{equation}
We can solve this using separation of variables (see Section 12.11 in your course textbook) to get the Fourier-Legendre series solution. On Homework \#1, we used the solution in the interior of the sphere. In this problem, we will use the solution
exterior to the sphere, given by
\begin{equation*}
u(r,\phi) = \sum_{n=0}^{\infty} \frac{B_n}{r^{n+1}} P_n(\cos \phi)
\end{equation*}
where $P_n(x)$ are the Legendre polynomials. The coefficients $B_n$ are computed using the electric charge distribution $u(R,\phi) = f(\phi)$ on the sphere. These coefficients are computed as
\begin{equation*}
B_n = \frac{2n + 1}{2}R^{n+1}\int_0^\pi f(\phi)P_n(\cos \phi)\sin \phi \; d\phi
\end{equation*}
where $R$ is the radius of the sphere.
Assume $R=1$ and do the following.
\begin{enumerate}
\item \label{prob:radial} Compute the first few non-zero coefficients for the solution to the exterior problem with charge density $f(\phi) = 1$. Write out the series solution using the coefficients you found.
\item \label{prob:point} Show that the only solution to Laplace's equation in the sphere that depends on $r$ only is given by
\begin{equation*}
u(r) = \frac{a}{r} + b
\end{equation*}
for constants $a$ and $b$. {\bf Hint:} Show this by using \eqn{sphere} directly and assuming no variation in $\phi$.
\item Show that for large $r$ the series solution you found in \Prob{radial} behaves like the point charge solution from \Prob{point}.
\end{enumerate}
\end{enumerate}
\end{document}