% vim: tw=50
% 19/10/2022 10AM

\myskip
Take $\lambda = l(l + 1)$ with $l$ integer, then
one or other series terminates, i.e. $c_n = 0$ for
all $n \ge l + 2$. These \emph{Legendre
polynomials} $P_l(x)$ are coefficients of (2.21)
on $-1 \le x \le 1$ with normalisation convention
$P_l(1) = 1$.

\begin{note*}
    $P_l(x)$ has $l$ zeros and $P_l(x)$ is odd if
    $l$ is odd, and if $l$ is even then $P_l(x)$
    is even.
\end{note*}

\noindent
Orthogonality:
\[ \int_{-1}^1 P_n P_m \dd x = 0 \quad \forall m
\neq n \]
Normalization:
\begin{flashcard}[legendre-normalization]
\prompt{If $P_n$ is Legendre polynomial, then}
\[ \int_{-1}^1 P_n^2 \dd x = \cloze{\frac{2}{2n +
1}}
\tag{2.24} \]
\end{flashcard}
\begin{hiddenflashcard}[legendre-polynomials]
\prompt{First few Legendre polynomials?}
\begin{align*}
    P_0(x)
    &= \cloze{1} \\
    P_1(x)
    &= \cloze{x} \\
    P_2(x)
    &= \cloze{\half(3x^2 - 1)} \\
    P_3(x)
    &= \cloze{\half(5x^3 - 3x)}
\end{align*}
\end{hiddenflashcard}
Prove with Rodriques formula:
\[ P_n(x) = \frac{1}{2^n x!} \left( \dfrac{}{x}
\right)^n (x^2 - 1)^n \]
(Example sheet 2, Q5) \\
Generating function (see later):
\begin{align*}
    \sum_{n = 0}^\infty P_n(x) t^n
    &= \frac{1}{\sqrt{1 - 2xt + t^2}} \tag{2.23a}
    \\
    &= 1 + \half(2xt - t^2) + \frac{3}{8} (2xt -
    t^2)^2 + \cdots \\
    &= \ub{1}_{P_0} + \ub{x}_{P_1}t + \ub{\half
    (3x^2 - 1)}_{P_2} t^2 + \cdots
\end{align*}
Exercise: Verify $P_3$ and find $P_4$. (binomial
expansion). \\
Recursion relations:
\begin{flashcard}[Legendre-recursion]
\prompt{Recursion relation for Legendre polynomials?}
\[ \cloze{(l + 1)P_{l + 1}(x)} =
\cloze{(2l + 1)xP_l(x) - lP_{l -
1}(x)} \]
\end{flashcard}
\[ (2l + 1) P_l(x) = \dfrac{}{x} (P_{l + 1}(x) -
P_{l - 1}(x)) \]
Eigenfunction expansions: Any function $f(x)$ on
$-1 \le x \le 1$ can be expressed as
\[ f(x) = \sum_{l = 0}^\infty a_l P_l(x)
\tag{2.25} \]
where
\[ a_l = \frac{2l + 1}{2} \int_{-1}^1 f(x) P_l(x)
\dd x \tag{2.26} \]
Exercise: verify $f(x) = \frac{15}{2} x^2 -
\frac{3}{2} = P_0(x) + 5P_2(x)$ using (2.26).

\subsection{Sturm Liouville theory and
inhomogeneous ODEs}

Consider the inhomogeneous (with homogeneous
boundary conditions) on $a \le x \le b$:
\[ \mathcal{L} y = f(x) \equiv \omega(x)F(x)
\tag{2.27} \]
Given eigenfunctions $y_n(x)$ satisfying
\[ \mathcal{L} y_n = \lambda_n \omega y_n \]
\[ y(x) = \sum_n c_n y_n(x) \]
\[ F(x) = \sum_n a_n y_n(x) \]
where $a_n$ are known and $c_n$ are unknown. We
use
\[ a_n = \frac{\int_a^b \omega F y_n \dd
x}{\int_a^b \omega y_n^2 \dd x} \]
Substituting into (2.27):
\[ \mathcal{L} y = \mathcal{L} \sum_n c_n y_n =
\sum_n c_n \lambda_n \omega y_n = \omega \sum_n
a_n y_n \]
By orthogonality (2.13), $c_n \lambda_n = a_n$ or
$c_n = \frac{a_n}{\lambda_n}$ so solution is
\[ \boxed{ y(x) = \sum_{n = 1}^\infty
\frac{a_n}{\lambda_n} y_n(x)} \tag{2.28} \]
(assuming $\lambda_n \neq 0$ for all $n$). Recall
Fourier series (1.22) \\
Generalisation: driving forces often induce a
linear response term $\tilde{\lambda} \omega y$.
\[ \mathcal{L} \tilde{\lambda} \omega y = f(x)
\tag{2.29} \]
where $\tilde{\lambda}$ is fixed. The solution
(2.28) becomes
\[ y(x) = \sum_{n = 1}^\infty \frac{a_n}{\lambda_n
- \tilde{\lambda}} y_n(x) \tag{2.30} \]
(again $\tilde{\lambda} \neq \lambda_n$ for all
$n$).

\subsubsection*{Integral solution and Green's
function}

Recall (2.28)
\begin{align*}
    y(x)
    &= \sum_{n = 1}^\infty
    \frac{a_n}{\lambda_n} y_n(x) \\
    &= \sum_n
    \frac{y_n(x)}{\lambda_n \mathcal{N}} \int_a^b
    \omega(\xi) F(\xi) y_n(\xi) \dd \xi \\
    &= \int_a^b \ub{\sum_{n = 1}^\infty \frac{y_n(x)
    y_n(\xi)}{\lambda_n \mathcal{N}_n}}_{G(x,
    \xi)} \ub{\omega(\xi)
    F(\xi)}_{f(\xi)} \dd \xi \\
    &\equiv \int_a^b G(x, \xi) f(\xi) \dd \xi
    \tag{2.31}
\end{align*}
where
\[ G(x, \xi) = \sum_{n = 1}^\infty \frac{y_n(x)
y_n(\xi)}{\lambda_n \mathcal{N}_n} \]
is eigenfunction expansion of the Green's
function. \\
\begin{hiddenflashcard}
    Green's function?
    \[ \cloze{G(x, \xi) = \sum_{n = 1}^\infty
    \frac{y_n(x) y_n(\xi)}{\lambda_n \mathcal{N}_n}} \]
\end{hiddenflashcard}
$G(x, \xi)$ depends only on $\mathcal{L}$ and
boundary conditions and \emph{not} forcing term
$f(x)$ - it acts like an inverse operator
\[ \mathcal{L}^{-1} \equiv \int \dd \xi G(x, \xi) \]
(recall matrix $A \bf{x} = \bf{b} \implies \bf{x}
= A^{-1} \bf{b}$)

\newpage
\mychapter{PDEs on Bounded Domains}

\newpage
\section{The Wave Equation}

\subsection{Waves on an elastic string}

Consider small displacements on a stretched string
with fixed ends at $x = 0$ and $x = L$, with
boundary conditions
\[ \boxed{y(0, t) = y(L, t) = 0} \tag{3.1} \]
and initial conditions
\[ \boxed{y(x, 0) = p(x) \text{ and }
\pfrac{y}{t}(x, 0) = q(x)} \tag{3.2} \]
Derive equation of motion: Balance forces on
segment $(x, x + \delta x)$ and take $\delta x \to
0$.
\begin{center}
    \includegraphics[width=0.6\linewidth]
    {images/d75cd7284f9211ed.png}
\end{center}
Assume $\left| \pfrac{y}{x} \right| \ll 1$ for all
$x$, so $\theta_1, \theta_2$ are small.
\begin{itemize}
    \item Resolve in $x$ direction:
        \[ T_1 \cos\theta_1 = T_2 \cos\theta_2 \]
        but $\cos\theta = 1 - \half \theta^2 +
        \cdots$ so $T_1 \approx T_2 = T$. Hence,
        tension $T$ is constant independent of $x$
        up to $\theta\left( \left| \pfrac{y}{x}
        \right|^2 \right)$
    \item Resolve in $y$ direction
        \begin{align*}
            F_T
            &= T_2 \sin \theta_2 - T_2
            \sin\theta_1 \\
            &\approx T \left( \left. \pfrac{y}{x}
            \right|_{x + \delta x} - \left.
            \pfrac{y}{x} \right|_x \right) \\
            &= T \pfrac[2]{y}{x} \delta x
        \end{align*}
        Thus
        \begin{align*}
            F
            &= ma \\
            &= (\mu \delta x) \pfrac[2]{y}{t} \\
            &= F_T + F_g \\
            &= T \pfrac[2]{y}{x} \delta x - g\mu
            \delta x
        \end{align*}
        where $\mu$ is the mass per unit length
        (linear mass density). Define the wave
        speed $c = \sqrt{\frac{T}{\mu}}$
        (constant) and we find
        \[ \pfrac[2]{y}{t} = \frac{T}{\mu}
        \pfrac[2]{y}{x} - g = c^2 \pfrac[2]{y}{x}
        - g \tag{3.3} \]
        Assume gravity is negligible then we have
        the 1 dimensional wave equation ($\ddot{y}
        = c^2 y''$):
        \begin{flashcard}[1-dimensional-wave-eq]
        \prompt{1 dimensional wave equation?}
        \[ \cloze{\boxed{\frac{1}{c^2} \pfrac[2]{y}{t} =
        \pfrac[2]{y}{x}} \tag{3.4}} \]
        \prompt{where $c =
        \cloze{\sqrt{\frac{T}{\mu}}}$.}
        \end{flashcard}
\end{itemize}

\subsection{Separation of variables}

We wish to solve wave equation (3.4) subject to
boundary conditions (3.1) and initial conditions
(3.2). \\
Consider possible solution of \emph{separable
form} (ansatz):
\[ y(x, t) = X(x) T(t) \tag{3.5} \]
Substitute in (3.4) $\frac{1}{c^2} \ddot{y} =
y''$.
\[ \frac{1}{c^2} X \ddot{T} = X'' T \]
\[ \implies \frac{1}{c^2} \frac{\ddot{T}}{T} =
\frac{X''}{X} .\]
