% vim: tw=50
% 04/02/2022 10AM

\begin{note*}
    As $R \to \infty$, we integrate over the whole
    of $x, y \ge 0$ quadrant. In cartesian
    coordinates, we have
    \begin{align*}
        \int_0^\infty \dd x \int_0^\infty \dd y
        e^{-(x^2 + y^2)/2} \\
        &= \left( \int_0^\infty \dd x e^{-x^2/2}
        \right) \left( \int_0^\infty \dd y
        e^{-x^2/2} \right) \\
        &= \left( \int_0^\infty \dd x e^{-x^2/2}
        \right)^2 \\
        &= \frac{\pi}{2} \\
        \implies \int_0^\infty \dd x e^{-x^2/2}
        &= \sqrt{\frac{\pi}{2}}
    \end{align*}
\end{note*}

\subsubsection*{Volume Integrals}

We now generalise to integrals over a region $V
\subset \RR^3$. We have
\[ \int_V \phi(\bf{x}) \dd V = \lim_{\delta V \to
0} \sum_n \phi(\bf{x}_n) \delta V \]
We again perform the integral one coordinate at a
time. Again, the order doesn't matter.
\begin{center}
    \includegraphics[width=0.6\linewidth]
    {images/4cf96d6e8a2411ec.png}
\end{center}
\[ \int_V \phi \dd V = \int_D \dd A \int_{z_1(x,
y)}^{x_2(x, y)} \dd z \phi(x, y, z) \]
or
\begin{center}
    \includegraphics[width=0.6\linewidth]
    {images/8b0379608a2411ec.png}
\end{center}
\[ \int_V \phi \dd V = \int \dd z \int_{D(z)} \dd
x \dd y \phi(x, y, z) \]
Under an invertible, smooth change of coordinates
\[ (x, y, z) \mapsto (u, v, w) \]
we have
\[ \dd V = |J| \dd u \dd v \dd w \]
with
\[ J = \pfrac{(x, y, z)}{(u, v, w)} = \left|
\begin{matrix}
    \pfrac{x}{u} & \pfrac{x}{v} & \pfrac{x}{w} \\
    \pfrac{y}{u} & \pfrac{y}{v} & \pfrac{y}{w} \\
    \pfrac{z}{u} & \pfrac{z}{v} & \pfrac{z}{w}
\end{matrix}
\right| \]
The proof is similar to before. For example,
\emph{spherical polar coordinates} are
\begin{align*}
    x
    &= r \sin\theta \cos\phi \\
    y
    &= r \sin\theta \sin\phi \\
    z
    &= r \cos\theta
\end{align*}
\begin{center}
    \includegraphics[width=0.6\linewidth]
    {images/00e800388a2511ec.png}
\end{center}
with $r \ge 0$, $\theta \in [0, \pi]$ and $\phi
\in [0, 2\pi)$. We find $J = r^2\sin\theta$
\[ \implies \dd V = r^2 \sin\theta \dd r \dd
\theta \dd \phi \]
\emph{Cylindrical polar coordinates} are
\begin{align*}
    x
    &= \rho \cos\phi \\
    y
    &= \rho \sin\phi \\
    z
    &= z
\end{align*}
\begin{center}
    \includegraphics[width=0.6\linewidth]
    {images/55d550328a2511ec.png}
\end{center}
with $\rho \ge 0$ and $\phi \in [0, 2\pi)$. Now $J
= \rho$ and
\[ \dd V = \rho \dd \rho \dd \phi \dd z .\]

\subsubsection*{Examples}

\begin{enumerate}[(1)]
    \item A spherically symmetric function $f(r)$
        integrated over a ball of radius $R$
        \begin{align*}
            \int_V f \dd V
            &= \int_0^R \dd r \int_0^\pi \dd
            \theta \int_0^{2\pi} \dd \phi \ub{r^2 \sin
            \theta}_{J} f(r) \\
            &= 2\pi [-\cos\theta]_0^\pi \int_0^R
            \dd r r^2 f(r) \\
            &= 4\pi \int_0^R \dd r r^2 f(r)
        \end{align*}
        If $f = 1 \implies V = \frac{4\pi R^3}{3}
        = \text{volume of the ball}$.
    \item What is the volume of a ball of radius
        $R$ with cylinder of radius $s < R$
        removed from the middle?
        .image
        In cylindrical polars, $V$ is $s \le \rho
        \le R$ and $-\sqrt{R^2 - \rho^2} \le z \le
        \sqrt{R^2 - \rho^2}$ and $0 \le \phi >
        2\pi$. So
        \begin{align*}
            \text{Vol}
            &= \int_V \dd V \\
            &= \int_0^{2\pi} \dd \phi \int_s^R \dd
            \rho \rho \int_{-\sqrt{R^2 -
            \rho^2}}^{+\sqrt{R^2 - \rho^2}} \dd
            z \\
            &= 2\pi \int_s^R \dd \rho 2\rho
            \sqrt{R^2 - \rho^2} \\
            &= \frac{4\pi}{3} (R^2 - s^2)^{3/2}
        \end{align*}
    \item A hemisphere $H$ of radius $R$ and $z
        \ge 0$ has charge density $f(z) = f_0
        \frac{z}{r}$ with $f_0 = \text{constant}$.
        What is the total charge?
        \begin{center}
            \includegraphics[width=0.6\linewidth]
            {images/3c5c07768a2611ec.png}
        \end{center}
        Use spherical polars.
        \[ r \le R \]
        \[ 0 \le \phi \le 2\pi \]
        \[ 0 \le \theta \le \frac{\pi}{2} \]
        \begin{align*}
            \implies \int_H f \dd V
            &= \frac{f_0}{r} \int_0^{2\pi} \dd
            \phi \int_0^{\pi/2} \dd \theta
            \int_0^R \dd r \ub{r^2 \sin\theta}_{J}
            \ub{r \cos\theta}_{z} \\
            &= \frac{2\pi f_0}{R} \left[
            \frac{r^4}{4} \right]_0^R \left[ \half
            \sin^2 \theta \right]_0^{\pi/2} \\
            &= \frac{1}{4} \pi R^3 f_0
        \end{align*}
    \item To compute the centre of mass of an
        object, we need vector valued integrals.
        Let $\rho(\bf{x})$ be the density
        \[ \implies \text{mass } M = \int_V
        \rho(\bf{x}) \dd V \]
        and \emph{center of mass} is
        \[ \bf{X} = \frac{1}{M} \int_V \rho
        (\bf{x}) \bf{x} \dd V \]
        For example for the solid hemisphere of
        constant density $\rho$
        \[ M = \int_H \rho \dd V = \frac{2\pi}{3}
        \rho R^3 \]
        and $\bf{X} = (X, Y, Z)$.
        \[ X = \frac{\rho}{M} \int_0^{2\pi} \dd
        \phi \int_0^R \dd r \int_0^{\pi/2} \dd
        \theta x \ub{r^2 \sin\theta}_{J} = 0 \]
        Similarly $Y = 0$.
        \[ Z = \frac{\rho}{M} \int_0^{2\pi} \dd
        \phi \int_0^R \dd r \int_0^{\pi/2} \dd
        \theta z r^2 \sin\theta = \frac{3R}{8} \]
\end{enumerate}
