\section{Fiber bundles, fibrations, cofibrations}
Having set up the requisite technical background,
we can finally launch ourselves from point-set topology to the world of homotopy theory.
\subsection{Fiber bundles}
\begin{definition}\label{fiberbundle}
    A fiber\footnote{Or ``fibre'', if you're British.} bundle is a map $p:E\to B$,
    such that for every $b\in B$, there exists:
    \begin{itemize}
	\item an open subset $U\subseteq B$ that contains $b$, and
	\item a map $p^{-1}(U)\to p^{-1}(b)$ such that $p^{-1}(U)\to U\times p^{-1}(b)$ is a homeomorphism.
    \end{itemize}
    If $p:E\to B$ is a fiber bundle, $E$ is called the \emph{total space}, $B$ is called the
    \emph{base space}, $p$ is called a \emph{projection},
    and $F$ (sometimes denoted $p^{-1}(b)$) is called the \emph{fiber over $b$}.
\end{definition}
In simpler terms: the preimage over every point in $B$ looks like a product,
i.e., the map $p:E\to B$ is ``locally trivial'' in the base.

Here is an equivalent way of stating Definition \ref{fiberbundle}:
there is an open cover $\cU$ (called the \emph{trivializing cover}) of $B$,
such that for every $U\subseteq \cU$,
there is a space $F$, and a homeomorphism
$p^{-1}(U)\simeq U\times F$ that is compatible with the projections down to $U$.
(So, for instance, a trivial example of a fiber bundle is just the projection map $B\times F\xar{\mathrm{pr}_1} B$.)

Fiber bundles are naturally occurring objects.
For instance, a covering space $E\to B$ is a fiber bundle with discrete fibers.
\begin{example}[The Hopf fibration]
    The Hopf fibration is an extremely important example of a fiber bundle.
    Let $S^3\subset \cC^2$ be the $3$-sphere.
    There is a map $S^3\to \CP^1 \simeq S^2$ that is given by sending a vector $v$ to the
    complex line through $v$ and the origin.
    This is a non-nullhomotopic map, and is a fiber bundle whose fiber is $S^1$.

    Here is another way of thinking of the Hopf fibration.
    Recall that $S^3 = SU(2)$; this contains as a subgroup
    the collection of matrices $\begin{pmatrix}\lambda & \\ & \lambda^{-1}\end{pmatrix}$.
	This subgroup is simply $S^1$, which acts on $S^3$ by translation;
	the orbit space is $S^2$.
\end{example}
The Hopf fibration is a map between smooth manifolds.
A theorem of Ehresmann's says that it is not too hard to construct fiber bundles over smooth manifolds:
\begin{theorem}[Ehresmann]
    Suppose $E$ and $B$ are smooth manifolds, and let $p:E\to B$ be a smooth (i.e., $C^\infty$) map.
    Then $p$ is a fiber bundle if:
    \begin{enumerate}
	\item $p$ is a \emph{submersion}, i.e., $dp:T_e E\to T_{p(e)} B$ is a surjection, and
	\item $p$ is \emph{proper}, i.e., preimages of compact sets are compact.
    \end{enumerate}
\end{theorem}
%For example, I can look at the complement of a closed set in $S^3$, and then the restriction of $p$ won't be a fiber again.
The purpose of this part of the book is to understand fiber bundles through algebraic methods like cohomology and homotopy.
This means that we will usually need a ``niceness'' condition on the fiber bundles that we will be studying;
this condition is made precise in the following definition (see \cite{MayConcise}).
\begin{definition}\label{numerable}
    Let $X$ be a space.
    An open cover $\cU$ of $X$ is said to be \emph{numerable}
    if there exists a subordinate partition of unity, i.e.,
    for each $U\in\cU$, there is a function $f_U:X\to [0,1]=I$
    such that $f^{-1}((0,1]) = U$,
    and any $x\in X$ belongs to only finitely many $U\in\cU$.
    The space $X$ is said to be \emph{paracompact} if any open cover admits a numerable refinement.
\end{definition}
This isn't too restrictive for us algebraic topologists since CW-complexes are paracompact.
\begin{definition}
    A fiber bundle is said to be \emph{numerable} if it admits a numerable trivializing cover.
\end{definition}

\subsection{Fibrations and path liftings}
For our purposes, though, fiber bundles are still too narrow.
Fibrations capture the essence of fiber bundles, although it is not at all immediate from their definition that this is the case!
\begin{definition}\label{fibration}
    A map $p:E\to B$ is called a \emph{(Hurewicz\footnote{Named after Witold Hurewicz, who was one of the first algebraic
    topologists at MIT.}) fibration} if it satisfies the
    \emph{homotopy lifting property} (commonly abbreviated as HLP):
    suppose $h:I\times W\to B$ is a homotopy; then there exists a lift\footnote{Note that we place no restriction on the
    \emph{uniqueness} of this lift.}
    (given by the dotted arrow) that makes the diagram commute:
    \begin{equation}\label{hlp}
	\xymatrix{
	    W\ar[r]^f\ar[d]_{\mathrm{in}_0} & E\ar[d]^p\\
	    I\times W\ar[r]_h\ar@{-->}[ur]^{\overline{h}} & B,
	    }
    \end{equation}
\end{definition}
At first sight, this seems like an extremely alarming definition, since
the HLP has to be checked for \emph{all} spaces, \emph{all} maps, and \emph{all} homotopies!
The HLP is not impossible to check, though.

\begin{exercise}\label{productfibration}
    Check that the projection $\mathrm{pr}_1: B\times F\to B$ is a fibration.
\end{exercise}

\begin{exercise}
    Check the following statements.
    \begin{itemize}
	\item Fibrations are closed under pullbacks. In other words, if $p:E\to B$ is a fibration and $X\to B$ is any map, then the induced map $E\times_B X\to X$ is a fibration.
	\item Fibrations are closed under exponentiation and products. In other words, if $p:E\to B$ is a fibration, then $E^A\to B^A$ is another fibration.
	\item Fibrations are closed under composition.
    \end{itemize}
\end{exercise}

\begin{exercise}
    Let $p:E_0 \to B_0$ be a fibration, and let $f:B \to B_0$ be a homotopy equivalence.
    Prove that the induced map $B\times_{B_0} E_0 \to E_0$ is a homotopy equivalence.
    (Warning: this exercise has a lot of technical details! The end of this chapter describes an
    alternative\footnote{``Alternative'' in the sense that the proof uses statements
    not covered yet in this book.}
    solution to this exercise, when $E_0$ and $B\times_{B_0} E_0$ are CW-complexes.)
    \todo{Don't forget to do this!}
\end{exercise}

There is a simple geometric interpretation of what it means for a map to be a fibration, in terms of ``path liftings''.
To understand this description, we will reformulate the diagram \eqref{hlp}.
Given that we are working in the category of CGWH spaces, one of the first things we can attempt to do is adjoint the $I$;
this gives the following diagram.
\begin{equation}\label{hlp2}
    \xymatrix{
	E\ar[r]^p & B\\
	W\ar[u]^f\ar[r]_{\widehat{h}} & B^I\ar[u]_{\mathrm{ev}_0}
    }
\end{equation}
By the definition of the pullback of a diagram, the data of this diagram is equivalent to a map $W\to B^I\times_B E$.
Explicitly,
$$B^I\times_B E = \{(\omega, e) \in B^I\times E \text{ such that } \omega(0) = p(e)\}.$$

Suppose the desired dotted map exists (i.e., $p:E\to B$ satisfied the HLP).
This would beget (again, by adjointness) a lifted homotopy $\widehat{\overline{h}}:W\to E^I$.
Since we already have a map\footnote{Clearly $(p\omega)(0) = p(\omega(0))$, so this map is well-defined
(i.e., the image lands in $B^I\times_B E$).} $\widetilde{p}:E^I\to B^I\times_B E$ given by $\omega\mapsto (p\omega,\omega(0))$,
the existence of the lift $\overline{h}$ in the diagram \eqref{hlp} is equivalent to the existence of a lift in
the following diagram.
\begin{equation*}
    \xymatrix{
	& E^I\ar[d]^{\widetilde{p}}\\
	W\ar[r]\ar@{-->}[ur]^{\widehat{\overline{h}}} & B^I\times_B E
    }
\end{equation*}
Obviously the universal example of a space $W$ that makes the diagram \eqref{hlp2} commute is $B^I\times_B E$ itself.
If $p$ is a fibration, we can make the lift in the following diagram.
%and if I can lift for any $W$, I can obviously construct the lift in the following diagram:
%idk why the above line was typed in
\begin{equation*}
    \xymatrix{
	& E^I\ar[d]^{\widetilde{p}}\\
	B^I\times_B E\ar@{-->}[ur]^\lambda\ar[r]^1 & B^I\times_B E
    }
\end{equation*}
The map $\lambda$ is called a \emph{lifting function}.
To understand why, suppose $(\omega, e) \in B^I\times_B E$, so that $\omega(0) = p(e)$.
In this case, $\lambda(\omega,e)$ defines a path in $E$ such that
$$p\circ\lambda(\omega, e) = \omega,\text{ and }\lambda(\omega,e)(0) = e.$$
Taking a step back and assessing the situation, we find that the lifting function $\lambda$ starts with a path
$\omega$ in $B$, and some point in $E$ mapping down to $\omega(0)$,
and produces a ``lifted'' path in $E$ which lives over $\omega$.
In other words, the map $\lambda$ is a path lifting: it's a continuous way to lift paths in the base space $B$ to
the total space $E$.

The following result is a ``consistency check''.
\begin{theorem}[Dold]
    Let $p:E\to B$ be a map. Assume there's a numerable cover of $B$, say $\cU$, such that for every $U\in\cU$,
    the restriction $p|_{p^{-1}(U)}:p^{-1}U\to U$ is a fibration.
    (In other words, $p$ is \emph{locally} a fibration over the base).
    Then $p$ itself is a fibration.
\end{theorem}
In particular, one consequence of this theorem is that every numerable fiber bundle is a fibration.
Our discussion above tells us that numerable fiber bundles satisfy the homotopy (and hence path) lifting property.
This is great news, as we will see shortly.


\subsection{Filtering Component}
\index{filtering component}
\label{sec:filtering-component}
As filtering component $k$ nearest neighbours ($k$NN) has been implemented.
One of its advantages is, that it does not require any training or whatsoever.\citep[p.~290]{manning:2009}
$k$NN will return a list of the $k$ closest vectors around a given centroid.
Therefore $k$ can be interpreted as a parameter.
When the value for $k$ is already determined (for instance $k=3$), then one can also speak of 3NN.\citep[p.~297-298]{manning:2009}
To measure distance between two vectors the algorithm relies on the Euclidean distance, as it has been suggested by \citeauthor{manning:2009}.\citep[p.~292]{manning:2009}
For comparison other ways for calculating the distance have also been implemented - namely the Hamming distance.
There is a brief evaluation of both algorithms in section~\ref{sec:hamming-vs-euclidean}.
When using kNN it is recommended to choose a value $k > 1$, since otherwise it is deemed as not robust.
It's also better to choose an odd value for $k$.

An implementation of $k$NN with exchangeable distance function is displayed in listing~\ref{lst:knn}.

\begin{lstlisting}[language=Python,caption={$k$NN and distance methods},label={lst:knn},float=h]
def hamming_distance(v1, v2):
    return v1.hamming_distance(v2)

def euclidean_distance(v1, v2):
    return v1.euclidean_distance(v2)

default_distance = euclidean_distance

def k_nearest_neighbours(k, vector_origin, vectors, distance_function=default_distance):
    distances = [(distance_function(vector_origin, v), v) for v in vectors]
    ratings = distances
    ratings.sort()  # sorts ascending by distance, then by DocumentVector
    return [(r, v) for (r, v) in ratings[:k] ]

class DocumentVector(object):

    # ... omitted uneccesary code

    def hamming_distance(self, other):
        d = len([ 1 for (v, o) in zip(self.values, other.values) if v != o ])
        return d

    def euclidean_distance(self, other):
        t = sum(
            ((v - o) ** 2  for v, o in zip(self.values, other.values))
        )
        d = math.sqrt(t)
        return d
\end{lstlisting}

The \textit{k\_nearest\_neighbours} function awaits an integer \textit{k} as first parameter, specifying the size of the list to return.
As second parameter the function receives a vector which suits as centroid for calculating the distances called \textit{vector\_origin}.
\textit{vectors} are all vectors whose distance shall be measured.
As an optional argument \textit{k\_nearest\_neighbours} awaits a function for calculating the distance.
Per default, the function is \textit{euclidean\_distance} which calculates the euclidean distance between two vectors.

When using this $k$NN with the euclidean distance function on the data of the example, the results will look as in the table~\ref{tab:knn-result}.
As parameter $k$ 2 has been chosen.

\begin{table}[h]
    \center
    \rowcolors{1}{\dustRowFirst}{\dustRowSecond}
    \begin{tabular}{ l | l | l }
        \rowcolor{\dustRowHead}
        rank    & distance              & document\_id\\\hline
        1       & 0.43305340317332686   & 1\\
        2       & 0.45553841769931985   & 2\\
        %3       & 0.8801677396951105    & 3\\
    \end{tabular}
    \caption{Possible $k$NN result for $k=2$ based on the example in section~\ref{sec:rocchio-impl}}
    \label{tab:knn-result}
\end{table}


\documentclass[a4paper,10pt]{article}
\usepackage{mystyle}

\begin{document}

\section{Vector Calculus}

\begin{thm}[Cosine Theorem]
	Given a triangle with vertices $A,B,C$ and respective opposing edges
	$a,b,c$, and edge $b$ along the $x$-axis:
	\[ a^2 = b^2 + c^2 - 2bc\cos\theta \]
\end{thm}

\begin{proof}
	\[
		a = |\vec{BC}| = |-\vec{AC} + \vec{AB}|
		= \left|\begin{pmatrix}-b\\0\end{pmatrix} +
			c\begin{pmatrix}\cos\theta\\\sin\theta\end{pmatrix}\right|
	\]
	\[
		\tf a^2 = {(c\cos\theta - b)}^2 + c^2\sin^2\theta
		= b^2 + c^2 - 2bc\cos\theta
	\]
\end{proof}

A plane is described by a point and two linearly independent vectors i.e.
\[\mathbf{r}(\lambda, \mu) = \mathbf{a} + \lambda \mathbf{u} + \mu \mathbf{v}\]

A plane can also be expressed in Cartesian form i.e.
\[ax + by + cz = d\]

\begin{ex}
	\[
		\mathbf{r} =
		\begin{pmatrix}
			1\\2\\3
		\end{pmatrix}
		+ \lambda
		\begin{pmatrix}
			1\\1\\1
		\end{pmatrix}
		+ \mu
		\begin{pmatrix}
			2\\1\\0
		\end{pmatrix}
		\, \lambda, \mu \in \RR
	\]
	\[ x = 1 + \lambda + 2\mu \]
	\[ y = 2 + \lambda + \mu \]
	\[ z = 3 + \lambda \]

	\[ \tf \lambda = z - 3, \mu = y - z + 1 \]
	\[ \tf x = 2y - z \tf x - 2y + z = 0 \]
\end{ex}

\begin{ex}[Alternative approach]
	Given a plane $P$ and two points on the plane described from the origin
	as $\mathbf{r}$ and $\mathbf{a}$, if $\mathbf{n}$ is normal to $P$ we
	have:
	\[ (\mathbf{r} - \mathbf{a}) \cdot \mathbf{n} = 0 \]
	\[ \tf \mathbf{r} \cdot \mathbf{n} = \mathbf{a} \cdot \mathbf{n} \]

	We can calculate the normal vector using the cross product:
	\[
		\begin{pmatrix}
			1\\1\\1
		\end{pmatrix}
		\wedge
		\begin{pmatrix}
			2\\1\\0
		\end{pmatrix}
		=
		\begin{pmatrix}
			-1\\2\\-1
		\end{pmatrix}
	\]
	\[ \tf -x + 2y - z = -1 + 4 - 3 \tf x - 2y + z = 0 \]
\end{ex}

% TODO: Put this in curves and surfaces?
If $r(t)$ is a parameterisation of a curve, then its length can be calculated
as $ \int_a^b | r'(t) | dt $.

For a surface $z = f(x,y)$, $\mathbf{r} = x\mathbf{i} + y\mathbf{j} +
f(x,y)\mathbf{k}$. This doesn't work for closed surfaces.

\subsection{Partial Differentiation}

We can find the slope on a surface in different directions by fixing one value.
For example if $z = xy$ and we fix $y$, then $\frac{\partial z}{\partial x} =
y$. We can fix $x$ to obtain a similar result.

\begin{ex}
	\[ f(x,y) = e^{x^2y} \]
	\[ \frac{\partial f}{\partial x} = 2xy e^{x^2y} \]
	\[ \frac{\partial f}{\partial y} = x^2 e^{x^2y} \]
\end{ex}

\begin{ex}
	\[ f(x,y) = x^2 - xy + y^2 \]
	\[ \frac{\partial f}{\partial x} = 2x - y \]
	\[ \frac{\partial ^2 f}{\partial y \partial x} = -1 \]
\end{ex}

\begin{thm}[Chain Rule]
	\[ \frac{d}{dx} f(u(x)) = \frac{df}{du} \frac{du}{dx} \]
\end{thm}

\begin{proof}
	\[ \frac{u(x+h) - u(x)}{h} \to u'(x), h \to 0 \]
	\[ v = \frac{u(x+h) - u(x)}{h} - u'(x), v \to 0, h \to 0 \]
	\[ \implies u(x+h) = u(x) + (u'(x) + v)h \]
	\[ w = \frac{f(u+k) - f(u)}{k} - f'(u), w \to 0, k \to 0 \]
	\[ \implies f(u+k) = f(u) + (f'(u) + w)k \]
	\[ \frac{df}{dx} = \frac{f(u(x+h)) - f(u(x))}{h} \]
	\[ f(u(x+h)) - f(u(x))= f(u(x) + (u'(x)+v)h) - f(u(x))  = (f'(u(x) +
	w))(u'(x) + v), \]
	where $k = (u'(x)+v)h$, $k \to 0$ as $h \to 0$
	\[ \implies \lim_{h \to 0} \frac{f(u(x+h)) - f(u(x))}{h} =
	f'(u(x))u'(x) \]

\end{proof}

\begin{lemma}
	If $z(t) = (x(t), y(t))$ then
	\[ \frac{dz}{dt} = \frac{\partial z}{\partial x}\frac{dx}{dt} +
	\frac{\partial z}{\partial y}\frac{dy}{dt}. \]
\end{lemma}

\begin{proof}
	\[ \frac{dz}{dt} = \frac{z(x(t+h), y(t+h)) - z(x(t), y(t))}{h} \]
	\[ = \frac{z(x(t+h), y(t+h)) - z(x(t), y(t+h))}{h} + \frac{z(x(t),
	y(t+h)) - z(x(t), y(t))}{h} \]

	We now have two differences, one with $y$ fixed and the other with
	$x$ fixed. Applying the chain rule to each one, we obtain:

	\[ \frac{dz}{dt} = \frac{\partial z}{\partial x} x'(t) + \frac{\partial
	z}{\partial y} y'(t) \]
\end{proof}

\subsection{Tangents}

If $\mathbf{r}(t)$ is a point in space, then the vector tangent to it is $r(t) + \lambda
\mathbf{r}'(t)$.

\begin{ex}
	\[
		\mathbf{r}(t) =
		\begin{pmatrix}
			t^2 \\ t^3 \\ t^4
		\end{pmatrix}
		, t \in \RR
	\]
	\[
		\mathbf{r}'(t) =
		\begin{pmatrix}
			2t \\ 3t^2 \\ 4t^3
		\end{pmatrix}
	\]

	At $t=2$ we have:

	\[
		\begin{pmatrix}
			4 \\ 8 \\ 16
		\end{pmatrix}
		+ \lambda
		\begin{pmatrix}
			4 \\ 12 \\ 32
		\end{pmatrix}
		, \lambda \in \RR
	\]
\end{ex}

Similarly, a tangent plane can be described with a vector to the tangent point
and the two partial derivatives.

\[ \mathbf{p} = \mathbf{r}(x_0, y_0)
+ \lambda \frac{\partial \mathbf{r}}{\partial x}(x_0, y_0)
+ \lambda \frac{\partial \mathbf{r}}{\partial y}(x_0, y_0)
, \lambda, \mu \in \RR \]

\begin{ex}
	Find the plane tangent to $x^2 + y^2 + z^2 = 9$ at $(1,2,2)$.

	\[ \mathbf{r} = (x,y,z), z = {(9 - x^2 - y^2)}^{1/2} \]

	\[ \frac{\partial \mathbf{r}}{\partial x} = (1, 0, \partial z /
	\partial x) \]
	\[ \frac{\partial \mathbf{r}}{\partial y} = (0, 1, \partial z /
	\partial y) \]

	\[ \frac{\partial z}{\partial x} = - \frac{x}{{(9-x^2-y^2)}^{1/2}} \]
	\[ \frac{\partial z}{\partial y} = - \frac{y}{{(9-x^2-y^2)}^{1/2}} \]

	Plugging in the values $x=1$ and $y=2$ we obtain:

	\[ \mathbf{p} = (1,2,2) + \lambda (1, 0, -1/2) + \mu (0, 1, -1) \]
\end{ex}

\begin{ex}
	Find the plane tangent to $z = 1 - 1/4 x^2 - y^2$ at $(1,1/2,1/2)$.

	\[ \frac{\partial z}{\partial x} = -1/2 x \]
	\[ \frac{\partial z}{\partial y} = -2y \]

	Plugging in the values $x=1$ and $y=1/2$ we obtain:

	\[ \mathbf{p} = (1,1/2,1/2) + \lambda (1, 0, -1/2) + \mu (0, 1, -1) \]
\end{ex}

\subsection{Directional Derivatives}

Let $\mathbf{r} = \left(x_0 + tn_1, y_0 + tn_2, z(x_0 + tn_1, y_0 +
tn_2)\right)$ describe a curve in the plane, where $\mathbf{n} = (n_1, n_2)$ is
the direction vector and $t \in \RR$.

\[ \frac{d\mathbf{r}}{dt} = \left(n_1, n_2, n_1 \frac{\partial z}{\partial x}
(x_0 + tn_1, y_0 + tn_2) + n_2 \frac{\partial z}{\partial x} (x_0 + tn_1, y_0 +
tn_2)\right) \]

Given that the gradient of a curve can be expressed as $\frac{z}{\sqrt{x^2 +
y^2}}$,

\[ \frac{\frac{\partial z}{\partial x} n_1 + \frac{\partial z}{\partial y}
n_2}{\sqrt{n_1^2 + n_2^2}} \]

Hence the slope on the surface $z$ in the direction of $n$ is given by:

\[ \bigtriangledown z \mathbf{\hat{n}} \]

\begin{ex}
	\[ z(x,y) = 4 - x^2 - y^2, n = (1,1) \]
	\[ \bigtriangledown z = (-2x, -2y) = (-2, -2) \]
	\[ \mathbf{\hat{n}} = \frac{\sqrt{2}}{2} (1,1) \]
	\[ \bigtriangledown z \mathbf{\hat{n}} = \frac{-4}{\sqrt{2}}
	   = -2 \sqrt{2} \]
\end{ex}

\begin{ex}
	$f(x,y,z) = e^{xyz}$ at $(2,-1,2)$ with $n = (1,1,1)$
	\[ \bigtriangledown f = (yze^{xyz}, xze^{xyz}, xye^{xyz})
		= (-2e^{-4}, 4e^{-4}, -2^{-4}) \]
	\[ \mathbf{\hat{n}} = 1/\sqrt{3}(1,1,1) \]
	\[ \bigtriangledown f \cdot \mathbf{\hat{n}} = 1/\sqrt{3}(-2e^{-4} +
	4e^{-4} - 2e^{-4}) = 0 \]
\end{ex}

\subsubsection{Greatest Slope}

\[ \bigtriangledown z \cdot \mathbf{\hat{n}} = |\bigtriangledown
z||\mathbf{\hat{n}}|\cos \theta \]

In order to maximise this, we let $\cos \theta = 1$ and given that
$\mathbf{\hat{n}}$ is a unit vector, the greatest slope is $|\bigtriangledown
z|$. Therefore, the direction of the greatest slope is in the direction of
$\bigtriangledown z$, since $|a|^2 = a \cdot a$.

\begin{ex}
	$z(x,y) = 4 - x^2 - y^2$ at $(1,1)$
	\[ \bigtriangledown z = (-2,-2) \]
	\[ |\bigtriangledown z| = 2\sqrt{2} \]
\end{ex}

\subsection{Volume under a surface}

Let $f(x,y)$ be a surface, the volume underneath it is
\[ v = \int_a^b \int_{x_1(y)}^{x_2(y)} f(x,y) dx dy \]

\begin{ex}
	$z = x^2y^3$ above the region bound by $y=1$, $x=4$, and $y=\sqrt{x}$.

	\[ v = \int_1^4 \int_1^{\sqrt{x}} x^2y^3 dy dx \]
	\[ = 1/4 \int_1^4 \left[ x^2y^4 \right]_1^{\sqrt{x}} \]
	\[ = 1/4 \int_1^4 x^4 - x^2 dx \]
	\[ = 1/4 \left[ 1/5 x^5 - 1/3 x^3 \right]_1^4 \]
	\[ = 1024/20 - 64/12 - 1/20 + 1/12 = 45.9 \]

	This can also be calculated by integrating first with respect to $x$.

	\[ v = \int_1^2 \int_{y^2}^4 x^2y^3 dxdy \]
	\[ = 1/3 \int_1^2 \left [x^3y^3 \right]_{y^2}^4 dy \]
	\[ = 1/3 \int_1^2 64y^3 - y^9 dy \]
	\[ = 1/3 \left[ 16y^4 - 1/10 y^10 \right]_1^2 \]
	\[ = 1/3 \left( 256 - 1024/10 - 16 + 1/10 \right) = 45.9 \]

\end{ex}

\subsection{Changing Coordinates}

When changing coordinate system, we have to take into account how that affects
differentiation and integration.

Let $\mathbf{r}(x,y) = x \mathbf{i} + y \mathbf{j}$. A change of $dx$ and $dy$
would give:

\[ (x + dx)\mathbf{i} + y\mathbf{j} - (x\mathbf{i} + y\mathbf{j}) =
dx\mathbf{i} \]
\[ x\mathbf{i} + (y + dy)\mathbf{j} - (x\mathbf{i} + y\mathbf{j}) =
dy\mathbf{j} \]

The differential area can be calculated using the cross product (think about
the area of a parallelogram). Given that $dx$ and $dy$ are just scalars, and
$\mathbf{i}$ and $\mathbf{j}$ are orthogonal unit vectors:

\[ |dx\mathbf{i} \times dy\mathbf{j}| = |dxdy\mathbf{k}| = dxdy \]

Now lets see how things change when we switch to polar coordinates. Let
$\mathbf{f}(r,\theta) = r\cos\theta\mathbf{i} + r\sin\theta\mathbf{j}$.

A change by $dr$ yields:
\[ (r+dr)\cos\theta\mathbf{i} + (r+dr)\sin\theta\mathbf{j} -
r\cos\theta\mathbf{i} - r\sin\theta\mathbf{j} \]
\[ = dr(\cos\theta\mathbf{i} + \sin\theta\mathbf{j}) \]

A change by $d\theta$ yields:
\[ r\cos(\theta + d\theta)\mathbf{i} + r\sin(\theta + d\theta)\mathbf{j} -
r\cos\theta\mathbf{i} - r\sin\theta\mathbf{j} \]
\[ = r\left(\cos(\theta + d\theta) - \cos(\theta)\right)\mathbf{i}
+ r\left(\sin(\theta + d\theta) - \sin(\theta)\right)\mathbf{j} \]

Given that:
\[ \frac{d}{d\theta} \cos\theta = \frac{\cos(\theta + d\theta) -
\cos\theta}{d\theta} \]

We find that a change by $d\theta$ is simply:
\[ -r\sin(\theta)d\theta \mathbf{i} + r\cos(\theta)d\theta \mathbf{j} \]

Now we compute the full differential area:
\[ | dr(\cos\theta \mathbf{i} + \sin\theta \mathbf{j}) \wedge
d\theta(-r \sin\theta \mathbf{i} + r\cos\theta \mathbf{j}) | \]
\[ = | r\cos^2\theta + r\sin^2\theta | drd\theta = rdrd\theta \]

\begin{ex}
	\[ I = \int \int x^2 y^2 dxdy \]
	\[ = \int_0^{\pi} \int_0^1 (r^2 \cos^2\theta)(r^2 \sin^2\theta)
	rdrd\theta \]
	\[ = \int_0^{\pi} \cos^2\theta \sin^2\theta d\theta
	\int_0^1 r^5 dr \]

	Given that $\cos2\theta = \cos^2\theta - \sin^2\theta$, we have:

	\[ \sin^2\theta = \frac{1}{2} - \frac{1}{2} \cos2\theta \]
	\[ \cos^2\theta = \frac{1}{2} + \frac{1}{2} \cos2\theta \]

	Hence:

	\[
		\sin^2\theta \cos^2\theta =
		(\frac{1}{2} - \frac{1}{2} \cos2\theta)
		(\frac{1}{2} + \frac{1}{2} \cos2\theta)
	\]
	\[
		= \frac{1}{4} - \frac{1}{4} \cos^2 2\theta
	\]
	\[
		= \frac{1}{4} - \frac{1}{4}
		(\frac{1}{2} + \frac{1}{2} \cos4\theta)
	\]
	\[
		= \frac{1}{8} - \frac{1}{8} \cos4\theta
	\]
	\[
		\int_0^{\pi} \frac{1}{8} - \frac{1}{8} \cos4\theta d\theta =
		\left[ \theta + \sin4\theta \right]_0^{\pi} = \pi/8
	\]
	\[
		\int_0^1 r^5 dr = \left[ \frac{1}{6} r^6 \right]_0^1
		= \frac{1}{6}
	\]

	Therefore,

	\[ I = \pi/48. \]

\end{ex}

We can generalise this concept of coordinate transformation for a
generic function
$ \mathbf{r} (s,t) = x(s,t)\mathbf{i} + y(s,t)\mathbf{j}$.

Changing by $ds$:
\[
	\frac{d\mathbf{r}}{ds} ds =
	\left( \frac{dx}{ds}\mathbf{i} + \frac{dy}{ds}\mathbf{j} \right) ds
\]

Changing by $dt$:
\[
	\frac{d\mathbf{r}}{dt} dt =
	\left( \frac{dx}{dt}\mathbf{i} + \frac{dy}{dt}\mathbf{j} \right) dt
\]

The resultant change in area is:
\[
	| \frac{dr}{ds}ds \wedge \frac{dr}{dt}dt |
	= | \frac{dx}{ds}\frac{dy}{dt} - \frac{dx}{dt}\frac{dy}{ds} | dsdt
\]

This leads us to the following definition.

% TODO: these should be partial derivatives (and above)
\begin{defn}[Jacobian]
	Let $x = x(s,t)$, $y = y(s,t)$, then
	$J(s,t) = |\frac{dx}{ds}\frac{dy}{dt} - \frac{dx}{dt}\frac{dy}{ds}|$
	is the Jacobian.
\end{defn}

\begin{ex}[Ellipse]
	Let $x = r\cos\theta$, $y = \frac{b}{a}r\sin\theta$. Let $\Omega$ be the
	region where $0 <= \theta <= 2\pi$, $0 <= r <= a$.

	\[
		J(r,\theta) = \left| \frac{\partial x}{\partial r}
		\frac{\partial y}{\partial \theta} -
		\frac{\partial x}{\partial \theta}
		\frac{\partial y}{\partial r} \right|
	\]
	\[
		\frac{\partial x}{\partial r} = \cos\theta
		\quad
		\frac{\partial x}{\partial \theta} = -r \sin\theta
	\]
	\[
		\frac{\partial y}{\partial r} = \frac{b}{a} \sin\theta
		\quad
		\frac{\partial y}{\partial \theta} = \frac{b}{a}r \cos\theta
	\]
	\[
		\Rightarrow J(r,\theta) = \left| \frac{b}{a}r \cos^2\theta +
		\frac{b}{a}r \sin^2\theta \right| = \frac{b}{a}r
	\]
	\[
		\Rightarrow \int\int_{\Omega} dxdy =
		\int_0^{2\pi} \int_0^a \frac{b}{a}r drd\theta
	\]
	\[
		= \int_0^{2\pi} \frac{ba}{2} d\theta = ab\pi
	\]
\end{ex}

\subsection{Surface Area}

Take a parallelogram with corners:

\[
	A = \begin{pmatrix}
		x \\
		y \\
		f(x,y)
	\end{pmatrix}
	B = \begin{pmatrix}
		x+dx \\
		y \\
		f(x+dx,y)
	\end{pmatrix}
	C = \begin{pmatrix}
		x \\
		y+dy \\
		f(x,y+dy)
	\end{pmatrix}
	D = \begin{pmatrix}
		x+dx \\
		y+dy \\
		f(x+dx,y+dy)
	\end{pmatrix}
\]

We then calculate the area of this using the cross product:

\[
	\vec{AB} =
	\begin{pmatrix}
		x+dx \\
		y \\
		f(x+dx,y)
	\end{pmatrix}
	-
	\begin{pmatrix}
		x \\
		y \\
		f(x,y)
	\end{pmatrix}
	=
	dx
	\begin{pmatrix}
		1 \\
		0 \\
		\partial f / \partial x
	\end{pmatrix}
\]
\[
	\vec{AC} =
	\begin{pmatrix}
		x \\
		y+dy \\
		f(x,y+dy)
	\end{pmatrix}
	-
	\begin{pmatrix}
		x \\
		y \\
		f(x,y)
	\end{pmatrix}
	=
	dy
	\begin{pmatrix}
		0 \\
		1 \\
		\partial f / \partial y
	\end{pmatrix}
\]
\[
	\vec{AB} \wedge \vec{AC} =
	dxdy
	\begin{vmatrix}
		i & j & k \\
		1 & 0 & \partial f / \partial x \\
		0 & 1 & \partial f / \partial y
	\end{vmatrix}
	=
	dxdy
	\begin{pmatrix}
		- \partial f / \partial x \\
		- \partial f / \partial y \\
		1
	\end{pmatrix}
\]
\[
	area = dxdy
	\begin{vmatrix}
		- \partial f / \partial x \\
		- \partial f / \partial y \\
		1
	\end{vmatrix}
	=
	dxdy
	\left(
		(\partial f / \partial x)^2,
		(\partial f / \partial y)^2,
		1
	\right)^{1/2}
\]

To get the full surface area, we need to sum these parallelograms. To do
this, we use integration, similarly to calculating the length of a
curve. In fact, this is essentially a two dimensional analogue.

Generalising our derivation, by using the fact that our parallelograms
are constructed by partial derivatives, we arrive at the following
formula for surface area.

Let $r(s,t) = (x(s,t), y(s,t), z(s,t))$ where $s,t \in R$, and $R$ is the
region of surface area. The surface area is calulated by:

\[
	S = \int \int_R \left| \frac{\partial r}{\partial s} \wedge
	\frac{\partial r}{\partial t} \right| dsdt
\]

Notice from our derivation of this formula that if the surface can be
expressed as $(x,y,f(x,y))$, the surface area is much simpler:

\[
	S = \int \int_R \left|
	\left(
		(\partial f / \partial x)^2,
		(\partial f / \partial y)^2,
		1
	\right)^{1/2}
	\right|
	dxdy
\]

\begin{ex}
	Let $z=xy$ and let$R$ be the cylinder defined by $x^2 + y^2 = 1$.

	\begin{align*}
		S &= \int \int_R \left( x^2 + y^2 + 1 \right)^{1/2} dxdy \\
		&= \int_0^{2\pi} \int_0^1 r(1+r^2)^{1/2} drd\theta \\
		&= \int_0^{2\pi}
		\left[
			\frac{1}{2} \frac{2}{3} (1+r^2)^{3/2}
		\right]_0^1 d\theta \\
		&= \frac{1}{3} \int_0^{2\pi} 2^{3/2} - 1 d\theta \\
		&= \frac{1}{3} \sqrt{8} 2\pi - 2\pi \\
		&= \frac{2\pi}{3} (\sqrt{8} - 1)
	\end{align*}
\end{ex}

% TODO: move this to another file
\section{Differential Equations}

\begin{defn}[Fixed Point]
	Let $f(x) = \frac{dx}{dt}$ then $x^*$ is a fixed point if $f(x^*) = 0$.
	Furthermore, fixed points can be stable or unstable:
	\begin{align*}
		f'(x^*) &> 0 \Rightarrow unstable \\
		f'(x^*) &< 0 \Rightarrow stable \\
		f'(x^*) &= 0 \Rightarrow constant
	\end{align*}
\end{defn}

Let $x^*$ be a fixed point for $f(x) = \frac{dx}{dt}$. We can express
points around $x^*$ as $x(t) = x^* + z(t)$, where $z$ is small.

Given that $\frac{d}{dt}(x^* + z(t)) = f(x^* + z(t))$ and
$\frac{d}{dt}(x^*) = 0$, we have
\[
	\frac{dz}{dt} = f(x^* + z(t))
\]

We can expand $f(x)$ around the point $x^*$ using a Taylor series:
\[
	f(x) = f(x^*) + f'(x^*)(x - x^*) + \frac{1}{2}f''(x^*)(x - x^*)^2 + \dots \\
\]
With $x = x^* + z$ we have:
\[
	f(x^* + z) = f(x^*) + f'(x^*)z + \frac{1}{2}f''(x^*)z^2 + \dots \\
\]
$z$ is small by assumption so we ignore terms with $z^2$ and onwards, yielding:
\[
	\frac{dz}{dt} = f(x^* + z) = f(x^*) + f'(x^*)z
\]
Given that $f(x^*) = 0$, we have
\[
	\frac{dz}{dt} = f'(x^*)z
\]

We now aim to find a set of such functions $z(t)$ satisfying this equation.
\[
	\frac{dz}{dt} = \lambda z, \quad \lambda = f'(x)
\]

We look for a solution of the form $Ce^{kt}$, where $C$ is constant,
since $\frac{d}{dt} e^t = e^t$.

\begin{gather*}
	z(t) = Ce^{kt} \\
	\Rightarrow z'(t) = kCe^{kt} = \lambda z = \lambda Ce^{kt} \\
	\Rightarrow k = \lambda \\
	\Rightarrow z(t) = Ce^{\lambda t} \\
	z(0) = C \\
	\Rightarrow z(t) = z(0)e^{\lambda t}
\end{gather*}

If $\lambda < 0$, $z \to 0$ as $t \to \infty$ (stable). \\
If $\lambda > 0$, $z \to \infty$ as $t \to \infty$ (unstable). \\
If $\lambda = 0$, $z$ is constant.

\subsection{Linear First Orders}

\[
	\frac{dy}{dx} + p(x)y = q(x)
\]

We want to get the LHS in the form
\[
	y\frac{dg}{dx} + g\frac{dy}{dx} = \frac{d}{dx} gy
\]
so that we can solve with one integral.

Mutliplying through by $g(x)$ we get:
\begin{gather*}
	g(x)\frac{dy}{dx} + g(x)p(x)y = y\frac{dg}{dx} + g\frac{dy}{dx} \\
	\Rightarrow \frac{dg}{dx} = p(x)g(x) \\
	\Rightarrow \int \frac{1}{g(x)} \frac{dg}{dx} dx = \int p(x) dx \\
	\Rightarrow \ln |g(x)| = \int p(x) dx \\
	\Rightarrow g(x) = e^{\int p(x) dx}
\end{gather*}

So now we need to solve
\[
	g(x)\frac{dy}{dx} + g(x)p(x)y = g(x)q(x)
\]
which can be simplified to
\[
	\frac{d}{dx} gy = gq
\]

Substituting in $g(x)$ we have:
\[
	y = e^{\int p} \int q e^{\int p} dx
\]

\begin{ex}
	\begin{gather*}
		\frac{dy}{dx} - \frac{y}{x^2} = - \frac{1}{x^2} \\
		\Rightarrow g(x) = \exp{\int -x^{-2}} = e^{1/x} \\
		\Rightarrow \frac{d}{dx} gy = - \frac{e^{1/x}}{x^2} \\
		\Rightarrow y e^{1/x} = e^{1/x} + c
	\end{gather*}

	Using the original equation, it is easy to see that $c=0$ and $y=1$.
\end{ex}

\subsection{Linear Second Order Equations}

\begin{defn}[Homogeneous Equation]
	A differential equation is homogeneous if there are no terms
	without a derivative of $y$ (or $y$ itself), e.g.
	\[
		\frac{dy}{dx} + f(x)y = 0
	\]
\end{defn}

\begin{defn}[Eigen Function]
	An Eigen function is a function that when passed through another
	function results in multiplication, e.g.
	\[ \frac{d}{dx} e^{kx} = ke^{kx} \]
	Here $e^{kx}$ is the Eigen function that when passed through
	$\frac{d}{dx}$ results in multiplication by $k$, which is
	refered to as the Eigen value.
\end{defn}

We will use these definitions to solve linear second order O.D.Es.

\begin{ex}
	\[
		\frac{d^2y}{dx^2} + \frac{dy}{dx} - 2y = 0
	\]

	We try $y = e^{mx}$ as we are aware that it is an Eigen function
	under differentiation. Plugging in, we get:

	\begin{gather*}
		(m^2 + m - 2)e^{mx} = 0 \\
		\Rightarrow m^2 + m - 2 = 0 \\
		\Rightarrow (m+2)(m-1) = 0 \\
		\Rightarrow m = -2, 1
	\end{gather*}

	% TODO: go into detail with linear combination with Wronskian
	% etc.
	So we have two particular solutions to our equation, namely
	$e^x$ and $e^{-2x}$. With two independent solutions, we can use a
	linear combination of these to construct our general solution, much
	in the same way that we can describe a plane using two linearly
	independent vectors. Hence, the general solution to our equation is:
	\[
		y = Ae^x + Be^{-2x}
	\]
\end{ex}

\begin{ex}
	\[
		\frac{d^2y}{dx^2} + \frac{dy}{dx} + y = 0
	\]

	\begin{gather*}
		m^2 + m + 1 = 0 \\
		m = \frac{-1 \pm \sqrt{1-4}}{2} \\
		= \frac{-1 \pm \sqrt{3}i}{2}
	\end{gather*}

	Given that
	\[
		e^{i\theta} = \cos{\theta} + i\sin{\theta}
	\]
	we have
	\[
		e^{mx} = e^{-x/2}\left(\cos(\pm \frac{\sqrt{3}}{2}x)
		+ i\sin(\pm\frac{\sqrt{3}}{2}x)\right)
	\]
	and given that
	\begin{align*}
		\cos(-\theta) &= \cos(\theta) \\
		\sin(-\theta) &= -\sin(\theta)
	\end{align*}
	our particular solutions can be simplified to
	\[
		y = e^{-x/2}\left(\cos \frac{\sqrt{3}}{2}x
		\pm i\sin\frac{\sqrt{3}}{2}x\right)
	\]

	Given that we have two particular solutions, the general solution is:
	\[
		y = e^{-x/2}\left(A\cos \frac{\sqrt{3}}{2}x
		\pm B\sin\frac{\sqrt{3}}{2}x\right)
	\]
	where $A,B \in \CC$.

	In fact, if the roots of the characteristic equation are complex
	conjugates $\alpha \pm i\beta$, then the general solution can be
	expressed:
	\[
		y = Ae^{\alpha x}\cos\beta x + Be^{\alpha x}\sin\beta x
	\]

\end{ex}

\begin{ex}
	\[
		\frac{d^2y}{dx^2} + 6 \frac{dy}{dx} + 9y = 0
	\]

	\begin{gather*}
		(m^2 + 6m + 9)e^{mx} = 0 \\
		m^2 + 6m + 9 = 0 \\
		(m+3)^2  = 0 \\
		m = -3
	\end{gather*}

	Here we get repeated roots, rather than distinct, which means we
	can't form a general solution yet.

	% TODO: explain why factor of x works.
	The general form of these solutions is $(Ax+B)e^{mx}$, so our
	general solution is:
	\[
		y = (Ax+B)e^{-3x}
	\]
\end{ex}

\subsection{Inhomogeneous Equations}

\begin{ex}
	\[
		\frac{d^2}{dx^2} - 4\frac{dy}{dx} + 5y = 1
	\]
	We try a scalar value for $y$ since the RHS is scalar: $y =
	\frac{1}{5}$. It is easy to see that this is a particular
	solution.
\end{ex}

\begin{ex}
	\[
		\frac{d^2}{dx^2} - 4\frac{dy}{dx} + 4y = x
	\]
	We now try $y = Ax+B$ since the RHS is $x$. Plugging in we get:
	\[
		0 - 4A + 4Ax + 4B = x
	\]
	from which it is quite easy to see that $A = B = \frac{1}{4}$. Hence
	\[
		y = \frac{1}{4}x + \frac{1}{4}
	\]
\end{ex}

\begin{ex}
	\[
		\frac{d^2}{dx^2} + 4\frac{dy}{dx} + 5y = x^2
	\]
	We now try $y = Ax^2 + Bx + C$:
	\begin{gather*}
		2A + 8Ax + 4B + 5Ax^2 + 5Bx + 5C = x^2 \\
		\Rightarrow A = \frac{1}{5} \\
		\Rightarrow \frac{2}{5} + \frac{8}{5}x + 4B + 5Bx + 5C = 0 \\
		\Rightarrow 5B = -\frac{8}{5} \\
		\Rightarrow B = -\frac{8}{25} \\
		\Rightarrow \frac{2}{5} - \frac{32}{25} = -5C \\
		\Rightarrow C = \frac{22}{125} \\
		\Rightarrow y = \frac{1}{5}x^2 - \frac{8}{25} x + \frac{22}{125}
	\end{gather*}
\end{ex}

\begin{ex}
	\[
		\frac{d^2}{dx^2} - 3\frac{dy}{dx} + y = 3\cos x
	\]
	We try $y = A\sin x + B \cos x$
	\begin{gather*}
		-A\sin x - B\cos x - 3A\cos x + 3B\sin x + A\sin x + B\cos x
		= 3\cos x \\
		\Rightarrow -A + 3B + A = 0 \Rightarrow B = 0 \\
		\Rightarrow -B - 3A + B = 3 \Rightarrow A = -1 \\
		\Rightarrow y = -\sin x
	\end{gather*}
\end{ex}

To get the general solution to a second order linear inhomogeneous
equation, we need to find the general solution to the corresponding
homogeneous function, $y_c$, and the particular solution to the
inhomogeneous equation, $y_p$. Then the general solution to the
inhomogeneous equation is given by
\[
	y = y_c + y_p
\]

\begin{ex}
	\[
		\frac{d^2}{dx^2} - 4\frac{dy}{dx} + 4y = x
	\]
	As we saw before, $y_p = \frac{1}{4}x + \frac{1}{4}$.

	The homogeneous function is:
	\[
		\frac{d^2}{dx^2} - 4\frac{dy}{dx} + 4y = 0
	\]
	We solve using the same method as earlier:
	\begin{gather*}
		m^2 - 4m + 4 = 0 \\
		(m - 2)^2 = 0 \\
		m = 2 \\
		\Rightarrow y_c = (Ax+B)e^{2x} \\
	\end{gather*}
	Now we can calculate the general solution $y = y_c + y_p$:
	\[
		y = (Ax+B)e^{2x} + \frac{1}{4}x + \frac{1}{4}
	\]
\end{ex}

\subsection{Variation of parameters}

Let $y_p = q_1(x) v_1(x) + q_2(x) v_2(x)$, then:
\[
	y_p' = q_1v_1' + q_1'v_1 + q_2v_2' + q_2'v_2
\]
Letting $q_1'v_1 + q_2'v_2 = 0$ yields
\begin{gather*}
	y_p' = q_1v_1' + q_2v_2' \\
	\Rightarrow y_p'' = q_1'v_1' + q_1v_1'' + q_2'v_2' + q_2v_2''
\end{gather*}

Substituting into
\[
	y'' + a_1 y' + a_0 y = g(x) \\
\]
we get
\begin{multline*}
	(q_1'v_1' + q_1v_1'' + q_2'v_2' + q_2v_2'') +
	a_1(q_1v_1' + q_1'v_1 + q_2v_2' + q_2'v_2) + \\
	a_0(q_1v_1 + q_2v_2) = g(x)
\end{multline*}

We omit the coefficient off the $y''$ term since it can always be
divided out and it is simpler without it.

Re-aranging the above:
\begin{multline*}
	q_1(v_1'' + a_1v_1' + a_0v_1) + q_2(v_2'' + a_1v_2' + a_0v_2) \\
	+ q_1'v_1' + q_2'v_2' = g(x)
\end{multline*}

Since $v_1$ and $v_2$ are solutions to the homogeneous differential
equation, the first two terms are zero. This leaves:
\[
	q_1'v_1' + q_2'v_2' = g(x)
\]

By assumption we have $q_1'v_1 + q_2'v_2 = 0$ and so we now have two
equations with which we can work out $q_1$ and $q_2$.

\begin{ex}
	\[
		\frac{d^2y}{dx^2} + \frac{dy}{dx} - 2y = x
	\]

	The general solution of the homogeneous equation is
	\[
		y_c = Ae^{-2x} + Be^x
	\]
	So we have $v_1 = e^{-2x}$ and $v_2 = e^x$, with $g(x) = x$.

	Using variation of parameters, we know that
	$q_1'v_1' + q_2v_2' = g(x)$. We then have:
	\begin{align*}
		-2 q_1' e^{-2x} + q_2' e^x = x \\
		q_1' e^{-2x} + q_2' e^x = 0
	\end{align*}

	Solve for $q_1$:
	\begin{gather*}
		-3q_1'e^{-2x} = x \\
		\Rightarrow q_1' = -\frac{1}{3} xe^{2x} \\
		\int xe^{2x} = \frac{1}{2}xe^{2x} - \frac{1}{2} \int e^{2x} dx \\
		= \frac{1}{2}xe^{2x} - \frac{1}{4}e^{2x} + c \\
		\Rightarrow q_1 = -\frac{1}{6}e^{2x} (x - 1/2) + c
	\end{gather*}

	Solve for $q_2$:
	\begin{gather*}
		3q_2'e^x = x \\
		\Rightarrow q_2' = \frac{1}{3}xe^{-x} \\
		\int xe^{-x} dx = -xe_{-x} - \int -e^{-x} dx \\
		= -xe^{-x} - e{-x} +c \\
		\Rightarrow q_2 = -\frac{1}{3}e^{-x}(x+1) + c
	\end{gather*}

	So our particular solution is:
	\begin{align*}
		y_p &= -\frac{x}{6} + \frac{1}{12} + c_1e^{-2x}
		- \frac{x}{3} - \frac{1}{3} + c_2e^x \\
		&= -\frac{x}{2} - \frac{1}{4} + c_1e^{-2x} + c_2e^x
	\end{align*}

	Combining with the homogeneous solution, we get our general solution:
	\[
		y = Ae^{-2x} + Be^{x} - \frac{x}{2} - \frac{1}{4}
	\]
\end{ex}

\begin{ex}
	\[
		\frac{d^2y}{dx} + y = 1 + \tan x
	\]

	Since $g(x)$ is trigonometric, we choose our solution of the
	homogeneous in the form
	\[
		y_c = A\cos x + B\sin x
	\]

	\begin{align*}
		-q_1'\sin x + q_2'\cos x &= 1 + \tan x \\
		q_1'\cos x + q_2\sin x &= 0
	\end{align*}

	Solving for $q_2$:
	\begin{gather*}
		-q_1'\sin x \cos x + q_2'\cos^2x = \cos x + \sin x \\
		q_1' \sin x \cos x + q_2'\sin^2x = 0\\
		\Rightarrow q_2' = \cos x + \sin x \\
		\Rightarrow q_2 = \sin x - \cos x
	\end{gather*}

	Solving for $q_1$:
	\begin{gather*}
		q_1'\sin^2x - q_2'\cos x \sin x = -\sin x - \sin x \tan x \\
		q_1'\cos^2x + q_2'\cos x \sin x = 0 \\
		\Rightarrow q_1' = -\sin x - \sin x \tan x \\
		\Rightarrow q_1 = \cos x - \int \sin x \tan x dx
	\end{gather*}
\end{ex}

Note:
If equation is of form
\[
	y'' + a_1y' + a_0y = f(x) + p(x)
\]
Solve two separate equations
\begin{align*}
	y_1'' + a_1y_1' + a_0y_1 &= f(x) \\
	y_2'' + a_1y_2' + a_0y_2 &= p(x) \\
\end{align*}
and then $y_1 + y_2$ is a solution of the original equation.

\end{document}


\chapter{Multi-Scale Variance Stabilizing Transform on the Sphere (MS-VSTS)}
\label{ch_msvsts}

% \markright{Multi-Scale Variance Stabilizing Transform on the Sphere (MS-VSTS)}

\section{Principle of VST}

\subsection{VST of a Poisson process}

Given Poisson data $\mathbf{Y} := (Y_i)_i$, each sample $Y_i \sim \mathcal{P} (\lambda_i)$ has a variance $\text{Var}[Y_i] = \lambda_i$. Thus, the variance of $\mathbf{Y}$ is signal-dependant. The aim of a VST $\mathbf{ T}$ is to stabilize the data such that each coefficient of $\mathbf{ T}(\mathbf{Y})$ has an (asymptotically) constant variance, say $1$, irrespective of the value of $\lambda_i$. In addition, for the VST used in this study, $T(\mathbf{Y})$ is asymptotically normally distributed. Thus, the VST-transformed data are asymptotically stationary and gaussian.

The Anscombe transform \citep{rest:anscombe48} is a widely used VST which has a simple square-root form
\begin{equation}
\label{eq14}
\mathbf{ T}(Y):=2\sqrt{Y+3/8}.
\end{equation}
We can show that $\mathbf{ T}(Y)$ is asymptotically normal as the intensity increases.
\begin{equation}
\label{eq15}
\mathbf{ T}(Y)-2\sqrt{\lambda} \autorightarrow{$\mathcal{D}$}{$\lambda \rightarrow + \infty$} \mathcal{N}(0,1)
\end{equation}
It can be shown that the Anscombe VST requires a high underlying intensity to well stabilize the data (typically for $\lambda \geqslant 10$) \citep{starck:zhang07}.

\subsection{VST of a filtered Poisson process}

Let $Z_j := \sum_i h[i] Y_{j-i}$ be the filtered process obtained by convolving $(Y_i)_i$ with a discrete filter $h$. We will use $Z$ to denote any of the $Z_j$'s. Let us define $\tau_k := \sum_i (h[i])^k$ for $k=1,2,\cdots$. In addition, we adopt a local homogeneity assumption stating that $\lambda_{j-i} = \lambda$ for all $i$ within the support of $h$.

We define the square-root transform $T$ as follows:
\begin{equation}
\label{eq16}
T(Z):=b\cdot \mathrm{sign}(Z+c) |Z+c|^{1/2},
\end{equation}
where $b$ is a normalizing factor.  \\
\emph{\textbf{(Square root as VST)}} If $\tau_1 \neq 0$, $\|h\|_2,\|h\|_3<\infty$, then we have : \\
\begin{equation} \label{eq17}
\begin{split}
\mathrm{sign}(Z+c)\sqrt{|Z+c|}-\mathrm{sign}(\tau_1)\sqrt{|\tau_1|\lambda} \\
 \autorightarrow{$\mathcal{D}$}{$\lambda \rightarrow + \infty$} \mathcal{N}\Big(0,\frac{\tau_2}{4|\tau_1|}\Big).
\end{split}
\end{equation}
This  proves that $T$ is a VST for a filtered Poisson process (with a nonzero-mean filter) in that $T(Y)$ is asymptotically normally distributed with a stabilized variance as $\lambda$ becomes large (see \citet{starck:zhang07} for a proof).

\section{MS-VSTS}

The MS-VSTS~\citep{Schmitt} consists in combining the square-root VST with a multi-scale transform on the sphere.

\subsection{MS-VSTS + IUWT}

This section describes the MS-VSTS + IUWT, which is a combination of a square-root VST with the IUWT. The recursive scheme is:
\begin{equation}
\label{eq27}
\begin{split}
&\text{IUWT}\left\{\begin{array}{ccc}a_j  & = &  h_{j-1} \ast a_{j-1}  \\d_j  & = & a_{j-1}  - a_j  \end{array}\right. \\
 \Longrightarrow & \begin{split}\text{MS-VSTS} \\  \text{+ IUWT} \end{split}\left\{\begin{array}{ccc}a_j  & = &  h_{j-1} \ast a_{j-1} \\d_j  & = & T_{j-1}(a_{j-1}) - T_j(a_j) \end{array}\right. .
\end{split}
\end{equation}

In (\ref{eq27}), the filtering on $a_{j-1}$ can be rewritten as a filtering on $a_0 := \mathbf{Y}$, i.e., $a_j = h^{(j)} \ast a_0$, where $h^{(j)} = h_{j-1} \ast \cdots \ast h_{1} \ast h_0$ for $j \geqslant 1$ and $h^{(0)} = \delta$, where $\delta$ is the Dirac pulse ($\delta = 1$ on a single pixel and $0$ everywhere else). $T_j$ is the VST operator at scale $j$:
\begin{equation}
\label{eq28}
T_j(a_j) = b^{(j)} \mathrm{sign}(a_j+c^{(j)})\sqrt{|a_j + c^{(j)}|} .
\end{equation}
Let us define $\tau_k^{(j)}:=\sum_i (h^{(j)}[i])^k$. In~\citet{starck:zhang07}, it has ben shown that, to have an optimal convergence rate for the VST, the constant $c^{(j)}$ associated to $h^{(j)}$ should be set to:
\begin{equation}
\label{eq29}
c^{(j)}:=\frac{7\tau_2^{(j)}}{8\tau_1^{(j)}} - \frac{\tau_3^{(j)}}{2\tau_2^{(j)}} .
\end{equation}
The MS-VSTS+IUWT procedure is directly invertible as we have:
\begin{equation}
\label{eq30}
a_0 (\theta,\varphi) = T_0^{-1} \Bigg[ T_J(a_J) + \sum_{j=1}^J d_j \Bigg] (\theta,\varphi).
\end{equation}
Setting $b^{(j)}:=\text{sgn}(\tau_1^{(j)})/\sqrt{|\tau_1^{(j)}|}$, if $\lambda$ is constant within the support of the filter.
$h^{(j)}$, then we have \citep{starck:zhang07}:
\begin{equation}
\label{eq31}
\begin{split}
d_j(\theta,\varphi) \autorightarrow{$\mathcal{D}$}{$\lambda \rightarrow + \infty$}
\mathcal{N} \Bigg( 0 , \frac{\tau_2^{(j-1)}}{4\tau_1^{(j-1)^2}} +\\ \frac{\tau_2^{(j)}}{4\tau_1^{(j)^2}} - \frac{\langle h^{(j-1)},h^{(j)} \rangle}{2\tau_1^{(j-1)}\tau_1^{(j)}} \Bigg) ,
\end{split}
\end{equation}
where $\langle . , . \rangle$ denotes inner product.

It means that the detail coefficients issued from locally homogeneous parts of the signal follow asymptotically a central normal distribution with an intensity-independant variance which relies solely on the filter $h$ and the current scale for a given filter $h$. Consequently, the stabilized variances and the constants $b^{(j)}$,$c^{(j)}$,$\tau_k^{(j)}$ can all be pre-computed.
Let us define $\sigma_{(j)}^2$ the stabilized variance at scale $j$ for a locally homogeneous part of the signal:
\begin{equation}
\label{eq32}
\sigma_{(j)}^2 = \frac{\tau_2^{(j-1)}}{4\tau_1^{(j-1)^2}} + \frac{\tau_2^{(j)}}{4\tau_1^{(j)^2}} - \frac{\langle h^{(j-1)},h^{(j)} \rangle}{2\tau_1^{(j-1)}\tau_1^{(j)}} .
\end{equation}

To compute the $\sigma_{(j)}$, $b^{(j)}$,$c^{(j)}$,$\tau_k^{(j)}$, we only have to know the filters $h^{(j)}$. We compute these filters thanks to the formula $a_j = h^{(j)} \ast a_0$, by applying the IUWT to a Dirac pulse $a_0 = \delta$. Then, the $h^{(j)}$ are the scaling coefficients of the IUWT. The $\sigma_{(j)}$ have been precomputed for a 6-scaled IUWT (Table~\ref{sigmaj}).

\begin{table*}[!h]
  \centering
    \caption{Precomputed values of the variances $\sigma_j$ of the wavelet coefficients.
  }
  \begin{tabular}{|c|c|}
\hline
Wavelet scale $j$ & Value of $\sigma_j$ \\
\hline
  1 & 0.484704 \\
  2 & 0.0552595 \\
  3 & 0.0236458 \\
  4 & 0.0114056 \\
  5 & 0.00567026 \\
\hline
\end{tabular}

  \label{sigmaj}
\end{table*}

We have simulated Poisson images of different constant intensities $\lambda$, computed the IUWT with MS-VSTS on each image and observed the variation of the normalized value of $\sigma_{(j)}$ ($\mathbf{ (\sigma_{(j)})_{\text{simulated}}} / (\sigma_{(j)})_{\text{theoretical}}$) as a function of $\lambda$ for each scale $j$ (Fig. \ref{sigma}). We see that the wavelet coefficients are stabilized when $\lambda \gtrsim 0.1$ except for the first wavelet scale, which is mostly constituted of noise. On Fig. \ref{ansc}, we compare the result of MS-VSTS with Anscombe + wavelet shrinkage, on sources of varying intensities. We see that MS-VSTS works well on sources of very low intensities, whereas Anscombe doesn't work when the intensity is too low.

\begin{figure}[htb]
\centering{
\hbox{
%\psfig{figure=sigma1.ps,widtht=2.9in}
\includegraphics[width=2.5in, height=3in]{13822fg1.pdf}
\includegraphics[width=2.5in, height=3in]{13822fg2.pdf}
}
\hbox{
\includegraphics[width=2.5in, height=3in]{13822fg3.pdf}
\includegraphics[width=2.5in, height=3in]{13822fg4.pdf}
}}
\caption{Normalized value ($\mathbf{ (\sigma_{(j)})_{\text{simulated}} }/ (\sigma_{(j)})_{\text{theoretical}}$) of the stabilized variances at each scale $j$ as a function of $\lambda$.}
\label{sigma}
\end{figure}

\begin{figure}[htb]
\centering
\includegraphics[width=2.5in]{13822fg6.pdf}
\includegraphics[width=2.5in]{13822fg7.pdf}
\includegraphics[width=2.5in]{13822fg8.pdf}
\includegraphics[width=2.5in]{13822fg9.pdf}
\caption{Comparison of MS-VSTS with Anscombe + wavelet shrinkage on a single HEALPix face.
\emph{Top Left} : Sources of varying intensity.
\emph{Top Right} : Sources of varying intensity with Poisson noise.
\emph{Bottom Left} : Poisson sources of varying intensity reconstructed with Anscombe + wavelet shrinkage.
\emph{Bottom Right} : Poisson sources of varying intensity reconstructed with MS-VSTS.
}
\label{ansc}
\end{figure}

\subsection{MS-VSTS + Curvelets}

As the first step of the algorithm is an IUWT, we can stabilize each resolution level as in Equation~(\ref{eq27}). We then apply the local ridgelet transform on each stabilized wavelet band.

It is not as straightforward as with the IUWT to derive the asymptotic noise variance in the stabilized curvelet domain. In our experiments, we derived them using simulated Poisson data of stationary intensity level $\lambda$. After having checked that the standard deviation in the curvelet bands becomes stabilized as the intensity level increases (which means that the stabilization is working properly), we stored the standard deviation $\sigma_{j,l}$ for each wavelet scale $j$ and each ridgelet band $l$ (Table~\ref{tabcurv}).

\begin{table*}[!h]
  \centering
   \caption{Asymptotic values of the variances $\sigma_{j,k}$ of the curvelet coefficients.
  }
  \begin{tabular}{|c|c|c|c|c|}
\hline
 $j$ & $l=1$ & $l=2$ & $l=3$ & $l=4$ \\
\hline
  1 & 1.74550 & 0.348175 & & \\
  2 & 0.230621 & 0.248233 & 0.196981 & \\
  3 & 0.0548140 & 0.0989918 & 0.219056 & \\
  4 & 0.0212912 & 0.0417454 & 0.0875663 & 0.20375 \\
  5 & 0.00989616 & 0.0158273 & 0.0352021 & 0.163248 \\
\hline
\end{tabular}

  \label{tabcurv}
\end{table*}


\chapter{(What?)}

\paragraph{Cauchy's functional equation}
\(f(x+y) = f(x)+f(y)\).

\section{Unary numeral via Kleene closure}

\(\Nat \leftrightarrow \{1\}^*\)
where \(0 \leftrightarrow \emptystr\), \(1 \leftrightarrow 1\), \(2 \leftrightarrow 11\), \(3 \leftrightarrow 111\), and so on.

\section{Order}

Minimum

Maximum

Extremum

Infimum, greatest lower bound

Supremum, least upper bound

\index{argmin}%
Define \(m = \arg\min_{x \in X}(f~x)\) iff \(\forall x \in X : f~m \le f~x\).

\index{min}%
Define \(\min_{x \in X}(f~x) = f~(\arg\min_{x \in X}(f~x))\).

\section{Lattice}

Meet

Join

Semilattice

\section{Limit}

\(\lim_{n \to \infty} x_n\)

\section{Metric}

\index{distance}%
\index{distance!between hyperplane and point}%
Let \(\dist\) stand for \emph{distance}.
If \(h\) is a hyperplane,
then \(\dist~h~X = \min_{x \in X} (\dist~h~x)\)
where \(\dist~h~x = |x-q|\) where \(q\) is on \(h\) and \(x-q\) is parallel to \(n\).
\index{metric}%
A \emph{metric} is...

\section{Norm}

\index{norm}%
A \emph{norm} is...
\index{normed space}%
\index{space!normed}%
A \emph{normed space} is...
\index{metric space}%
\index{space!metric}%
A \emph{metric space} is...
\index{Euclidean space}%
\index{space!Euclidean}%
An \emph{Euclidean space} is ...
\index{pre-Hilbert space}%
\index{space!pre-Hilbert}%
A \emph{pre-Hilbert space} is ...
\index{Hilbert space}%
\index{space!Hilbert}%
A \emph{Hilbert space} is ...
Usually we can pretend that a Hilbert space is an infinite-dimensional Euclidean space.
%A Hilbert space is an infinite-dimensional vector space with inner product,
%that is also a complete metric space with respect to the distance function induced by the inner product.
% TODO rephrase using pre-Hilbert space

\index{Banach space}%
\index{space!Banach}%
A \emph{Banach space} is a complete normed vector space.


\documentclass{amsart}

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}

\title{Problem Set 1}
\author{Mark Ditsworth}

\begin{document}
	\maketitle
	\section{Linear Algebra}
	\subsection{Problem 1}
	Show that if $M\in \mathbb{R}^{n\times n}$ is a symmetric matrix and $d \leq n$, then $U \in \mathbb{R}^{n\times d}$ and $U^T U=I_{d\times d}$,
	\[
	\max_d \text{Tr} \left(U^T M U\right) = \sum_{k=1}^{d}\lambda_{k}^{(+)}
	\]
	where $\lambda_{k}^{(+)}$ is the $k$th largest eigenvalue of $M$.\\
	\\
	Since $M$ is symmetric, we have the singular value decomposition (SVD)
	\[
	M = U D^2 U^T
	\]
	where $D$ is a diagonal matrix with values corresponding to the eigenvalues of $M$, in order of magnitude. Since $U^TU = I \Rightarrow U^T = U^{-1}$, we have
	\[
	U^{-1}M(U^T)^{-1} = D^2
	\]
	\[
	U^TMU = D^2
	\]
	Therefore, $\text{Tr} \left(U^T M U\right) =\text{Tr}\left(D^2\right) = \sum_{k=1}^{n}\lambda_k^{(+)}$

	In order to maximize this, we can set $d$ such that $\lambda_{d+1}^{(+)}$ is the first occurrence of a complex eigenvalue in the $\lambda_k^{(+)}$ sequence who's magnitude is negative. If no such eigenvector exists, $d=n$.
	\\
	\section{Estimators}
	\subsection{Problem 2}
	Given $x_1, \dots x_n$ i.i.d samples from a distribution $X$ with mean $\mu$ and covariance $\Sigma$, show that
	\[
	\mu_n = \frac{1}{n}\sum_{k=1}^{n}x_k \qquad,\qquad \Sigma_n = \frac{1}{n-1}(x_k - \mu)(x_k - \mu)^T
	\]
	are unbiased estimators for $\mu$ and $\Sigma$. (Show that $\mathbf{E}[\mu_n]=\mu$ and $\mathbf{E}[\Sigma_n]=\Sigma$)\\
	\\
	\[
	\mathbf{E}[\mu_n] = \mathbf{E}\left[\frac{x_1+\dots+x_n}{n}\right] =
	\frac{\mathbf{E}[x_1]+\dots+\mathbf{E}[x_n]}{n}=
	\frac{n\mu}{n}=\mu
	\]
	\\
	\[
	\mathbf{E}[\Sigma_n] = \frac{1}{n-1}\sum_{i=1}^{n}
	\mathbf{E}\left[(x_i-\mu_n)(x_i-\mu_n)^T\right]=
	\frac{1}{n-1}\sum_{i=1}^{n}\mathbf{E}\left[((x_i-\mu)-(\mu_n-\mu))((x_i-\mu)-(\mu_n-\mu))^T\right]
	\]
	\[
	=\frac{1}{n-1}\sum_{i=1}^{n}\mathbf{E}\left[
	(x_i-\mu)(x_i-\mu)^T\right]+\mathbf{E}\left[
	(\mu_n-\mu)(\mu_n-\mu)^T\right]-\mathbf{E}\left[
	(x_i-\mu)(\mu_n-\mu)^T\right]-\mathbf{E}\left[
	(\mu_n-\mu)(x_i-\mu)^T\right]
	\]
	\[
	=\frac{1}{n-1}\sum_{i=1}^{n}\mathbf{E}\left[
	(x_i-\mu)(x_i-\mu)^T\right] =
	\sum_{i=1}^{n}\mathbf{E}\left[
	\frac{(x_i-\mu)(x_i-\mu)^T}{n-1}\right]=
	\mathbf{E}\left[\sum_{i=1}^{n}
	\frac{(x_i-\mu)(x_i-\mu)^T}{n-1}\right]=\Sigma
	\]
	\\
	\section{Random Matrices}
	\subsection{Problem 3}
	Let $W \in \mathbb{R}^{n\times n}$ be a Wigner Matrix, a symmetric random matrix whose diagonal and upper-diagonal entries are independent $W_{ii} \sim \mathbb{N}(0,2)$ and for $i<j$, $W_{ij} \sim N(0,1)$. Show that the distribution of the eigenvalues of $\frac{1}{\sqrt{n}}W$ converge to the semi-circle law of support $[-2,2]$
	\[
	dSC(x) = \frac{1}{2\pi}\sqrt{4-x^2}1_{[-1,1]}(x)
	\]
	\\
	\begin{figure}[h!]
	\includegraphics[]{dSC.png}
	\caption{Histogram of eigenvalues for the $\frac{1}{\sqrt{n}}W$ ($n=500$)}
	\end{figure}
	\\
	\subsection{Problem 4}
	Use Slepian's Comparison Lemma to show that for a Wigner matrix $W\in \mathbb{R}^{n \times n}$, where $W_{ij | i\neq j} \sim N(0,1)$ and $W_{ii} \sim N(0,2)$.
	\\
	\[
	\mathbf{E}\left[\lambda_{max}(W)\right] \leq 2\sqrt{n}
	\]
	\\
	\[
	\lambda_{max}(W) = \max_v v^T W v \Rightarrow \mathbf{E}\left[\lambda_{max}(W)\right] = \mathbf{E}\left[\max_v v^t W v\right]
	\]
	\[
	\text{Let } Y_v \ddot{=} \max_v v^T W v
	\]
	\[
	\text{Define } X_v = v^Tg \qquad g \sim N(0,I_{n\times n})
	\]
	Slepian's Comparison Lemma states that for random variables $X_v$ and $Y_v$, if $\mathbf{E}[X_v]=\mathbf{E}[Y_v]=0$, and $\forall v1, v2 \in V$ s.t. $v1 \neq v2$ $\mathbf{E}[X_{v1}-X_{v2}]^2 \geq \mathbf{E}[Y_{v1}-Y_{v2}]^2$, then
	\[
	\mathbf{E}\left[\max_v Y_v\right] \leq \mathbf{E}\left[\max_v X_v\right]
	\]
	Since $X_v$ and $Y_v$ are both related to Gaussians about 0, the first condition is satisfied. Monte Carlo simulation of $\mathbf{E}[2X_{v1}-2X_{v2}]^2 - \mathbf{E}[Y_{v1}-Y_{v2}]^2$ are shown below; clearly the value is $\geq 0$, thus satisfying the second condition.
	\begin{figure}[h!]
		\includegraphics[scale=0.6]{subtract.png}
	\end{figure}
	Therefore, it is sufficient to say that \[\mathbf{E}\left[\max_v Y_v\right] \leq \mathbf{E}\left[\max_v 2X_v\right]\]
	By Jensen's inequality, we have that
	\[
	\mathbf{E}\left[\max_v X_v\right]^2 \leq \mathbf{E}\left[\left(\max_v X_v\right)^2\right]
	\]
	\[
	\mathbf{E}\left[\max_v v^Tg\right]^2 \leq \mathbf{E}\left[\left(\max_v v^Tg\right)^2\right]
	\]
	Since $||v||_2=1$, $v^Tg$ will be maximized when each element of $v$ is equal to $\frac{1}{\sqrt{n}}$. Thus, $max_v v^Tg = \frac{1}{\sqrt{n}}\sum_{i=1}^n g_i$. Since $g$ is standard Gaussian, $\sum_{i=1}^{n}g \leq n$, thus $max_v v^Tg \leq \sqrt{n}$. Therefore, we have
	\[
	\mathbf{E}\left[\max_v v^Tg\right]^2 \leq n
	\]
	\[
	\mathbf{E}\left[\max_v v^Tg\right] \leq \sqrt{n}
	\]
	and finally
	\[
	\mathbf{E}[\max_v Y_v] = \mathbf{E}[\lambda_{max}(W)] \leq 2\sqrt{n}
	\]
	\subsection{Problem 5}
	Consider the matrix $M = \frac{1}{\sqrt{n}}W + \beta vv^T$ for $||v||_2=1$ and $W$ is a standard Gaussian Wigner Matrix. If $v=e_1$, this is a rank 1 perturbation of a Wigner matrix. Derive the limit of the largest eigenvalue.
	\\\\
	Rather than performing a rigorous proof, the limit can be derived empirically by generating 500 samples of $M$, with $n$ set to a reasonably large number (1000), and $\beta$ selected randomly each time from a uniform distribution $[0,5]$.
	\begin{figure}[h!]
		\centering
		\includegraphics[scale=0.55]{problem_5.png}
	\end{figure}

	We can see that when $\beta \leq 1$, $\lim\limits_{n \rightarrow \infty} \lambda_{max} = 2$, and when $\beta > 1$, $\lim\limits_{n \rightarrow \infty}\lambda_{max} = \beta + \frac{1}{\beta}$
	\\\\
	\section{Diffusion Maps}
	\subsection{Problem 6}
	Derive the 2-D diffusion map embedding for the $n$-node ring graph. If the eigenvalues are complex, try creating real ones using multiplicity of eigenvalues. Is it a reasonable embedding of this graph in two dimensions?

	\begin{figure}[h!]
		\centering
		\includegraphics[width=0.6\linewidth]{diffmap.png}
	\end{figure}
\end{document}


% !TEX root = lectures.tex
%!TEX encoding = UTF-8 Unicode
%\input{lectureheader.tex}

\section{Gravity and Central Forces}
\bigskip

\subsection{Gravity}

The gravitational potential energy and forces involving two masses $a$ and $b$ are
\begin{eqnarray}
U_{ab}&=&-\frac{Gm_am_b}{|\vec{r}_a-\vec{r}_b|},\\
\nonumber
F_{ba}&=&-\frac{Gm_am_b}{|\vec{r}_a-\vec{r}_b|^2}\hat{r}_{ab},\\
\nonumber
\hat{r}_{ab}&=&\frac{\vec{r}_b-\vec{r}_a}{|\vec{r}_a-\vec{r}_b|}.
\end{eqnarray}
Here $G=6.67\times 10^{-11}$ Nm$^2$/kg$^2$, and $F_{ba}$ is the force on $b$ due to $a$. By inspection, one can see that the force on $b$ due to $a$ and the force on $a$ due to $b$ are equal and opposite. The net potential energy for a large number of masses would be
\begin{equation}
U=\sum_{a<b}U_{ab}=\frac{1}{2}\sum_{a\ne b}U_{ab}.
\end{equation}
Just like electrodynamics, one can define "fields", which for a small additional mass $m$ are the force per mass and the additional potential energy per mass. The {\it gravitational field} related to the force has dimensions of force per mass, or acceleration, and can be labeled $\vec{g}(\vec{r})$. The potential energy per mass has dimensions of energy per mass. This is analogous to the electromagnetic potential, which is the potential energy per charge, and the electric field which is the force per charge.

Because the field $\vec{g}$ obeys the same inverse square law for a point mass as the electric field does for a point charge, the gravitational field also satisfies a version of Gauss's law,
\begin{equation}
\label{eq:GravGauss}
\oint d\vec{A}\cdot\vec{g}=-4\pi GM_{\rm inside}.
\end{equation}
Here, $M_{\rm inside}$ is the net mass inside a closed area.

Gauss's law can be understood by considering a nozzle that sprays paint in all directions uniformly from a point source. Let $B$ be the number of gallons per minute of paint leaving the nozzle. If the nozzle is at the center of a sphere of radius $r$, the paint per square meter per minute that is deposited on some part of the sphere is
\begin{eqnarray}
F(r)&=&\frac{B}{4\pi r^2}.
\end{eqnarray}
Now, let $F$ also be assigned a direction, so that it becomes a vector pointing along the direction of the flying paint. For any surface that surrounds the nozzle, not necessarily a sphere, one can state that
\begin{eqnarray}
\label{eq:paint}
\oint \vec{dA}\cdot\vec{F}&=&B,
\end{eqnarray}
regardless of the shape of the surface. This follows because the rate at which paint is deposited on the surface should equal the rate at which it leaves the nozzle. The dot product ensures that only the component of $\vec{F}$ into the surface contributes to the deposition of paint. Similarly, if $\vec{F}$ is any radial inverse-square forces, that falls as $B/(4\pi r^2)$, then one can apply Eq. (\ref{eq:paint}). For gravitational fields, $B/(4\pi)$ is replaced by $GM$, and one quickly ``derives'' Gauss's law for gravity, Eq. (\ref{eq:GravGauss}).

\example
Consider Earth to have its mass $M$ uniformly distributed in a sphere of radius $R$. Find the magnitude of the gravitational acceleration as a function of the radius $r$ in terms of the acceleration of gravity at the surface $g(R)$. Assume $r<R$, i.e. you are inside the surface.

{\bf Solution}: Take the ratio of Eq. (\ref{eq:GravGauss}) for two radii, $R$ and $r<R$,
\begin{eqnarray*}
\frac{4\pi r^2 g(r)}{4\pi R^2 g(R)}&=&\frac{4\pi GM_{\rm inside~r}}{4\pi GM_{\rm inside~R}}\\
\nonumber
&=&\frac{r^3}{R^3}\\
\nonumber
g(r)&=&g(R)\frac{r}{R}~.
\end{eqnarray*}

The potential energy per mass is similar conceptually to the voltage, or electric potential energy per charge, that was studied in electromagnetism, if $V\equiv U/m$, $\vec{g}=-\nabla V$.

\exampleend

\subsection{Tidal Forces}

Consider a spherical planet of radius $r$ a distance $D$ from another body of mass $M$. The magnitude of the force due to $M$ on an small object of mass $\delta m$ on surface of the planet can be calculated by performing a Taylor expansion about the center of the spherical planet.
\begin{equation}
F=-\frac{GM\delta m}{D^2}+2\frac{GM\delta m}{D^3}\Delta D+\cdots
\end{equation}
If the $z$ direction points toward the large object, $\Delta D$ can be referred to as $z$. In the accelerating frame of an observer at the center of the planet,
\begin{equation}
\delta m\frac{d^2 z}{dt^2}=F-\delta ma'+{\rm other~forces~acting~on~} \delta m,
\end{equation}
where $a'$ is the acceleration of the observer. Because $\delta ma'$ equals the gravitational force on $\delta m$ if it were located at the planet's center, one can write
\begin{equation}
m\frac{d^2z}{dt^2}=2\frac{GM\delta m}{D^3}z+{\rm other~forces~acting~on~}\delta m.
\end{equation}
Here the other forces could represent the forces acting on $\delta m$ from the spherical planet such as the gravitational force or the contact force with the surface. If $\theta$ is the angle w.r.t. the $z$ axis, the effective force acting on $\delta m$ is
\begin{equation}
F_{\rm eff}\approx 2\frac{GM\delta m}{D^3}r\cos\theta\hat{z}+{\rm other~forces~acting~on~}\delta m.
\end{equation}
This first force is the "tidal" force. It pulls objects outward from the center of the object. If the object were covered with water, it would distort the objects shape so that the shape would be elliptical, stretched out along the axis pointing toward the large mass $M$. The force is always along (either parallel or antiparallel to) the $\hat{z}$ direction.

\begin{samepage}

\example
Consider the Earth to be a sphere of radius $R$ covered with water, with the gravitational acceleration at the surface noted by $g$. Now assume that a distant body provides an additional constant gravitational acceleration $\vec{a}$ pointed along the $z$ axis. Find the distortion of the radius as a function of $\theta$. Ignore planetary rotation and assume $a<<g$.

{\bf Solution}: Because Earth would then accelerate with $a$, the field $a$ would seem invisible in the accelerating frame. A tidal force would only appear if $a$ depended on position, i.e. $\nabla \vec{a}\ne 0$.
\end{samepage}

\example
Now consider that the field is no longer constant, but that instead $a=-kz$ with $|kR|<<g$.

{\bf Solution}: The surface of the planet needs to be at constant potential (if the planet is not accelerating). The force per mass, $-kz$ is like a spring, and the potential per mass is $kz^2/2$. Otherwise water would move to a point of lower potential. Thus, the potential energy for a sample mass $\delta m$ is
\begin{eqnarray*}
V(R)+\delta m gh(\theta)-\frac{\delta m}{2}kr^2\cos^2\theta={\rm Constant}\\
V(R)+\delta mgh(\theta)-\frac{\delta m}{2}kR^2\cos^2\theta-\delta m kRh(\theta)\cos^2\theta-\frac{\delta m}{2}kh^2(\theta)\cos^2\theta={\rm Constant}.
\end{eqnarray*}
Here, the potential due to the external field is $(1/2)kz^2$ so that $-\nabla U=-kz$. One now needs to solve for $h(\theta)$. Absorbing all the constant terms from both sides of the equation into one constant $C$, and because both $h$ and $kR$ are small, we can through away terms of order $h^2$ or $kRh$. This gives
\begin{eqnarray*}
gh(\theta)-\frac{1}{2}kR^2\cos^2\theta&=&C,\\
h(\theta)&=&\frac{C}{g}+\frac{1}{2g}kR^2\cos^2\theta,\\
h(\theta)&=&\frac{1}{2g}kR^2(\cos^2\theta-1/3).
\end{eqnarray*}
The term with the factor of $1/3$ replaced the constant and was chosen so that the average height of the water would be zero.

\example
The Sun's mass is $27\times 10^6$ the Moon's mass, but the Sun is 390 times further away from Earth as the Sun. What is ratio of the tidal force of the Sun to that of the Moon.

{\bf Solution}: The gravitational force due to an object $M$ a distance $D$ away goes as $M/D^2$, but the tidal force is only the difference of that force over a distance $R$,
\[
F_{\rm tidal}\propto \frac{M}{D^3}R.
\]
Therefore the ratio of force is
\begin{eqnarray*}
\frac{F_{\rm Sun's~tidal~force}}{F_{\rm Moon's~tidal~force}}
&=&\frac{M_{\rm sun}/D_{\rm sun}^3}{M_{\rm moon}/D_{\rm moon}^3}\\
&=&\frac{27\times 10^6}{390^3}=0.46.
\end{eqnarray*}
The Moon more strongly affects tides than the Sun.

\exampleend

\subsection{Deriving Elliptical Orbits}

Kepler's laws state that a gravitational orbit should be an ellipse with the source of the gravitational field at one focus. Deriving this is surprisingly messy. To do this, we first use angular momentum conservation to transform the equations of motion so that it is in terms of $r$ and $\theta$ instead of $r$ and $t$. The overall strategy is to
\begin{enumerate}\itemsep=0pt
\item Find equations of motion for $r$ and $t$ with no angle ($\theta$) mentioned, i.e. $d^2r/dt^2=\cdots$. Angular momentum conservation will be used, and the equation will involve the angular momentum $L$.
\item Use angular momentum conservation to find an expression for $\dot{\theta}$ in terms of $r$.
\item Use the chain rule to convert the equations of motions for $r$, an expression involving $r,\dot{r}$ and $\ddot{r}$, to one involving $r,dr/d\theta$ and $d^2r/d\theta^2$. This is quitecomplicated because the expressions will also involve a substitution $u=1/r$ so that one finds an expression in terms of $u$ and $\theta$.
\item Once $u(\theta)$ is found, you need to show that this can be converted to the familiar form for an ellipse.
\end{enumerate}

The equations of motion give
\begin{eqnarray}
\label{eq:radialeqofmotion}
\frac{d}{dt}r^2&=&\frac{d}{dt}(x^2+y^2)=2x\dot{x}+2y\dot{y}=2r\dot{r},\\
\nonumber
\dot{r}&=&\frac{x}{r}\dot{x}+\frac{y}{r}\dot{y},\\
\nonumber
\ddot{r}&=&\frac{x}{r}\ddot{x}+\frac{y}{r}\ddot{y}
+\frac{\dot{x}^2+\dot{y}^2}{r}
-\frac{\dot{r}^2}{r}.
\end{eqnarray}
Recognizing that the numerator of the third term is the velocity squared, and that it can be written in polar coordinates,
\begin{equation}
v^2=\dot{x}^2+\dot{y}^2=\dot{r}^2+r^2\dot{\theta}^2,
\end{equation}
one can write $\ddot{r}$ as
\begin{eqnarray}
\label{eq:radialeqofmotion2}
\ddot{r}&=&\frac{F_x\cos\theta+F_y\sin\theta}{m}+\frac{\dot{r}^2+r^2\dot{\theta}^2}{r}-\frac{\dot{r}^2}{r}\\
\nonumber
&=&\frac{F}{m}+\frac{r^2\dot{\theta}^2}{r}\\
\nonumber
m\ddot{r}&=&F+\frac{L^2}{mr^3}.
\end{eqnarray}
This derivation used the fact that the force was radial, $F=F_r=F_x\cos\theta+F_y\sin\theta$, and that angular momentum is $L=mrv_{\theta}=mr^2\dot{\theta}$. The term $L^2/mr^3=mv^2/r$ behaves like an additional force. Sometimes this is referred to as a centrifugal force, but it is not a force. Instead, it is the consequence of considering the motion in a rotating (and therefore accelerating) frame.

Now, we switch to the particular case of an attractive inverse square force, $F=-\alpha/r^2$, and show that the trajectory, $r(\theta)$, is an ellipse. To do this we transform derivatives w.r.t. time to derivatives w.r.t. $\theta$ using the chain rule combined with angular momentum conservation, $\dot{\theta}=L/mr^2$.
\begin{eqnarray}
\label{eq:rtotheta}
\dot{r}&=&\frac{dr}{d\theta}\dot{\theta}=\frac{dr}{d\theta}\frac{L}{mr^2},\\
\nonumber
\ddot{r}&=&\frac{d^2r}{d\theta^2}\dot{\theta}^2
+\frac{dr}{d\theta}\left(\frac{d}{dr}\frac{L}{mr^2}\right)\dot{r}\\
\nonumber
&=&\frac{d^2r}{d\theta^2}\left(\frac{L}{mr^2}\right)^2
-2\frac{dr}{d\theta}\frac{L}{mr^3}\dot{r}\\
\nonumber
&=&\frac{d^2r}{d\theta^2}\left(\frac{L}{mr^2}\right)^2
-\frac{2}{r}\left(\frac{dr}{d\theta}\right)^2\left(\frac{L}{mr^2}\right)^2
\end{eqnarray}
Equating the two expressions for $\ddot{r}$ in Eq.s (\ref{eq:radialeqofmotion2}) and (\ref{eq:rtotheta}) eliminates all the derivatives w.r.t. time, and provides a differential equation with only derivatives w.r.t. $\theta$,
\begin{equation}
\label{eq:rdotdot}
\frac{d^2r}{d\theta^2}\left(\frac{L}{mr^2}\right)^2
-\frac{2}{r}\left(\frac{dr}{d\theta}\right)^2\left(\frac{L}{mr^2}\right)^2
=\frac{F}{m}+\frac{L^2}{m^2r^3},
\end{equation}
that when solved yields the trajectory, i.e. $r(\theta)$. Up to this point the expressions work for any radial force, not just forces that fall as $1/r^2$.

The trick to simplifying this differential equation for the inverse square problems is to make a substitution, $u\equiv 1/r$, and rewrite the differential equation for $u(\theta)$.
\begin{eqnarray}
r&=&1/u,\\
\nonumber
\frac{dr}{d\theta}&=&-\frac{1}{u^2}\frac{du}{d\theta},\\
\nonumber
\frac{d^2r}{d\theta^2}&=&\frac{2}{u^3}\left(\frac{du}{d\theta}\right)^2-\frac{1}{u^2}\frac{d^2u}{d\theta^2}.
\end{eqnarray}
Plugging these expressions into Eq. (\ref{eq:rdotdot}) gives an expression in terms of $u$, $du/d\theta$, and $d^2u/d\theta^2$. After some tedious algebra,
\begin{equation}
\frac{d^2u}{d\theta^2}=-u-\frac{F m}{L^2u^2}.
\end{equation}
For the attractive inverse square law force, $F=-\alpha u^2$,
\begin{equation}
\frac{d^2u}{d\theta^2}=-u+\frac{m\alpha}{L^2}.
\end{equation}
The solution has two arbitrary constants, $A$ and $\theta_0$,
\begin{eqnarray}
\label{eq:Ctrajectory}
u&=&\frac{m\alpha}{L^2}+A\cos(\theta-\theta_0),\\
\nonumber
r&=&\frac{1}{(m\alpha/L^2)+A\cos(\theta-\theta_0)}.
\end{eqnarray}
The radius will be at a minimum when $\theta=\theta_0$ and at a maximum when $\theta=\theta_0+\pi$. The constant $A$ is related to the eccentricity of the orbit. When $A=0$ the radius is a constant $r=L^2/(m\alpha)$, and the motion is circular. If one solved the expression $mv^2/r=-\alpha/r^2$ for a circular orbit, using the substitution $v=L/(mr)$, one would reproduce the expression $r=L^2/(m\alpha)$.

The form describing the elliptical trajectory in Eq. (\ref{eq:Ctrajectory}) can be identified as an ellipse with one focus being the center of the ellipse by considering the definition of an ellipse as being the points such that the sum of the two distances between the two foci are a constant. Making that distance $2D$, the distance between the two foci as $2a$, and putting one focus at the origin,
\begin{eqnarray}
2D&=&r+\sqrt{(r\cos\theta-2a)^2+r^2\sin^2\theta},\\
\nonumber
4D^2+r^2-4Dr&=&r^2+4a^2-4ar\cos\theta,\\
\nonumber
r&=&\frac{D^2-a^2}{D+a\cos\theta}=\frac{1}{D/(D^2-a^2)-a\cos\theta/(D^2-a^2)}.
\end{eqnarray}
By inspection, this is the same form as Eq. (\ref{eq:Ctrajectory}) with $D/(D^2-a^2)=m\alpha/L^2$ and $a/(D^2-a^2)=A$.

\subsection{Effective or Centrifugal Potential}

The total energy of a particle is
\begin{eqnarray}
E&=&U(r)+\frac{1}{2}mv_\theta^2+\frac{1}{2}m\dot{r}^2\\
\nonumber
&=&U(r)+\frac{1}{2}mr^2\dot{\theta}^2+\frac{1}{2}m\dot{r}^2\\
\nonumber
&=&U(r)+\frac{L^2}{2mr^2}+\frac{1}{2}m\dot{r}^2.
\end{eqnarray}
The second term then contributes to the energy like an additional repulsive potential. The term is sometimes referred to as the "centrifugal" potential, even though it is actually the kinetic energy of the angular motion. Combined with $U(r)$, it is sometimes referred to as the "effective" potential,
\begin{eqnarray}
U_{\rm eff}(r)&=&U(r)+\frac{L^2}{2mr^2}.
\end{eqnarray}
Note that if one treats the effective potential like a real potential, one would expect to be able to generate an effective force,
\begin{eqnarray}
F_{\rm eff}&=&-\frac{d}{dr}U(r) -\frac{d}{dr}\frac{L^2}{2mr^2}\\
\nonumber
&=&F(r)+\frac{L^2}{mr^3}=F(r)+m\frac{v_\perp^2}{r},
\end{eqnarray}
which is indeed matches the form for $m\ddot{r}$ in Eq. (\ref{eq:radialeqofmotion2}), which included the ``centrifugal'' force.

\example
Consider a particle of mass $m$ in a 2-dimensional harmonic oscillator with potential
\[
U=\frac{1}{2}kr^2=\frac{1}{2}k(x^2+y^2).
\]
If the orbit has angular momentum $L$, find\\
a) the radius and angular velocity of the circular orbit\\
b) the angular frequency of small radial perturbations

{\bf Solution}:\\
a) Consider the effective potential. The radius of a circular orbit is at the minimum of the potential (where the effective force is zero).
\begin{eqnarray*}
U_{\rm eff}&=&\frac{1}{2}kr^2+\frac{L^2}{2mr^2}
\end{eqnarray*}
The effective potential looks like that of a harmonic oscillator for large $r$, but for small $r$, the centrifugal potential repels the particle from the origin. The combination of the two potentials has a minimum for at some radius $r_{\rm min}$.
\begin{eqnarray*}
0&=&kr_{\rm min}-\frac{L^2}{mr_{\rm min}^3},\\
r_{\rm min}&=&\left(\frac{L^2}{mk}\right)^{1/4},\\
\dot{\theta}&=&\frac{L}{mr_{\rm min}^2}=\sqrt{k/m}.
\end{eqnarray*}
For particles at $r_{\rm min}$ with $\dot{r}=0$, the particle does not accelerate and $r$ stays constant, i.e. a circular orbit. The radius of the circular orbit can be adjusted by changing the angular momentum $L$.

b) Now consider small vibrations about $r_{\rm min}$. The effective spring constant is the curvature of the effective potential.
\begin{eqnarray*}
k_{\rm eff}&=&\left.\frac{d^2}{dr^2}U_{\rm eff}(r)\right|_{r=r_{\rm min}}=k+\frac{3L^2}{mr_{\rm min}^4}\\
&=&4k,\\
\omega&=&\sqrt{k_{\rm eff}/m}=2\sqrt{k/m}=2\dot{\theta}.
\end{eqnarray*}
Here, the second step used the result of the last step from part (a). Because the radius oscillates with twice the angular frequency, the orbit has two places where $r$ reaches a minimum in one cycle. This differs from the inverse-square force where there is one minimum in an orbit. One can show that the orbit for the harmonic oscillator is also elliptical, but in this case the center of the potential is at the center of the ellipse, not at one of the foci.

The solution is also simple to write down exactly in Cartesian coordinates. The $x$ and $y$ equations of motion separate,
\begin{eqnarray*}
\ddot{x}&=&-kx,\\
\ddot{y}&=&-ky.
\end{eqnarray*}
So the general solution can be expressed as
\begin{eqnarray*}
x&=&A\cos\omega_0 t+B\sin\omega_0 t,\\
y&=&C\cos\omega_0 t+D\sin\omega_0 t.
\end{eqnarray*}
With some work using double angle formulas, one can calculate
\begin{eqnarray*}
r^2&=&x^2+y^2\\
\nonumber
&=&(A^2+C^2)\cos^2(\omega_0t)+(B^2+D^2)\sin^2\omega_0t+(AB+CD)\cos(\omega_0t)\sin(\omega_0t)\\
\nonumber
&=&\alpha+\beta\cos 2\omega_0 t+\gamma\sin 2\omega_0 t,\\
\alpha&=&\frac{A^2+B^2+C^2+D^2}{2},~~\beta=\frac{A^2-B^2+C^2-D^2}{2},~~\gamma=AB+CD,\\
r^2&=&\alpha+(\beta^2+\gamma^2)^{1/2}\cos(2\omega_0 t-\delta),~~~\delta=\arctan(\gamma/\beta),
\end{eqnarray*}
and see that the radius oscillates with frequency $2\omega_0$. The factor of two comes because the oscillation $x=A\cos\omega_0t$ has two maxima for $x^2$, one at $t=0$ and one a half period later.

\exampleend

\subsection{Stability of Orbits}

The effective force can be extracted from the effective potential, $U_{\rm eff}$. Beginning from the equations of motion, Eq. (\ref{eq:radialeqofmotion}), for $r$,
\begin{eqnarray}
m\ddot{r}&=&F+\frac{L^2}{mr^3}\\
\nonumber
&=&F_{\rm eff}\\
\nonumber
&=&-\partial_rU_{\rm eff},\\
\nonumber
F_{\rm eff}&=&-\partial_r\left[U(r)+(L^2/2mr^2)\right].
\end{eqnarray}
For a circular orbit, the radius must be fixed as a function of time, so one must be at a maximum or a minimum of the effective potential. However, if one is at a maximum of the effective potential the radius will be unstable. For the attractive Coulomb force the effective potential will be dominated by the $-\alpha/r$ term for large $r$ because the centrifugal part falls off more quickly, $\sim 1/r^2$. At low $r$ the centrifugal piece wins and the effective potential is repulsive. Thus, the potential must have a minimum somewhere with negative potential. The circular orbits are then stable to perturbation.

\begin{figure}
\centerline{\includegraphics[width=0.45\textwidth]{figs/Veff}}
\caption{\label{fig:Veff}The effective potential is sketched for two cases, a $1/r$ attractive potential and a $1/r^3$ attractive potential. The $1/r$ case has a stable minimum, whereas the circular orbit in the $1/r^3$ case is unstable.
}
\end{figure}
If one considers a potential that falls as $1/r^3$, the situation is reversed and the point where $\partial_rU$ disappears will be a local maximum rather than a local minimum -- see Fig. \ref{fig:Veff}. The repulsive centrifugal piece dominates at large $r$ and the attractive Coulomb piece wins out at small $r$. The circular orbit is then at a maximum of the effective potential and the orbits are unstable. It is the clear that for potentials that fall as $r^n$, that one must have $n>-2$ for the orbits to be stable.

\example
Consider a potential $U(r)=\beta r$. For a particle of mass $m$ with angular momentum $L$, find the angular frequency of a circular orbit. Then find the angular frequency for small radial perturbations.

{\bf Solution}:\\
For the circular orbit you search for the position $r_{\rm min}$ where the effective potential is minimized,
\begin{eqnarray*}
\partial_r\left\{\beta r+\frac{L^2}{2mr^2}\right\}&=&0,\\
\beta&=&\frac{L^2}{mr_{\rm min}^3},\\
r_{\rm min}&=&\left(\frac{L^2}{\beta m}\right)^{1/3},\\
\dot{\theta}&=&\frac{L}{mr_{\rm min}^2}=\frac{\beta^{2/3}}{(mL)^{1/3}}
\end{eqnarray*}
Now, we can find the angular frequency of small perturbations about the circular orbit. To do this we find the effective spring constant for the effective potential,
\begin{eqnarray*}
k_{\rm eff}&=&\partial_r^2 \left.U_{\rm eff}\right|_{r_{\rm min}}\\
&=&\frac{3L^2}{mr_{\rm min}^4},\\
\omega&=&\sqrt{\frac{k_{\rm eff}}{m}}\\
&=&\frac{\beta^{2/3}}{(mL)^{1/3}}\sqrt{3}.
\end{eqnarray*}
If the two frequencies, $\dot{\theta}$ and $\omega$, differ by an integer factor, the orbit's trajectory will repeat itself each time around. This is the case for the inverse-square force, $\omega=\dot{\theta}$, and for the harmonic oscillator, $\omega=2\dot{\theta}$. In this case, $\omega=\sqrt{3}\dot{\theta}$, and the angles at which the maxima and minima occur change with each orbit.

\exampleend

\subsection{Scattering and Cross Sections}

Scattering experiments don't measure entire trajectories. For elastic collisions, they measure the distribution of final scattering angles at best. Most experiments use targets thin enough so that the number of scatterings is typically zero or one. The cross section, $\sigma$, describes the cross-sectional area for particles to scatter with an individual target atom or nucleus. Cross section measurements form the basis for MANY fields of physics. BThe cross section, and the differential cross section, encapsulates everything measurable for a collision where all that is measured is the final state, e.g. the outgoing particle had momentum $\vec{p}_f$. y studying cross sections, one can infer information about the potential interaction between the two particles. Inferring, or constraining, the potential from the cross section is a classic {\it inverse} problem. Collisions are either elastic or inelastic. Elastic collisions are those for which the two bodies are in the same internal state before and after the collision. If the collision excites one of the participants into a higher state, or transforms the particles into different species, or creates additional particles, the collision is inelastic. Here, we consider only elastic collisions.

For Coulomb forces, the cross section is infinite because the range of the Coulomb force is infinite, but for interactions such as the strong interaction in nuclear or particle physics, there is no long-range force and cross-sections are finite. Even for Coulomb forces, the part of the cross section that corresponds to a specific scattering angle, $d\sigma/d\Omega$, which is a function of the scattering angle $\theta_s$ is still finite.

If a particle travels through a thin target, the chance the particle scatters is $P_{\rm scatt}=\sigma dN/dA$, where $dN/dA$ is the number of scattering centers per area the particle encounters. If the density of the target is $\rho$ particles per volume, and if the thickness of the target is $t$, the areal density (number of target scatterers per area) is $dN/dA=\rho t$. Because one wishes to quantify the collisions independently of the target, experimentalists measure scattering probabilities, then divide by the areal density to obtain cross-sections,
\begin{eqnarray}
\sigma=\frac{P_{\rm scatt}}{dN/dA}.
\end{eqnarray}
Instead of merely stating that a particle collided, one can measure the probability the particle scattered by a given angle. The scattering angle $\theta_s$ is defined so that at zero the particle is unscattered and at $\theta_s=\pi$ the particle is scattered directly backward. Scattering angles are often described in the center-of-mass frame, but that is a detail we will neglect for this first discussion, where we will consider the scattering of particles moving classically under the influence of fixed potentials $U(\vec{r})$. Because the distribution of scattering angles can be measured, one expresses the differential cross section,
\begin{equation}
\frac{d^2\sigma}{d\cos\theta_s~d\phi}.
\end{equation}
Usually, the literatures expresses differential cross sections as
\begin{equation}
d\sigma/d\Omega=\frac{d\sigma}{d\cos\theta d\phi}=\frac{1}{2\pi}\frac{d\sigma}{d\cos\theta},
\end{equation}
where the last equivalency is true when the scattering does not depend on the azimuthal angle $\phi$, as is the case for spherically symmetric potentials.

The differential solid angle $d\Omega$ can be thought of as the area subtended by a measurement, $dA_d$, divided by $r^2$, where $r$ is the distance to the detector,
\begin{eqnarray}
dA_d=r^2 d\Omega.
\end{eqnarray}
With this definition $d\sigma/d\Omega$ is independent of the distance from which one places the detector, or the size of the detector (as long as it is small).

Differential scattering cross sections are calculated by assuming a random distribution of impact parameters $b$. These represent the distance in the $xy$ plane for particles moving in the $z$ direction relative to the scattering center. An impact parameter $b=0$ refers to being aimed directly at the target's center. The impact parameter describes the transverse distance from the $z=0$ axis for the trajectory when it is still far away from the scattering center and has not yet passed it. The differential cross section can be expressed in terms of the impact parameter,
\begin{equation}
d\sigma=2\pi bdb,
\end{equation}
which is the area of a thin ring of radius $b$ and thickness $db$. In classical physics, one can calculate the trajectory given the incoming kinetic energy $E$ and the impact parameter if one knows the mass and potential. From the trajectory, one then finds the scattering angle $\theta_s(b)$. The differential cross section is then
\begin{equation}
\frac{d\sigma}{d\Omega}=\frac{1}{2\pi}\frac{d\sigma}{d\cos\theta_s}=b\frac{db}{d\cos\theta_s}=\frac{b}{(d/db)\cos\theta_s(b)}.
\end{equation}
Typically, one would calculate $\cos\theta_s$ and $(d/db)\cos\theta_s$ as functions of $b$. This is sufficient to plot the differential cross section as a function of $\theta_s$.

The total cross section is
\begin{equation}
\sigma_{\rm tot}=\int d\Omega\frac{d\sigma}{d\Omega}=2\pi\int d\cos\theta_s~\frac{d\sigma}{d\Omega}.
\end{equation}
Even if the total cross section is infinite, e.g. Coulomb forces, one can still have a finite differential cross section as we will see later on.

\example
An asteroid of mass $m$ and kinetic energy $E$ approaches a planet of radius $R$ and mass $M$. What is the cross section for the asteroid to impact the planet?

{\bf Solution}:\\
Calculate the maximum impact parameter, $b_{\rm max}$, for which the asteroid will hit the planet. The total cross  section for impact is $\sigma_{\rm impact}=\pi b_{\rm max}^2$. The maximum cross-section can be found with the help of angular momentum conservation. The asteroid's incoming momentum is $p_0=\sqrt{2mE}$ and the angular momentum is $L=p_0b$. If the asteroid just grazes the planet, it is moving with zero radial kinetic energy at impact. Combining energy and angular momentum conservation and having $p_f$ refer to the momentum of the asteroid at a distance $R$,
\begin{eqnarray*}
\frac{p_f^2}{2m}-\frac{GMm}{R}&=&E,\\
p_fR&=&p_0b_{\rm max},
\end{eqnarray*}
allows one to solve for $b_{\rm max}$,
\begin{eqnarray*}
b_{\rm max}&=&R\frac{p_f}{p_0}\\
&=&R\frac{\sqrt{2m(E+GMm/R)}}{\sqrt{2mE}}\\
\sigma_{\rm impact}&=&\pi R^2\frac{E+GMm/R}{E}.
\end{eqnarray*}
\exampleend

\subsection{Center-of-Mass Coordinates}

Thus far, we have considered the trajectory as if the force is centered around a fixed point. For two bodies interacting only with one another, both masses circulate around the center of mass. One might think that solutions would become more complex when both particles move, but we will see here that the problem can be reduced to one with a single body moving according to a fixed force by expressing the trajectories for $\vec{r}_1$ and $\vec{r}_2$ into the center-of-mass coordinate $\vec{R}_{\rm cm}$ and the relative coordinate $\vec{r}$,
\begin{eqnarray}
\vec{R}_{\rm cm}&\equiv&\frac{m_1\vec{r}_1+m_2\vec{r}_2}{m_1+m_2},\\
\nonumber
\vec{r}&\equiv&\vec{r}_1-\vec{r_2}.
\end{eqnarray}
Here, we assume the two particles interact only with one another, so $\vec{F}_{12}=-\vec{F}_{21}$ (where $\vec{F}_{ij}$ is the force on $i$ due to $j$. The equations of motion then become
\begin{eqnarray}
\ddot{\vec{R}}_{\rm cm}&=&\frac{1}{m_1+m_2}\left\{m_1\ddot{\vec{r}}_1+m_2\ddot{\vec{r}}_2\right\}\\
\nonumber
&=&\frac{1}{m_1+m_2}\left\{\vec{F}_{12}+\vec{F}_{21}\right\}=0.\\
\ddot{\vec{r}}&=&\ddot{\vec{r}}_1-\ddot{\vec{r}}_2=\left(\frac{\vec{F}_{12}}{m_1}-\frac{\vec{F}_{21}}{m_2}\right)\\
\nonumber
&=&\left(\frac{1}{m_1}+\frac{1}{m_2}\right)\vec{F}_{12}.
\end{eqnarray}
The first expression simply states that the center of mass coordinate $\vec{R}_{\rm cm}$ moves at a fixed velocity. The second expression can be rewritten in terms of the reduced mass $\mu$.
\begin{eqnarray}
\mu \ddot{\vec{r}}&=&\vec{F}_{12},\\
\frac{1}{\mu}&=&\frac{1}{m_1}+\frac{1}{m_2},~~~~\mu=\frac{m_1m_2}{m_1+m_2}.
\end{eqnarray}
Thus, one can treat the trajectory as a one-body problem where the reduced mass is $\mu$, and a second trivial problem for the center of mass. The reduced mass is especially convenient when one is considering gravitational problems because then
\begin{eqnarray}
\mu \ddot{r}&=&-\frac{Gm_1m_2}{r^2}\hat{r}\\
\nonumber
&=&-\frac{GM\mu}{r^2}\hat{r},~~~M\equiv m_1+m_2.
\end{eqnarray}
For the gravitational problem, the reduced mass then falls out and the trajectory depends only on the total mass $M$.

The kinetic energy and momenta also have analogues in center-of-mass coordinates. The total and relative momenta are
\begin{eqnarray}
\vec{P}&\equiv&\vec{p}_1+\vec{p}_2=M\dot{\vec{R}}_{\rm cm},\\
\nonumber
\vec{q}&\equiv&\mu\dot{\vec{r}}.
\end{eqnarray}
With these definitions, a little algebra shows that the kinetic energy becomes
\begin{eqnarray}
T&=&\frac{1}{2}m_1|\vec{v}_1|^2+\frac{1}{2}m_2|\vec{v}_2|^2\\
\nonumber
&=&\frac{1}{2}M|\dot{\vec{R}}_{\rm cm}|^2
+\frac{1}{2}\mu|\dot{\vec{r}}|^2\\
\nonumber
&=&\frac{P^2}{2M}+\frac{q^2}{2\mu}.
\end{eqnarray}
The standard strategy is to transform into the center of mass frame, then treat the problem as one of a single particle of mass $\mu$ undergoing a force $\vec{F}_{12}$. Scattering angles can also be expressed in this frame, then transformed into the lab frame. In practice, one sees examples in the literature where $d\sigma/d\Omega$ expressed in both the ``center-of-mass'' and in the ``laboratory'' frame.

\subsection{Rutherford Scattering}

This refers to the calculation of $d\sigma/d\Omega$ due to an inverse square force, $F_{12}=\pm\alpha/r^2$ for repulsive/attractive interaction. Rutherford compared the scattering of $\alpha$ particles ($^4$He nuclei) off of a nucleus and found the scattering angle at which the formula began to fail. This corresponded to the impact parameter for which the trajectories would strike the nucleus. This provided the first measure of the size of the atomic nucleus. At the time, the distribution of the positive charge (the protons) was considered to be just as spread out amongst the atomic volume as the electrons. After Rutherford's experiment, it was clear that the radius of the nucleus tended to be roughly 4 orders of magnitude smaller than that of the atom, which is less than the size of a football relative to Spartan Stadium.

\begin{figure}[!htb]
\centerline{\includegraphics[width=0.6\textwidth]{figs/rutherford}}
\caption{\label{fig:rutherford}
The incoming and outgoing angles of the trajectory are at $\pm\theta'$. They are related to the scattering angle by $2\theta'=\pi+\theta_s$.}
\end{figure}
In order to calculate differential cross section, we must find how the impact parameter is related to the scattering angle. This requires analysis of the trajectory. We consider our previous expression for the trajectory where we derived the elliptic form for the trajectory, Eq. (\ref{eq:Ctrajectory}). For that case we considered an attractive force with the particle's energy being negative, i.e. it was bound. However, the same form will work for positive energy, and repulsive forces can be considered by simple flipping the sign of $\alpha$. For positive energies, the trajectories will be hyperbolas, rather than ellipses, with the asymptotes of the trajectories representing the directions of the incoming and outgoing tracks. Rewriting Eq. (\ref{eq:Ctrajectory}),
\begin{equation}\label{eq:ruthtraj}
r=\frac{1}{\frac{m\alpha}{L^2}+A\cos\theta}.
\end{equation}
Once $A$ is large enough, which will happen when the energy is positive, the denominator will become negative for a range of $\theta$. This is because the scattered particle will never reach certain angles. The asymptotic angles $\theta'$ are those for which the denominator goes to zero,
\begin{equation}
\cos\theta'=-\frac{m\alpha}{AL^2}.
\end{equation}
The trajectory's point of closest approach is at $\theta=0$ and the two angles $\theta'$, which have this value of $\cos\theta'$, are the angles of the incoming and outgoing particles. From Fig. \ref{fig:rutherford}, one can see that the scattering angle $\theta_s$ is given by,
\begin{eqnarray}
\label{eq:sthetover2}
2\theta'-\pi&=&\theta_s,~~~\theta'=\frac{\pi}{2}+\frac{\theta_s}{2},\\
\nonumber
\sin(\theta_s/2)&=&-\cos\theta'\\
\nonumber
&=&\frac{m\alpha}{AL^2}.
\end{eqnarray}
Now that we have $\theta_s$ in terms of $m,\alpha,L$ and $A$, we wish to re-express $L$ and $A$ in terms of the impact parameter $b$ and the energy $E$. This will set us up to calculate the differential cross section, which requires knowing $db/d\theta_s$. It is easy to write the angular momentum as
\begin{equation}
L^2=p_0^2b^2=2mEb^2.
\end{equation}
Finding $A$ is more complicated. To accomplish this we realize that the point of closest approach occurs at $\theta=0$, so from Eq. (\ref{eq:ruthtraj})
\begin{eqnarray}
\label{eq:rminofA}
\frac{1}{r_{\rm min}}&=&\frac{m\alpha}{L^2}+A,\\
\nonumber
A&=&\frac{1}{r_{\rm min}}-\frac{m\alpha}{L^2}.
\end{eqnarray}
Next, $r_{\rm min}$ can be found in terms of the energy because at the point of closest approach the kinetic energy is due purely to the motion perpendicular to $\hat{r}$ and
\begin{equation}
E=-\frac{\alpha}{r_{\rm min}}+\frac{L^2}{2mr_{\rm min}^2}.
\end{equation}
One can solve the quadratic equation for $1/r_{\rm min}$,
\begin{equation}
\frac{1}{r_{\rm min}}=\frac{m\alpha}{L^2}+\sqrt{(m\alpha/L^2)^2+2mE/L^2}.
\end{equation}
We can plug the expression for $r_{\rm min}$ into the expression for $A$, Eq. (\ref{eq:rminofA}),
\begin{equation}
A=\sqrt{(m\alpha/L^2)^2+2mE/L^2}=\sqrt{(\alpha^2/(4E^2b^4)+1/b^2}
\end{equation}
Finally, we insert the expression for $A$ into that for the scattering angle, Eq. (\ref{eq:sthetover2}),
\begin{eqnarray}
\label{eq:scattangle}
\sin(\theta_s/2)&=&\frac{m\alpha}{AL^2}\\
\nonumber
&=&\frac{a}{\sqrt{a^2+b^2}}, ~~a\equiv \frac{\alpha}{2E}
\end{eqnarray}
The differential cross section can now be found by differentiating the expression for $\theta_s$ with $b$,
\begin{eqnarray}
\label{eq:rutherford}
\frac{1}{2}\cos(\theta_s/2)d\theta_s&=&\frac{ab~db}{(a^2+b^2)^{3/2}}=\frac{bdb}{a^2}\sin^3(\theta_s/2),\\
\nonumber
d\sigma&=&2\pi bdb=\frac{\pi a^2}{\sin^3(\theta_s/2)}\cos(\theta_s/2)d\theta_s\\
\nonumber
&=&\frac{\pi a^2}{2\sin^4(\theta_s/2)}\sin\theta_s d\theta_s\\
\nonumber
\frac{d\sigma}{d\cos\theta_s}&=&\frac{\pi a^2}{2\sin^4(\theta_s/2)},\\
\nonumber
\frac{d\sigma}{d\Omega}&=&\frac{a^2}{4\sin^4(\theta_s/2)}.
\end{eqnarray}
where $a= \alpha/2E$. This the Rutherford formula for the differential cross section. It diverges as $\theta_s\rightarrow 0$ because scatterings with arbitrarily large impact parameters still scatter to arbitrarily small scattering angles. The expression for $d\sigma/d\Omega$ is the same whether the interaction is positive or negative.

\example
Consider a particle of mass $m$ and charge $z$ with kinetic energy $E$ (Let it be the center-of-mass energy) incident on a heavy nucleus of mass $M$ and charge $Z$ and radius $R$. Find the angle at which the Rutherford scattering formula breaks down.

{\bf Solution}:\\
Let $\alpha=Zze^2/(4\pi\epsilon_0)$. The scattering angle in Eq. (\ref{eq:scattangle}) is
\[
\sin(\theta_s/2)=\frac{a}{\sqrt{a^2+b^2}}, ~~a\equiv \frac{\alpha}{2E}.
\]
The impact parameter $b$ for which the point of closest approach equals $R$ can be found by using angular momentum conservation,
\begin{eqnarray*}
p_0b&=&b\sqrt{2mE}=Rp_f=R\sqrt{2m(E-\alpha/R)},\\
b&=&R\frac{\sqrt{2m(E-\alpha/R)}}{\sqrt{2mE}}\\
&=&R\sqrt{1-\frac{\alpha}{ER}}.
\end{eqnarray*}
Putting these together
\[
\theta_s=2\sin^{-1}\left\{
\frac{a}{\sqrt{a^2+R^2(1-\alpha/(RE))}}
\right\},~~~a=\frac{\alpha}{2E}.
\]
It was from this departure of the experimentally measured $d\sigma/d\Omega$ from the Rutherford formula that allowed Rutherford to infer the radius of the gold nucleus, $R$.

\exampleend

\subsection{Exercises}

\begin{enumerate}

\item Approximate Earth as a solid sphere of uniform density and radius $R=6360$ km. Suppose you drill a tunnel from the north pole directly to another point on the surface described by a polar angle $\theta$ relative to the north pole. Drop a mass into the hole and let it slide through tunnel without friction. Find the frequency $f$ with which the mass oscillates back and forth. Ignore Earth's rotation. Compare this to the frequency of a low-lying circular orbit.

\item Consider the gravitational field of the moon acting on the Earth.
\begin{enumerate}
\item Calculate the term $k$ in the expansion
\[
g_{\rm moon}=g_0+kz+\cdots,
\]
where $z$ is measured relative to Earth's center and is measured along the axis connecting the Earth and moon. Give your answer in terms of the distance between the moon and the earth, $R_{m}$ and the mass of the moon $M_m$.
\item Calculate the difference between the height of the oceans at maximum and minimum tides. Express your answer in terms of the quantities above, plus Earth's radius, $R_e$. Then give you answer in meters.
\end{enumerate}

\item Consider an ellipse defined by the sum of the distances from the two foci being $2D$, which expressed in a Cartesian coordinates with the middle of the ellipse being at the origin becomes
\[
\sqrt{(x-a)^2+y^2}+\sqrt{(x+a)^2+y^2}=2D.
\]
Here the two foci are at $(a,0)$ and $(-a,0)$. Show that this form is can be written as
\[
\frac{x^2}{D^2}+\frac{y^2}{D^2-a^2}=1.
\]

\item Consider a particle in an attractive inverse-square potential, $U(r)=-\alpha/r$, where the point of closest approach is $r_{\rm min}$ and the total energy of the particle is $E$. Find the parameter $A$ describing the trajectory in Eq. (\ref{eq:Ctrajectory}). Hint: Use the fact that at $r_{\rm min}$ there is no radial kinetic energy and $E=-\alpha/r_{\rm min}+L^2/2mr_{\rm min}^2$.

\item Consider the effective potential for an attractive inverse-square-law force, $F=-\alpha/r^2$. Consider a particle of mass $m$ with angular momentum $L$.
\begin{enumerate}
\item Find the radius of a circular orbit by solving for the position of the minimum of the effective potential.
\item What is the angular frequency, $\dot{\theta}$, of the orbit? Solve this by setting $F=m\dot{\theta}^2r$.
\item Find the effective spring constant for the particle at the minimum.
\item What is the angular frequency for small vibrations about the minimum? How does this compare with the answer to (b)?
\end{enumerate}

\item Consider a particle of mass $m$ moving in a potential
\[
U=\alpha\ln(r/a).
\]
\begin{enumerate}
\item If the particle is moving in a circular orbit of radius $R$, find the angular frequency $\dot{\theta}$. Solve this by setting $F=-m\dot{\theta}^2r$ (force and acceleration point inward).
\item Express the angular momentum $L$ in terms of $\alpha$, $m$ and $R$. Also express $R$ in terms of $L$, $\alpha$ and $m$.
\item Sketch the effective radial potential, $V_{\rm eff}(r)$, for a particle with angular momentum $L$. (No longer necessarily moving in a circular orbit.)
\item Find the position of the minimum of $V_{\rm eff}$ in terms of $L$, $\alpha$ and $m$, then compare to the result of (b).
\item What is the effective spring constant for a particle at the minimum of $V_{\rm eff}$? Express your answer in terms of $L$, $m$ and $\alpha$.
\item What is the angular frequency, $\omega$, for small oscillations of $r$ about the $R_{\rm min}$?  Express your answer in terms of $\dot{\theta}$ from part (a).
\end{enumerate}

\item Consider a particle of mass $m$ in an attractive potential, $U(r)=-\alpha/r$, with angular momentum $L$ with just the right energy so that
\[
A=m\alpha/L^2
\]
where $A$ comes from the expression
\[
r=\frac{1}{(m\alpha/L^2)+A\cos\theta}.
\]
The trajectory can then be rewritten as
\[
r=\frac{2r_0}{1+\cos\theta},~~~r_0=\frac{L^2}{2m\alpha}.
\]
\begin{enumerate}
\item Show that for this case the total energy $E$ approaches zero.
\item Write this trajectory in a more recognizable parabolic form,
\[
x=x_0-\frac{y^2}{R}.
\]
I.e., express $x_0$ and $R$ in terms of $r_0$.
\item Explain how a particle with zero energy can have its trajectory not go through the origin.
\item What is the scattering angle for this trajectory?
\end{enumerate}

\item Show that if one transforms to a reference frame where the total momentum is zero, $\vec{p}_1=-\vec{p}_2$, that the relative momentum $\vec{q}$ corresponds to either $\vec{p}_1$ or $-\vec{p}_2$. This means that in this frame the magnitude of $\vec{q}$ is one half the magnitude of $\vec{p}_1-\vec{p}_2$.

\item Given the center of mass coordinates $\vec{R}$ and $\vec{r}$ for particles of mass $m_1$ and $m_2$, find the coordinates $\vec{r}_1$ and $\vec{r}_2$ in terms of the masses, $\vec{R}$ and $\vec{r}$.

\item Consider two particles of identical mass scattering at an angle $\theta_{\rm cm}$ in the center of mass.
\begin{enumerate}
\item In a frame where one is the target (initially at rest) and one is the projectile, find the scattering angle in the lab frame, $\theta$, in terms of $\theta_{\rm cm}$.
\item Express $d\sigma/d\cos\theta$ in terms of $d\sigma/d\cos\theta_{\rm cm}$. I.e., find the Jacobian, $d\cos\theta_{\rm cm}/d\cos\theta$.
\end{enumerate}

\item Assume you are scattering alpha particles (He-4 nuclei $Z=2, A=4$) off of a gold target ($Z=79, A=197$). If the radius of the nucleus is $7.5\times 10^{-15}$ meters, and if the energy of the beam is 38 MeV,
\begin{enumerate}
\item What is the total cross section for having a nuclear collision? Give the answer in millibarns, 1 mb$=10^{-31}$ m$^2$.
\item Find the scattering angle (in degrees) at which the Rutherford differential cross section formula breaks down?

\end{enumerate}
\end{enumerate}
%\end{document}