\chapter{Branch cuts (04/10/2008)}
\label{c2}

We have introduced multifunctions previously. We now treat branch cuts.

\section{Branch cuts}

First, we call a branch point of $f$ a point in $\Cset$ around which the
function $f$ does not return to its original value as we trace out a
closed curve. Typical example: the origin for $\sqrt{z}$ or
$\log{z}$. In fact infinity is also a branch point for both these
functions, and for geometrical reasons, there has to be more than one
branch point for a function. This notion of treating infinity on a par
with other points has already come up when the Riemann sphere was
mentioned.

\begin{quasitheorem}
  Anything that can be done with a function $f(z)$ at a point $z$ in
  $\Cset$ can be done with the point at infinity by setting $t =
  z^{-1}$ and proceeding as usual.
\end{quasitheorem}

Then a branch cut is an arbitrary curve in $\Cset$ joining two branch
points. We have enormous freedom in how we pick a cut, so we have
replaced a multifunction by an infinite family of functions with
different branch cut structures. In addition to the curve, we must
pick a branch by specifying the value of the function at a point
somewhere. From a computer science perspective, a branch of a function
is an abstract data structure including $f$, the topology of the cuts
and the value chosen for $f(z_0)$. This is more than we want to deal
with usually, so we will try to be efficient.

Note that in physical problems, the complex plane is a place we visit
to find a solution that must be expressed in terms of real
numbers.\footnote{This is an approximation of course: continuum
  mechanics does not hold at the molecular scale and below. More
  abstrusely, it is sometimes suggested that all lengths in the
  universe or time intervals are discrete multiples of some
  fantastically small fundamental units. Who knows?} Hence the answer
we find cannot depend on the particular choice of branch cut topology
we use.

\begin{warning}
If the final, physical, answer you find depends on the branch cuts you
have picked, you have probably made a mistake. This does not mean that
different parts of your solution can depend on the branch cuts cannot
individually depend on the branch cuts (leaky waves and so on). The
final answer cannot.
\end{warning}

This also does not hold if one is using a complex function to represent a
discontinuous real function. But there the branch cut was not picked
arbitrarily as part of the method of solution; it came from the
physics.


\section{Matlab implementation}

The prototypical multifunctions are the square root and logarithm
functions. They are of course related, since $\sqrt{z} =
\exp{(\half\log{z})}$. Let's look at the the imaginary part of
$\sqrt{z}$ in Matlab. The code of program {\tt p21.m}: calculates
$\sqrt{z}$ in a square of the complex plane and produces a surface
plot of the output, as shown in Figure~\ref{f21}.

\progbox{p21.m}

\begin{figure}
\begin{center}
\includegraphics[width=4in]{f21.pdf}
\caption{Contour plot of the imaginary part of $\sqrt{z}$ using the
  native Matlab branch cut.}
\label{f21}
\end{center}
\end{figure}

We see a discontinuity along the negative real. In fact, Matlab is
using the principal branch of the logarithm, which can't be seen in
Figure~\ref{f21}. To verify this, type {\tt log(-1)} in Matlab and
obtain {\tt 0 + 3.1416i}, corresponding to the principal branch of
axis and values between $-\pi$ and $\pi$.

This is fine, but what if we want a different branch cut? Straight
branch cuts are very easy. The point about the Matlab branch is that
the cut is along $z = -x$ for positive real $x$. Hence the function
$g(z) = \ee^{-\ci\alpha/2} \sqrt{z \ee^{\ci\alpha}}$, which is
certainly a solution of $g(z)^2 = z$, has a branch cut when $z = -x
\ee^{-\ci\alpha}$, i.e.~along a ray making angle $-\alpha$ with the
real axis. So if we replace {\tt sqrt(z)} by {\tt
  exp(i*pi/5)*sqrt(z*exp(-2*i*pi/5))}, we obtain a branch cut at
making an angle of $2\pi/5$.

For curved branch cuts, we are out of luck. One has to write a program
that sets the argument of the logarithm or other multifunction by
hand.

\section{More complicated branch cut structures}

The more branch points, the more branch cuts and the more ways of
joining them up:
\begin{exercise}
How many ways are there of choosing branch cuts that are topologically
distinct for $n$ branch points?
\end{exercise}
Certain functions recur again and again in physical problems, the most
common being $\beta(z) = \sqrt{z^2 - 1} = \sqrt{z - 1}\sqrt{z + 1}$
and $\gamma(z) = \sqrt{z^2 + 1} = \sqrt{z - \ci}\sqrt{z +
  \ci}$. Actually these equalities are not necessarily true in Matlab,
in the sense that one can calculate left-hand and right-hand sides and
obtain different answers. Let's have some new notation.
\begin{warning}
We will use the symbol $\Ceq$ to denote an equality that is true for
complex numbers or functions, but not necessarily for the results of a
Matlab calculation; e.g.
\begin{equation}
\log{xy} \Ceq \log{x} + \log{y}.
\end{equation}
\end{warning}

Let's look at $\beta(z) = sqrt{z^2 - 1}$. The way to handle this is to
think of a length of string tied to nails at $\pm 1$. Start on the
real axis at $x > 1$. We need to pick a branch and the sensible one is
real and positive. Then we go around the branch cut, as if we had a
pencil keeping the string drawn taut. The complex number $z-1$ can be
thought of as a vector from $1$ to $z$, so on the positive real axis
it initially has argument $\theta_1 = 0$. The complex number $z+1$ is
a vector from $-1$ to $z$, once again initially with argument
$\theta_{-1} = 0$. As the tip of the pencil moves to be just above the
branch cut, the argument of $z-1$ increases to $2\pi$. As it moves
further left beyond the branch cut, the argument of $z+1$ now changes
to $\pi$. The pencil tip now loops around to be under the branch cut:
the argument of $z+1$ has increased to $2\pi$. Finally the pencil tip
reappears to the right and the argument of $z-1$ increases to
$2\pi$. We use the result $\beta(z) = \sqrt{|z^2-1|} \ee^{\ci(\theta_1
  + \theta_{-1})/2}$. Combining the results we get positive real
values on the positive real axis $x>1$, negative real values on the
negative real axis $x<-1$, positive imaginary above the branch cut,
negative imaginary below the real axis. Note that this function
depends only on $z^2$, but $f(z) \neq f(-z)$ for real $|z| > 1$.
\begin{warning}
Complex functions with branch cuts do not always have the symmetry
properties you might expect.
\end{warning}

The Matlab code in {\tt p22.m} gives the picture in
Figure~\ref{f22}. The top row uses the function {\tt sqrt(z.\^{}2-1)}
which is not the correct branch cut. Solving $z^2 - 1 = -x^2$ gives $z
= \sqrt{1-x^2}$; this is for $x>0$, so the branch cut contains parts
of the imaginary axis as well as the real axis. The bottom row uses
{\tt sqrt(z-1).*sqrt(z+1)}. Now the branch cuts are at $z \pm 1 =
-x^2$, and the portion left of $-1$ cancels, leaving the branch cut
between $-1$ and $1$ as desired. The right-hand column shows the
imaginary part, which vanishes on the real axis outside the branch
cuts and does not show the antisymmetry on the real axis so obviously.

\begin{figure}
\begin{center}
\includegraphics[width=4in]{f22.pdf}
\caption{Contour plot of the real and imaginary part of $\beta(z)$
  using several different branch cuts.}
\label{f22}
\end{center}
\end{figure}

The functions $\beta(z)$ and $\gamma(z)$ is commonly encountered in
wave propagation problems for monochromatic waves (Helmholtz-type
equations). If the function under consideration is an inverse
transform, the presence of singularities on the inversion contour, the
real axis, is usually a warning of some kind of causality or radiation
condition. It is usually safer to add a small imaginary part to take
the singularity off the real axis.

\begin{example}
The function $|z|_\epsilon = \lim_{\epsilon \to 0} \sqrt{z^2 +
  \epsilon^2}$ is encountered quite often in the solution of Laplace's
equation. Of course $|z$ is a non-analytic function (check the
Cauchy--Riemann equations or go from the definition). However, one can
use it by thinking of the limit. This function is analytic in the
strip $-\epsilon < \Im\;z < \epsilon$, and then arguments of
analyticity are OK in that strip.
\end{example}

By analogy with {\tt p22.m}, a branch of the function $\gamma(z)$ can
be chosen which is real and positive on the positive real axis and has
a branch cut between $-\ci$ and $\ci$. This uses the code {\tt
  z.*sqrt(1+1./z.\^{}2)}. However this is not the appropriate branch
to deal with an inverse transform, since it intersects the inversion
contour. Possible branch cut structures are cuts along the imaginary
axis with $|\Im\;z|> 1$, using {\tt sqrt(z.\^{}2+1)}, and cuts
parallel to the real axis in the left half-plane, using {\tt
  sqrt(z-i).*sqrt(z+i)}. Finally one can construct very strange cuts
with code like {\tt sqrt(z+i).*sqrt(z).*sqrt(-i./z+1)}: imaginary axis
between $-1$ and $1$, negative real axis, horizontal line going left
from $-1$.. These possibilities are shown in {\tt p23.m} and in
Figure~\ref{f23}.

\begin{figure}
\begin{center}
\includegraphics[width=4in]{f23.pdf}
\caption{Contour plot of the imaginary part of $\gamma(z)$ using two
  different branch cuts.}
\label{f23}
\end{center}
\end{figure}

As seen in {\tt p22.m}, branch cuts can cancel in a nice way. Typical
examples occur in linear elasticity problems:
\begin{example}
The function $f(z) = \sqrt{z^2+1}\sqrt{z^2+k_0^2}$, where $k_0 > 1$,
has a nice branch cut structure.

IN CLASS

\end{example}


\begin{exercise}
Work out the branch cut structure of
\begin{equation}
f(z) = \sqrt{z + \sqrt{z^2+1}}.
\end{equation}
Be as explicit as possible. Think about how the Riemann sheet
structure stitches together.
\end{exercise}

\section{Integrals}

\subsection{Keyholes and hamburgers}

Branch cuts are critical in calculating certain integrals using
residues.\footnote{Richard Feynmann's proud claim that he could do any
  integral without using residues always struck me as depressing: contour
  integrals are so enjoyable.}

The following integral can be done without branch cuts,but we'll use a
cut here:
\begin{equation}
I = \int_0^\infty \frac{x^2}{1+x^5} \,\dd x.
\end{equation}
The integrand has no good symmetry properties on the real axis,
although it does well along the ray making an angle $2\pi/5$ from the
axis. So one approach is to go out along the real axis and come back
along the arc making angle $2\pi/5$ with the real axis. The result is
$\pi/5\sin{(2\pi/5)}$.

Consider
\begin{equation}
I_C = \int_C \frac{z^2 \log{z}}{1+z^5} \,\dd z.
\end{equation}
We have introduced a multifunction. Take the branch cut along the
positive real axis, with $\log{z}$ real along the top of the real axis
(and hence with imaginary part $2\pi\ci$ along the bottom of the
positive real axis. The ``keyhole'' contour $C$ goes along the top of
the positive real axis to $R$, swings around a large circle, and then
back along the bottom of the positive real axis. Since $\log{z}$ is
integrable near the origin, we need not bother with little circles
about the origin in our policy of efficiency. The integrand is
$O(R^{-5})$ for large $R$, which immediately shows that the
contribution from the large circle vanishes. There are simple poles at
the five fifth roots of $-1$: $\ee^{\pi\ci/5}$, $\ee^{3\pi\ci/5}$,
$\ee^{5\pi\ci/5}$ $\ee^{7\pi\ci/5}$ and $\ee^{9\pi\ci/5}$ (the choice
of arguments is set by the choice of branch). Hence
\begin{eqnarray}
I_C & = & 2\pi\ci \left( \ee^{2\pi\ci/5} \frac{\pi\ci/5}{5
    \ee^{2\pi\ci/5}} + \ee^{6\pi\ci/5} \frac{3\pi\ci/5}{5
    \ee^{6\pi\ci/5}} + \ee^{10\pi\ci/5} \frac{5\pi\ci/5}{5
    \ee^{10\pi\ci/5}} + \ee^{14\pi\ci/5} \frac{7\pi\ci/5}{5
    \ee^{14\pi\ci/5}} \right. \nonumber \\
& & \left. + \ee^{18\pi\ci/5} \frac{9\pi\ci/5}{5
    \ee^{18\pi\ci/5}} \right) \nonumber \\
& = & 2\pi\ci \left(\frac{\pi\ci}{25} \right) [ 20 c^2 + 10 c -
  5 + 8\ci s(1-c)],
\end{eqnarray}
where we have written $s$ and $c$ for the sine and cosine of $2\pi/5$
respectively. Taking appropriate limits and nothing that $\log{z} =
\log{|z}| + 2\pi\ci$ along the underside of the real axis, we find
\begin{equation}
I_C = \int_0^R \frac{x^2 \log{x}}{1+x^5} \,\dd x + \int_R^0 \frac{x^2
  (\log{x} + 2\pi\ci)}{1 + x^5} \,\dd x + O(R^{-4})
\end{equation}
for large $R$. The logarithmic terms cancel and leave us with
$-2\ci\pi I$ as $R \to \infty$. Equating these results gives
\begin{equation}
I = -\frac{\pi\ci}{25} [ 20 c^2 + 10 c - 5 + 8\ci s(1-c)].
\end{equation}
Now we need to simplify this result. The imaginary part vanishes, so
$c^2 = -\half c + \frac{1}{4}$. Hence
\begin{equation}
I = \frac{8\pi}{25} s(1-c) = \frac{8\pi}{25s} (1-c^2)(1-c) =
\frac{8\pi}{25s} (\textfrac{3}{4} + \half c)(1-c) = \frac{8\pi}{25s}
(\textfrac{3}{4} - \textfrac{1}{4}c -\half c^2) = \frac{\pi}{5s}
\end{equation}
as before.

Now consider
\begin{equation}
I = \int_1^\infty \frac{\dd x}{(x-\textfrac{1}{2})\sqrt{x(x-1)}}.
\end{equation}
The singularity at $x = 1$ is integrable. Consider
\begin{equation}
I_C = \int_C \frac{\dd z}{(z-\textfrac{1}{2})z\sqrt{z(z-1)}} \,\dd z
\end{equation}
with branch cuts from $1$ to infinity along the positive real axis and
from $0$ to minus infinity along the negative real axis. We take the
branch that is real and positive on top of the positive real axis. The
contour goes out from $1$ along the top of the real axis to $R$, loops
around a semicircle to $-R$, back along the top of the negative real
axis to $0$, back out along the bottom of the negative real axis to
$-R$, semicircle back to $R$ and returns to $1$ along the bottom of
the positive real axis. This is the ``hamburger'' contour. We don't
bother with little circles or indentations around $1$ and $0$: the
singularity is integrable so there will be on contribution. Similarly,
for large $R$, the contributions from the large semicircle is
$O(R^{-1})$ and goes away. Paying close attention to the cuts, we find
\begin{equation}
I_c =  2 \int_1^\infty \frac{\dd x}{(x-\textfrac{1}{2})\sqrt{x(x-1)}}
+ 2 \int_0^\infty \frac{\dd y}{(y+\textfrac{1}{2})\sqrt{y(y+1)}} = 4I
\end{equation}
after a simple change of variable. Now there is a simple pole at $z =
\half$, with residue $2$. Hence $I = \pi$. Note that if we move that
pole, the result cannot be obtained this way because there is no
longer the required symmetry to express $I_c$ purely in terms of $I$.

\subsection{Branch cuts and integrating around infinity}

Consider
\begin{equation}
I = \int_{-1}^1 \frac{1}{(1+x^2)\sqrt{1-x^2}} \,\dd x.
\end{equation}
Consider $I_c$ with the obvious integrand, branch cut between $-1$ and
$1$ with positive real values along the top of the branch cut. This is
non-standard. Take the contour to go around the branch cut in the
positive sense. Again we don't bother indenting around the ends of the
branch cut since the singularities are integrable. Along the top of
the cut, we obtain $\ci I$, and ditto along the bottom. Now think
about deforming the contour. As it grows larger, we have an estimate
$O(R^{-2})$. Hence the integral around infinity vanishes. However,
there are two poles in the complex plane at $z = \pm\ci$ that are
moved through to deform the contour to infinity. Hence
\begin{equation}
I = \half I_c = \pi\ci \left( \frac{1}{2\ci\sqrt{2}} +
  \frac{1}{(-2\ci)\ci(-\sqrt{2})} \right) = \frac{\pi}{\sqrt{2}},
\end{equation}
where one has to be careful with the arguments of the square
roots. This technique of deforming the contour to go around infinity
also works well for more complicated integrals.
