% vim: tw=50
% 30/11/2022 10AM

\begin{align*}
    LHS
    &= \int_B \nabla^2 G \dd \bf{x} \\
    &= \int_S \nabla G \cdot \bf{n} \dd S \\
    &= 4\pi r^2 \dfrac{G}{r} \\
    RHS
    &= \int_B \delta(\bf{x}) \dd \bf{x} \\
    &= 1
    &&\text{by (10.14)}
\end{align*}
So
\[ \dfrac{G}{r} = \frac{1}{4\pi r^2} \implies G =
-\frac{1}{4\pi r} + c \]
But $G \to 0$ as $r \to \infty$, so $c = 0$.
Free-space Green's function:
\begin{flashcard}[Green-function-for-3D-Poisson]
\prompt{Green's function for 3D Poisson equation?}
\[ \boxed{G(\bf{x}; \bf{x}') =
\cloze{-\frac{1}{4\pi|\bf{x} - \bf{x}'|}}}
\tag{10.16} \]
\prompt{\cloze{This is constructed to satisfy
$\nabla^2 G = \delta^3$, and $G \to 0$ as $\bf{x}
\to \infty$.}}
\end{flashcard}
General solution in $\RR^3$
\[ \phi(\bf{x}) = \frac{1}{4\pi}
\int_{-\infty}^\infty \frac{\rho(\bf{x}')}{|\bf{x}
- \bf{x}'|} \dd \bf{x}' \]
Exercise: Similarly in $\RR^2$ derive
\begin{flashcard}[Green-function-for-2D-Poisson]
\prompt{Green's function for 2D Poisson equation?}
\[ G_{\text{2D}} (\bf{x}; \bf{x}') =
\cloze{\frac{1}{2\pi} \log(|\bf{x} - \bf{x}'|) +
c_2} \]
\prompt{\cloze{This is constructed to satisfy
$\nabla^2 G = \delta^2$, but \fcemph{doesn't} satisfy a
nice boundary condition (can use method of images
in some circumstances though).}}
\end{flashcard}

\subsubsection*{Green's Identities}

Consider two scalar functions $\phi, \varphi$
twice differentiable on $\mathcal{D}$.
\begin{align*}
    \int_{\mathcal{D}} \nabla \cdot (\varphi
    \nabla \psi) \dd \bf{x}
    &= \int_{\mathcal{D}} (\phi \nabla^2 \phi +
    \nabla \phi \cdot \nabla \psi) \dd \bf{x} \\
    &= \int_{\partial \mathcal{D}} \phi \nabla \psi \cdot
    \hat{\bf{n}} \dd S \tag{10.17}
\end{align*}
\begin{hiddenflashcard}[Greens-first-identity]
\prompt{Green's first identity?}
\[ \cloze{\int_{\mathcal{D}} \nabla \cdot (\phi \nabla
\psi) \dd \bf{x} = \int_{\partial \mathcal{D}}
\phi \nabla \psi \cdot \hat{\bf{n}} \dd S} \]
\end{hiddenflashcard}
This is \emph{Green's first identity} $\phi
\leftrightarrow \psi$ and subtract from (10.17),
then \emph{Green's second identity}
\begin{flashcard}[Greens-second-identity]
\prompt{Green's second identity?}
\[ \cloze{\int_{\partial \mathcal{D}} \left( \phi
\pfrac{\psi}{n} - \psi \pfrac{\phi}{n} \right) \dd
S = \int_{\mathcal{D}} (\phi \nabla^2 \psi -
\psi \nabla^2 \phi) \dd \bf{x}} \tag{10.18} \]
\end{flashcard}
Now consider a small spherical ball $B_\eps$
(radius $\eps$) about $\bf{x}$ (WLOG $\bf{x}' =
0$) Take $\phi$ in (10.18) such that $\nabla^2
\phi = -\rho(\bf{x})$ and $\psi = G(\bf{x};
\bf{x}')$ ($\nabla^2 G = \delta(\bf{x} -
\bf{x}')$)
\begin{center}
    \includegraphics[width=0.6\linewidth]
    {images/21e40fe2709911ed.png}
\end{center}
\begin{align*}
    RHS
    &= \int_{\mathcal{D} - B_\eps} (\phi \ub{\nabla^2
    G}_{=0} - G \ub{\nabla^2 \phi}_{=\rho}) \dd
    \bf{x} \\
    &= \int_{\mathcal{D} - B_\eps} G\rho \dd
    \bf{x} \\
    LHS
    &= \int_{\partial \mathcal{D}} \left( \phi
    \pfrac{G}{n} - G \pfrac{\phi}{n} \right) \dd S
    + \int_{S_\eps} \ub{\left( \phi \pfrac{G}{n} - G
    \pfrac{\phi}{n} \right)}_{(*)} \dd S
\end{align*}
Second integral on small sphere $S_\eps$, $\eps
\to 0$ (outward normal on $S_\eps$ points in $-$
direction)
\[ \int_{S_\eps} (*) \dd S = \left( \ol{\phi}
\left( -\frac{1}{4\pi \eps^2} \right) -
\frac{1}{4\pi \eps^2} \pfrac{\ol{\phi}}{r} \right)
4\pi \eps^2 = -\phi(0) \]
($\ol{\phi}$ denotes the average value, because we
are on $S_\eps$)
Combining (with arbitrary $\bf{x}'$ now) we get
\emph{Green's third identity}
\begin{flashcard}[Greens-third-identity]
\prompt{Green's third identity?}
\cloze{
\begin{align*}
    \phi(\bf{x}')
    &= \int_{\mathcal{D}} G(\bf{x}; \bf{x}')
    (-\rho(\bf{x})) \dd \bf{x}
    + \int_{\partial \mathcal{D}} \left(
    \phi(\bf{x}) \pfrac{G}{n}(\bf{x}; \bf{x}') -
    G(\bf{x}; \bf{x}') \pfrac{\phi}{n}(\bf{x})
    \right) \dd S \tag{10.19}
\end{align*}
}
\end{flashcard}
\emph{Dirichlet Green's function}: \\
Solve $\nabla^2 \phi = -\rho$ on $\mathcal{D}$
with inhomogeneous boundary conditions
$\phi(\bf{x}) = h(\bf{x})$ on $\partial
\mathcal{D}$.
\begin{flashcard}[Dirichlet-Green-function]
Dirichlet Green's function satisfies
\begin{enumerate}[(i)]
    \item \cloze{$\nabla^2 G(\bf{x}; \bf{x}') = 0$,
        $\forall \bf{x} \neq \bf{x}'$}
    \item \cloze{$G(\bf{x}; \bf{x}') = 0$ on $\partial
        \mathcal{D}$.}
    \item \cloze{$G(\bf{x}; \bf{x}') =
        G_{\text{FS}}(\bf{x}; \bf{x}') + H(\bf{x};
        \bf{x}')$ with $\nabla^2 H(\bf{x};
        \bf{x}') = 0$ $\forall \bf{x} \in
        \mathcal{D}$.}
\end{enumerate}
\end{flashcard}
Green's second identity
(10.18) with $\nabla^2 \phi = -\rho$, $\nabla^2 H
= 0$
\[ \int_{\partial \mathcal{D}} \left( \phi
\pfrac{H}{n} - H \pfrac{\phi}{n} \right) \dd S =
\int_{\mathcal{D}} H\rho \dd \bf{x} \tag{\dag} \]
Now we use $G_{\text{FS}} = G - H$ in Green's
third identity (10.19)
\[ \phi(\bf{x}') = \int_{\mathcal{D}}(G - H)
(-\rho) \dd \bf{x} + \int_{\partial \mathcal{D}}
\left( \phi \pfrac{(G - H)}{n} - (G - H)
\pfrac{\phi}{n} \right) \dd S \]
Subtract $H$ terms above in ($\dag$) ($G = 0$,
$\phi = h$ on $\partial \mathcal{D}$)
\begin{flashcard}[Poisson-Dirichlet-Green-function]
\prompt{Solution to Poisson's equation
\cloze{$\nabla^2 \phi = -\rho$} with Dirichlet
boundary conditions \cloze{$\phi = h$ on $\partial
D$} is given by}
\[ \boxed{\phi(\bf{x}') = \cloze{
\int_{\mathcal{D}} G(\bf{x};
\bf{x}') (-\rho(\bf{x})) \dd \bf{x} +
\int_{\partial \mathcal{D}} h(\bf{x}) \pfrac{G}{n}
(\bf{x}; \bf{x}') \dd S}} \tag{10.20} \]
\prompt{\cloze{where $G$ is the \fcemph{Dirichlet
Green's function}.}}
\end{flashcard}
Exercise: Use (10.18) to show that GF is symmetric
(third identity), $G(\bf{x}; \bf{x}') = G(\bf{x}';
xbf)$, $\forall \bf{x} \neq \bf{x}'$. \myskip
For Neumann BCs specifying
\[ \pfrac{\phi}{n} = K(\bf{x}) \]
on $\partial \mathcal{D}$ we have
\begin{flashcard}[Poisson-Neumann-BCs]
\prompt{Solution to Poisson's equation
\cloze{$\nabla^2 \phi = -\rho$} with Neumann
boundary conditions \cloze{$\pfrac{\phi}{n} =
K$} on $\partial \mathcal{D}$ is given by}
\[ \phi(\bf{x}') = \cloze{\int_{\partial \mathcal{D}}
G(\bf{x}; \bf{x}') (-\rho(\bf{x})) \dd \bf{x} +
\int_{\partial \mathcal{D}} G(\bf{x}; \bf{x}')
(-K(\bf{x})) \dd S} \]
\prompt{\cloze{where $G$ is the \fcemph{Dirichlet
Green's function}.}}
\end{flashcard}
(see RJ lecture notes)

\subsection{Method of images}

For symmetric domains $\mathcal{D}$ we can
construct Green's functions with $G = 0$ on
$\partial \mathcal{D}$ by cancelling the Boundary
non-zero values by placing ``an image'' of Green's
function outside $\mathcal{D}$.

\subsubsection*{Laplace's equation on half-space}

Solve $\nabla^2 \phi = 0$ on $\mathcal{D} = \{(x,
y, z) : z > 0\}$ with $\phi(x, y, z = 0) = h(x,
y)$ and $\phi \to 0$ as $\bf{x} \to \infty$. Now
fundamental solution $G(\bf{x}; \bf{x}') \to 0$ as
$|\bf{x} \to \infty$, but $G \neq 0$ at $z = 0$.
So for $G$ at $\bf{x}' = (x', y', z')$ subtract
``image'' $G$ at $\bf{x}'' = (x', y', -z')$.
$G(\bf{x}; \bf{x}') = -\frac{1}{4\pi |\bf -
\bf{x}'|} - \left( \frac{1}{4\pi|\bf{x} -
\bf{x}''|} \right)$
\begin{center}
    \includegraphics[width=0.6\linewidth]
    {images/4469d69e709b11ed.png}
\end{center}
\[ G(\bf{x}; \bf{x};) = -\frac{1}{4\pi \sqrt{(x -
x')^2 + (y - y')^2 + (z - z')^2}} + \frac{1}{4\pi
\sqrt{(x - x')^2 + (y - y')^2 + (z - z')^2}} \]
$= 0$ if $z = 0$, i.e. satisfies the Dirichlet BCs
on all $\partial \mathcal{D}$. Contribution from
the Boundary
\begin{align*}
    \left. \pfrac{G}{n} \right|_{z = 0}
    &= \left. -\pfrac{G}{z} \right|_{z = 0} \\
    &= \left. -\frac{1}{4\pi} \left( \frac{z -
    z'}{|\bf{x} - \bf{x}'|^3} - \frac{z +
    z'}{|\bf{x} - \bf{x}''|^3} \right) \right|_{z
    = 0} \\
    &= \frac{z'}{2\pi} ((x - x')^2 + (y - y')^2 +
    z'^2)^{-3/2} \tag{10.22}
\end{align*}
Solution is then from (10.20) (no sources)
\[ \phi(x', y', z') = \frac{z'}{2\pi}
\int_{-\infty}^\infty \int_{-\infty}^\infty ((x -
x')^2 + (y - y')^2 + z'^2)^{-3/2} h(x, y) \dd x
\dd y \tag{10.23} \]

\subsubsection*{Wave equation for $x > 0$}

\[ \pfrac[2]{\phi}{t} - c^2 \pfrac[2]{\phi}{n} =
f(x, t) \]
BCs $\phi(0, t) = 0$ Dirichlet BCs. Create
matching Green's function from (10.11) with
opposite sign centred at $x = -\xi$
\[ G(x, t; \xi, \tau) = \frac{1}{2c} H(c(t - \tau)
- |x - \xi|) - \frac{1}{2c} H(c(t - \tau) - |x +
\xi|) \]
Similarly, for a homogeneous Neumann BC at $x = 0$
$\left. \pfrac{G}{n} \right||_{x = 0} = 0$ for all
$t$ the appropriate Green's function is
\[ G(x, t; \xi, \tau) = \frac{H(c(t - \tau) - |x -
\xi|)}{2c} + \frac{H(c(t - \tau) - |x + \xi|)}{2c} \]

\begin{note*}
    Image has the \emph{same} sign.
\end{note*}

\noindent
For small $x >
0$, $| - \xi| = \xi - x$, $|x + \xi| = x +
\xi$. For all $t$
\[ \left. \pfrac{G}{n} \right|_{x = 0} =
\frac{1}{2c} (\delta(c(t - \tau) - |x - \xi|)
+ \delta(c(t - \tau) - |x + \xi|)(-1))_{x = 0} = 0 \]
