Showing posts with label pi. Show all posts
Showing posts with label pi. Show all posts

Contour Integration II: everything about singularities; what gives life to Pi

Stuff we'll cover in this article:

  • Residues as "climbing between the values of a multivalued antiderivative"
  • Winding numbers and the residue theorem
  • All residues are logarithmic residues: the Laurent series
  • "Proving Laurent series": Laurent series as Fourier series
  • How the residue theorem gives life to $\pi$



The story so far: if a function has no screw-up points within a closed contour, its integral on that contour is zero. But if it does, it may not be.

And by a screw-up point, we just mean a point at which the function isn't (or rather cannot be -- this is what we call a non-removable singularity) holomorphic.

But why? Let's look at the antiderivative of $1/z$ -- $\mathrm{log}(z)$. It's fundamentally a multivalued function -- and here's what's interesting: a loop around the origin isn't actually a loop on this graph -- it brings you to a higher level than you were previously (specifically $2\pi i$ higher than you were previously).


And you can kinda see why this comes about -- the derivative of this function not being holomorphic at 0 is encapsulated by the fact that the function is all torn up at 0 -- its slope must be different in different directions, because you have multiple planes stuck to that point. This is the idea behind a branch point -- a point such that the function is discontinuous when going about an arbitrarily small circuit about the point.

One can now start to see how integrals that do loop around the origin behave -- for starters, the winding number of the contour corresponds to the number of levels you climb during the integral. Also, the distance between levels should depend purely on the local nature of the function around the branch point (because the antiderivative has a defined derivative (the function $f$, in this case $1/z$), so the spacing must remain constant). By similar reasoning, encircling multiple poles means climbing all their levels (so the total distance climbed adds up).

This, above, is the residue theorem. For a function $f$, a simply connected open set $U$ such that $f$ is holomorphic on $U-\{a_1,\dots a_k\}$, and a closed contour $\gamma$ contained in this punctured set:

$$\oint_\gamma f(z) dz = \sum_{k=1}^n \mathrm{W}(\gamma, a_k)\mathrm{Res}(f,a_k)$$
Where $\mathrm{Res}(f,a)$ is the residue of $f$ at $a$, which is the "local quantity" that equals the "distance between layers" of the multivalued antiderivative.

This is, obviously, awesome. But thinking about generally handling and computing these residues $\mathrm{Res}(f,a)=\oint_{\circ}f(z)dz$ leads us to wonder about the general nature of branch cuts.



Here's an idea: we know exactly what the residue for $f(z)=z^{-1}$ at 0 is -- it's $2\pi i$. One also easily sees that the residue of $f(z)=z^n$ for any other $n$ is zero (the antiderivative $z^{n+1}/(n+1)$ does not have branch cuts).

I wonder if -- like how Taylor series allow us to represent a function near a general point $a$ as a sum of $(z-a)^n$s for nonnegative $n$ -- we could represent a function near a singularity $a$ as a sum of $(z-a)^n$s for all integer $n$s.

I wonder if all "serious" singularities are just ultimately $1/z^k$-style singularities.

This is, in fact, what is known as the Laurent series -- a representation $f(z)=\sum_{n=-\infty}^\infty c_n (z-a)^n $. Then the distance climbed by $f(z)$ is equal to the distance climbed by the $(z-a)^{-1}$ term, which is just $2\pi i c_{-1}$.

So the point of this "Laurent series interpretation" of the residue is this:

  1. The key conceptual takeaway from the Laurent series is that all branch cuts of the antiderivatives of holomorphic functions are "logarithmic". (This does not, e.g. apply to the branch cut of $\sqrt{z}$, as its derivative isn't holomorphic.)
  2. When actually calculating residues, we can find the Laurent series by other means (such as by patching together different Taylor series) and use its $c_{-1}$ coefficient as the residue.

But to actually "prove" this interpretation means to:
  1. Write down what its coefficients should be -- this is our candidate series which justifies using it to calculate residues. 
  2. Show that this candidate is a valid Laurent series, i.e. that it actually converges to $f(z)$ on some region.
  3. Show that it is the valid Laurent series, i.e. that the Laurent series is unique. So we can calculate the Laurent series however we want and use its coefficients to calculate residues. 

The Laurent series is not the Taylor series, and the nonnegative coefficients of the Laurent series are not generally the coefficients of the Taylor series. So its coefficients cannot be interpreted as higher derivatives of the function or anything (that doesn't even make sense at that point).

The first one is easy. Obviously we need ${c_{ - 1}} = \frac{1}{{2\pi i}}\oint_\circ  {f(z)\,dz}$. Analogously by considering this expression for the function $\frac{{f(z)}}{{{{(z - a)}^{n + 1}}}}$ to extract the other coefficients, we see that:

$${c_n} = \frac{1}{{2\pi i}}\oint_\circ  {\frac{{f(z)}}{{{{(z - a)}^{n + 1}}}}\,dz} $$
The second and third are actually challenging -- but there's a remarkable fortunate observation one can make. The fact that the Laurent series is defined on an annulus (each of the power series has a radius of convergence, which puts a maximum bound on both $z$ and $|z|$) is incredibly suggestive of describing a periodic function. Indeed, a variable substitution $z=\rho e^{i\theta}$ turns the Laurent series into a Fourier series. The properties 2 and 3 then follow from properties of the Fourier series.

This "Fourier series" interpretation of the Laurent series also makes it easy to see Cauchy's integral formula and holomorphicity implies analyticity.



By the way, I would argue that the notion of a residue and the Laurent series is the fundamental source of the importance of $\pi$. Perhaps the standard motivation for $\pi$ is that $2\pi i$ is the period of the exponential function. This is equivalent to saying it's the residue of the logarithm function. The existence of Laurent series expansions -- i.e. all branch cuts being logarithmic in nature -- is what gives importance to these residues.

Exercise: prove the Cauchy differentiation formula -- for a holomorphic function $f$,
$$f^{(n)}(a)=\frac{n!}{2\pi i}\oint_\gamma \frac{f(z)}{(z-a)^{n+1}}dz $$

Pi and collisions (the 3blue1brown problem)

Unless you've been living under a rock, you've probably heard of this problem -- perhaps from 3blue1brown (link) -- we have a wall (i.e. a thing with infinite mass), and two rocks of mass $m$ and some large multiple $Nm$. The smaller mass $m$ starts out stationary, while $Nm$ has some velocity $w$ in the direction towards the wall. The collisions are elastic. The question is to count the number of collisions there are as $N\to\infty$ (i.e. it approaches the rock you were living under) -- as Grant Sanderson (mysteriously, via some fancy thing he calls "digits of a number") tells us in the video, it approaches $\pi\sqrt{N}$.

If you haven't watched the linked problem video (the solution isn't revealed in it), you should -- the animations are great. I'll assume in this answer you have a full understanding of what the problem is. Not a tall order.

I could actually give you a picture proof right now -- the solution is that amazing -- but I won't. Let's build our insight up to it, so when you see it, you are ready.

The moment I think of $\pi$, I think of circles. Well, where are the circles here (besides my shoddy drawings of the two balls)? Here's another thing to think about: how do you solve for any result of a collision? You consider conservation of momentum and energy, of course. Aha, that should click in your mind -- conservation of energy is sort of like a circle, it's an ellipse! The condition:

$$\frac12mv_m^2+\frac12Nmv_{Nm}^2=\frac12Nmw^2$$
Is the equation for an ellipse. And conservation of momentum is the equation for a line. But there are two sorts of collisions that can occur in this system: collisions between $m$ and $Nm$, and collisions between $m$ and $\infty$. The former conserves momentum, the latter does not (I mean, the law isn't violated, but the momentum of just the two balls together isn't conserved -- it is transferred to the wall). Respectively under the two collisions, we have:

$$mv_m+Nmv_{nm}=C\\
Nmv_{Nm}=C$$
Now, the idea we have is that when we impose conservation of energy and momentum, we are solving for the intersection points of the ellipse and the line -- one intersection point is the pre-collision configuration of velocities, and the other is the one after collision. So the idea we have in our mind is that of a bunch of lines, each corresponding to a different momentum value (because that is not conserved) intersecting a single ellipse, and we want to count the number of intersections.



The key idea here is that the collisions, as they occur in real time, correspond to the bouncing of an object off the ellipse as it moves across the lines -- first across the slanted blue line, bouncing off the ellipse, then across the red line, then bouncing off the ellipse onto the green line, then the other blue line, and then its last collision.

However, to say this with confidence, we need to be sure that we can really map every collision onto an intersection in the velocity space above, we need the following lemma:


Lemma: Among the inter-collision periods, any given configuration of velocities occurs no more than once, i.e. the velocity space configurations are unique (so there is a bijection (well, the surjection is obvious) between the intersections and the collisions).

Proof:
Case 1: the number of collisions is finite (why do I make these my cases? Because the first argument I thought of requires this assumption, so let's consider the other possibility separately). If a given velocity configuration occurs again, then the system will have to repeat itself (so there will be an infinite number of collisions). Why?

Because the number of collisions from a point in time onwards depends only on the configuration of velocities at that point in time (think about why this is true -- specifically, it does not depend on the distance between the masses, or between the masses and the wall -- is this true when you have more than two masses? But don't we actually have three masses here, counting the wall? So it matters if the masses are mobile. Why? What do mobile things do different that immobile things don't).

Case 2: we don't even need the finiteness assumption. We know the velocity (not speed) of $Nm$ is non-decreasing (with sign convention of right being positive). Suppose it stabilises at 0. Then both walls have stabilised at 0, and the collisions must be finitely many. Suppose it doesn't. Then the velocity is continually changing as it hits the smaller ball (if their velocities become equal -- "worldlines become parallel" -- then there must have been only finitely many collisions), so each configuration is unique.


Ok, so we need to find the number of intersections between the ellipse with radii $v$ and $v\sqrt{N}$, and the lines, with slope $-1/N$. Truth be told, I spent a lot of time staring at the diagram at this point, having no way of how to proceed. And so should you.

One thing is easy to see here, which is that the answer is something times $\sqrt{N}$, i.e. it goes to infinity at the rate $\sqrt{N}$ as $N$ goes to infinity. Why is this easy to see?

Here's how I found the realisation: there are two ways to find $\pi$ in something -- by looking at circles' areas and lengths, or by looking at angles. I had exhausted everything I could looking at lengths (and again, you should too), so let's think about angles. Let's read the angles between the lines.

Well, first, let's scale the diagram so the ellipse becomes a circle -- let's make it a unit circle. This is good, because now the slope of the lines becomes $-1/\sqrt{N}$, which means there's only one crazy diverging infinite term to bother about -- rather than an infinite ellipse going crazy and an infinite number of infinite line segments each going infinitely crazy.

Why is such a scaling okay? Because the number of intersections is invariant under a scaling. There are other things, like distances, that aren't invariant (which is why finding the perimeter of an ellipse is quite hard). What things are invariant? Why?

Each of these angles is clearly $\arctan(1/\sqrt{N})$. The key is to think about the sum of these angles. You might see the trick -- I do quite like it when a funny geometric argument comes out in some bizarre space, a velocity space here, in a physics proof -- and it's "angles in the same segment are equal".

So the sum of those angles approaches the angle subtended by that big chord. What is that big chord? I wonder if it has a name. Well, as $N$ approaches infinity, the chord approaches the diameter, and that angle approaches $\pi/2$. There's another $\pi/2$ from the angles on the other side, so the total of the angles at all intersections is $\pi$.

(Great, another fact from elementary high-school geometry.)

So the total number of angles/intersections/collisions is $\frac{\pi}{\arctan(1/\sqrt{N})}$, which as $N\to\infty$, is the same thing as $\pi\sqrt{N}$.

Which is great. It's just great.