Skip to content
← Back

Stokes phenomena

In 1850, George Gabriel Stokes -- an Irish mathematician and physicist -- set out to study the asymptotics of the Airy function. In doing so, he observed an incredibly strange behavior, now called the Stokes phenomenon.

The goal of this article is to explain what Stokes discovered. To do that, we first need to explain what the Airy function is, what it means to study its asymptotics, and why Stokes was doing this.

As a sneak peak, you can play with the widget below to see if you observe anything strange. But the entirety of this article is meant to explain what you're looking at below.

Airy Stokes diagram

Click or drag to move z.

Ai″(z) = z Ai(z)
Stokes jump Branch cut
z
Ai(z)
SectorApproximationValueRel. error

The Airy function

In a lot of these articles, to give an interesting explanation of some mathematical phenomenon, we have to invent some pseudo-history of how the phenomenon could have been discovered. But with the Stokes phenomenon, we don't need to guess: in his paper On the Numerical Calculation of a Class of Definite Integrals and Infinite Series, Stokes tells us!

The story begins with George Biddell Airy, an English mathematician and astronomer. Airy was trying to study the mathematics of rainbows. In this article, we won't go into the physics of rainbows -- instead focusing more on Stokes' work -- but we will briefly say what Airy was up to.

You've surely seen a rainbow before. However, you might not have seen a supernumerary rainbow. A supernumerary rainbow is a rare natural phenomena, where after the usual red-orange-yellow-green-blue-indigo-violet bands of a rainbow, additional, fainter bands appear.

A supernumerary rainbow exhibiting interference fringes inside the primary bow.
A supernumerary rainbow, photographed by Johannes Bahrdt (CC BY-SA 4.0).

Descartes' theory of optics was able to explain ordinary rainbows, but not supernumerary rainbows. Airy was attempting to make a theory of optics that would explain these extra bands. His theory predicted that the sizes of the different bands of the supernumerary rainbow could be calculated using what is now called the Airy function, \[\operatorname{Ai}(x) = \frac{1}{\pi}\int_0^{\infty} \cos\left(\frac{t^3}{3} + xt\right) \, dt.\]

So, the name of the game in understanding rainbows is to calculate that integral. Unfortunately, that integral has no closed form answer, which makes evaluating it -- and hence verifying that Airy's theory agrees with observation! -- quite difficult.

This is where Stokes steps in: he found a way to quickly calculate this integral. And his method ended up applying not just to Airy's integral, but to a huge number of related functions. So, let's see what he did!

Approximations

We're trying to approximate \[\operatorname{Ai}(x) = \frac{1}{\pi}\int_0^{\infty}\cos\left(\frac{t^3}{3}+xt\right) \, dt.\]

The most naive way to approximate a function is to take its Taylor expansion. To compute the Taylor expansion, one needs to know all the higher derivatives of \(\operatorname{Ai}(x).\) Fortunately, those aren't so hard to calculate, since we can interchange differentiation and integration to get \[\operatorname{Ai}'(x) = \frac{1}{\pi}\int_0^{\infty} \frac{d}{dx}\cos\left(\frac{t^3}{3} + xt\right) \, dt,\] which the chain rule simplifies to \[\operatorname{Ai}'(x) = \frac{1}{\pi}\int_0^{\infty} -t\sin\left(\frac{t^3}{3} + xt\right) \, dt.\]

If we differentiate again, we get \[\operatorname{Ai}''(x) = \frac{1}{\pi}\int_0^{\infty} -t^2\cos\left(\frac{t^3}{3} + xt\right) \, dt.\] At this point, it might seem we have to go on differentiating forever, and that each derivative we get will be an even stranger looking integral. However, this new integral can actually be simplified.

If you click here, you can see the full algebra, but the end result is \[\operatorname{Ai}''(x) = \frac{x}{\pi}\int_0^{\infty}\cos\left(\frac{t^3}{3}+xt\right) \, dt\].

The trick is essentially integration by parts: \[\frac{d}{dt}\sin\left(\frac{t^3}{3} + xt\right) = (t^2+x)\cos\left(\frac{t^3}{3}+xt\right),\] so that \[\operatorname{Ai}''(x) = \frac{x}{\pi}\int_0^{\infty} \cos\left(\frac{t^3}{3}+xt\right) \, dt - \frac{1}{\pi}\left[\sin\left(\frac{t^3}{3}+xt\right)\right]^{\infty}_0.\] The boundary term is oscillatory, and one has to be a little careful about handling it formally, but it ends up being OK to neglect.

Thus \[\operatorname{Ai}''(x) = x\operatorname{Ai}(x),\] so that \(\operatorname{Ai}(x)\) obeys a very simple ODE.

I want to emphasize something rather unusual here: usually in physics, one describes the natural world in terms of differential equations, and then one has to solve the differential equation to get the answer. But Airy actually derived his integral from a direct calculation, without doing any differential equations. So, in some sense we're doing the reverse of how physics usually goes: nature has given us a function, and we went backwards and found a differential equation it solves!

Remember that we're trying to find some formula for the Airy function. This Airy equation, \[f''(x) = xf(x),\] is an example of a linear ODE with polynomial coefficients; here the 'coefficients' are 1 (the coefficient on \(f''(x)\)) and \(x\) (the coefficient on \(f(x)\)). So, we can hope that the theory of ODEs might give us a way to quickly write down a closed form for \(\operatorname{Ai}(x).\)

In a first course on differential equations, one of the first thing you'll learn to solve is linear ODEs with constant coefficients. For example, the equation \[g''(x) - 4g(x) = 0\] has solutions of the form \[g(x) = Ae^{2x} + Be^{-2x}\] where \(A, B\) are constants; that is, the original differential equation has a two-parameter family of solutions, all of which are of the form something times \(e^{2x}\) plus something times \(e^{-2x}.\) So, one might hope that we can similarly write down an 'easy' solution to \[f''(x) - xf(x) = 0,\] and hence express the Airy function in terms of well-understood functions.

Which exponential functions \(f(x) = e^{S(x)}\) solve our ODE? Substituting this expression into the ODE, the equation \[f''(x) = xf(x)\] turns into \[S''(x)e^{S(x)} + S'(x)^2e^{S(x)} = xe^{S(x)},\] or equivalently \[S''(x) + (S'(x))^2 = x.\] This is slightly unfortunate: we've turned our linear ODE into a non-linear ODE.

This non-linear ODE, like most non-linear ODEs, is quite hard to solve. However, one can find an approximate solution as follows.

Solving an equation

Here we'll get quite in the weeds of algebra for a little; feel free to skim through to the next header if that's not quite your thing.

Let's put \(p(x) = S'(x),\) so that our ODE becomes \[p'(x) + p(x)^2 = x.\] Given an ODE you can't solve, it's always tempting to try plugging in a simple function to see what happens. The simplest functions are the power functions \(Ax^n,\) so let's try plugging in \(p(x) = Ax^n.\) We'd get \[p'(x) + p(x)^2 = Anx^{n-1} + A^2x^{2n}.\] This expression \(Anx^{n-1} + A^2x^{2n}\) can never equal \(x.\) However, if say \(n \gt 0,\) then the term \(x^{2n}\) dominates \(nx^{n-1}\) for large \(x\); so, if we put \(n=1/2, A = 1\) then \[p'(x) + p(x)^2 = \frac{1}{2}x^{-1/2} + x \approx x,\] because for large values of \(x\) this term \(\frac{1}{2}x^{-1/2}\) is quite small. Similarly, \(n=1/2, A=-1\) gives an approximate solution. So, \(\sqrt{x}\) and \(-\sqrt{x}\) are both approximate solutions.

Can we try making these approximations a little better? Let's add on another term, and write \[p(x) = \sqrt{x} + q(x).\] Then \[p'(x) + p(x)^2 = \frac{1}{2\sqrt{x}} + q'(x) + x + 2q(x)\sqrt{x} + q(x)^2.\] For this right hand side to equal \(x,\) we want \[q'(x) + 2q(x)\sqrt{x} + q(x)^2 = -\frac{1}{2\sqrt{x}}.\] Again, let's make an ansatz that \(q(x) = Ax^n,\) from which we find \[Anx^{n-1} + 2Ax^{n+0.5} + A^2x^{2n} = -\frac{1}{2}x^{-1/2}.\] For any particular value of \(n,\) one of the terms \(x^{n-1}, x^{n+0.5}, x^{2n}\) will dominate the above expression for large values of \(x.\) For example, when \(n = 1,\) the three terms are \(x^0 = 1, x^{1.5}, x^2,\) and for large \(x\) this \(x^2\) term will dominate.

Let's try to match the dominant term with \(-\frac{1}{2}x^{-1/2}.\) If the dominant term was \(A^2x^{2n},\) we'd be in trouble: we'd need to take \(n = -1/4\) to get \(2n = -1/2,\) but then the other two terms would be \(x^{-5/4}\) and \(x^{1/4},\) and for large \(x\) this \(x^{1/4}\) term would dominate. So it can't be that the dominant term is \(A^2x^{2n}.\)

Similarly, if we try using \(Anx^{n-1}\) as our dominant term, we'd need to take \(n = 1/2,\) but then \(A^2x^{2n}\) would be \(A^2x,\) dominanting the other terms in the expression.

However, if we use \(2Ax^{n+0.5}\) as our dominant term, we find \(n=-1,\) and everything works out nicely: the expression is then \[-Ax^{-2} + 2Ax^{-1/2} + A^2x^{-2} = -\frac{1}{2}x^{-1/2},\] and \(2Ax^{-1/2}\) is the asymptotically dominant term on the right hand side. Thus \[q(x) \approx -\frac{1}{4}x^{-1/2}\] (after solving \(2A = -1/2\)), so that \[p(x) \approx \sqrt{x} - \frac{1}{4x}.\] One can continue in this way to get even better approximations, but for our purposes this will be enough.

Similarly, one can find that \(p(x) = -\sqrt{x} - \frac{1}{4x}\) is an approximate solution to our ODE. Recall that \(p(x) = S'(x),\) so integrating these two approximate solutions, we get two approximate solutions for \(S(x).\)

Going back

From our work in the last section, we find that \[S''(x) + (S'(x))^2 = x\] should have two solutions, \(S_+\) and \(S_-,\) such that \[S_+(x) \approx \frac{2}{3}x^{3/2} - \frac{1}{4}\ln(x)\] and \[S_-(x) \approx -\frac{2}{3}x^{3/2} - \frac{1}{4}\ln(x).\]

Unwinding one more layer, we expect that our original ODE \[f''(x) - xf(x) = 0\] has general solution of the form \[f(x) \approx Ax^{-1/4}e^{2x^{3/2}/3} + Bx^{-1/4}e^{2x^{-3/2}/3}.\] These approximations get better and better for large \(x,\) because our approximate solution to \(p'(x) + p(x)^2 = x\) gets better for large \(x.\)

Airy computed a table values for the Airy function from \(x=-4\) to \(x=+4\) by evaluating the integral numerically. Using his table of values, we can figure out what the particular constants \(A\) and \(B\) should be for the Airy function.

We know that \[\Ai(x) \approx A \cdot x^{-1/4}e^{2x^{3/2}/3} + B \cdot x^{-1/4}e^{-2x^{3/2}/3},\] where \(A, B\) are unknown. This is two unknowns, so we need two pieces of information to solve them. Let's just use Airy's values of \(\operatorname{Ai}(3)\) and \(\operatorname{Ai}(4).\) Remember that the approximation gets better and better for larger values of \(x,\) which is why we're using these results at the edge of Airy's table.

If we use them, we find that \[A \approx 0.277, B \approx 0.000.\] We'll remark that modern theory tells us that the values of \(A\) and \(B\) which make the approximation as good as possible are \(A = 1/(2\sqrt{\pi})\) and \(B = 0.\) We won't say why these numbers work out so well, but because \(1/(2\sqrt{\pi})\) and \(0\) look at bit nicer on the page than \(0.277\) and \(0.000\), we'll use them instead. As a remark, \(1/(2\sqrt{\pi}) \approx 0.28221.\) The reason this disagrees with the value of \(A\) computed using Airy's table is because the approximation doesn't work so well for small values of \(x,\) and hence using \(\operatorname{Ai}(3)\) and \(\operatorname{Ai}(4)\) doesn't give the optimal constants.

Anyways, the point of this long digression is that we should expect \[\operatorname{Ai}(x) \approx \frac{1}{2\sqrt{\pi}}x^{-1/4}e^{2x^{3/2}/3},\] at least for large values of \(x.\)

Enter the negative number line

Remember how Airy's table of values when from \(x=-4\) to \(x=+4\)? What would happen if we had instead used \(x=-4\) and \(x=-3\) to try getting our approximation? Those are still large negative numbers, so we might expect to get basically the same approximation.

Before saying what happens, let's remark that for negative values of \(x,\) there's a bit of a subtlety in the final answer, because our asymptotic involves expressions like \(x^{-1/4} = \sqrt{\sqrt{x}}\) and \(x^{3/2} = \sqrt{x^3},\) which involve taking square roots. In particular, these functions can give imaginary numbers as outputs, despite the Airy function being real-valued! However, all the imaginary numbers involved end up cancelling out in the end, so it is still sensible to use these complex-valued functions to approximate a real-valued function. By the way, it's quite remarkable that the best way to understand the behavior of a real-valued function is to go through complex-valued functions!

Anyways, with these subtleties on imaginary numbers discussed, we'll remark that using Airy's values for \(-3\) and \(-4\) lead you to calculate that \[A \approx 0.280 - 0.004i,\] \[B \approx -0.004 + 0.280i.\] The value for \(A\) is pretty close to \(1/(2\sqrt{\pi})),\) which we got before; so that is OK. But the new value for \(B\) is very strange: its real part is zero, but its imaginary part is very large! As before, we'll remark that general theory tells us that \(A = 1/2\sqrt{\pi}\) and \(B = i/2\sqrt{\pi}\) end up giving the best results.

This is the basic instance of Stokes phenomena: the approximation \[\operatorname{Ai}(x) \approx \frac{1}{2\sqrt{\pi}}x^{-1/4}e^{2x^{3/2}/3}\] works well for large positive values of \(x,\) but to get an approximation that works for large negative values of \(x\) (meaning something like \(x = -100\)), you need to use the different approximation \[\operatorname{Ai}(-x) \approx \frac{1}{2\sqrt{\pi}}x^{-1/4}e^{2x^{3/2}/3} + \frac{i}{2\sqrt{\pi}}x^{-1/4}e^{-2x^{3/2}/3} = \frac{(-x)^{-1/4}}{\sqrt{\pi}}\cos\left(\frac{2}{3}(-x)^{3/2} - \frac{\pi}{4}\right).\] The last simplification, rewriting a sum of complex exponentials as a trig function, is common in complex analysis; if you haven't seen it before, we'll just say that it's not as scary as it seems!

Going to the complex plane

At its face, the Stokes phenomena might not seem surprising: one has to use different approximations for positive and negative numbers, so what?

To see the true strangeness of Stokes phenomena, one needs to go to the complex plane. As mentioned above, the original purpose of the Airy function was to help understand rainbows using optics and classical mechanics. However, it turns out that the Airy function also appears in quantum mechanics! In its quantum mechanical instantiation, one wants to understand the Airy function \(\operatorname{Ai}(x)\) even for complex numbers \(x\) as an input, like \(1+3i\) or \(-5-12i.\)

We know that you have to use one asymptotic for the positive real axis, and a different one for the negative real axis. But in the complex plane, there are more than two directions: so, what asymptotic formula do you use?

In the widget below, you can see a copy of the complex plane. If you click on a point in the plane, the widget will show you the value of the Airy function. Then, below the true value, the widget will show three different approximations. The first approximation it will show is what happens if you use the formula \[E_-(z) = \frac{1}{2\sqrt{\pi}}e^{2x^{3/2}/3},\] which works on the positive real axis. The next two approximations are \[E_-(z) + iE_+(z) = \] and \[E_-(z) - iE_+(z) = .\] This first \(E_- + iE_+\) is the exact same approximation which worked well on the negative real axis. The version \(E_- - iE_+\) is basically the same approximation, but we changed the signs of the complex numbers; it's prescence is a subtle issue related to the fact that you cannot consistently choose a square root of a complex number, and if you haven't seen complex analysis before, we encourage you to ignore it and treat \(E_- + iE_+\) and \(E_- - iE_+\) as the same thing; what is happening is that one has to be very careful about how to interpret square roots of complex numbers, and these give you the two ways of interpreting that root.

Airy Stokes diagram

Click or drag to move z.

Ai″(z) = z Ai(z)
Stokes jump Branch cut
z
Ai(z)
SectorApproximationValueRel. error

In the widget, if you play around, you might notice a few things; for example, for points close to the negative real axis -- especially points far away from the origin -- the asymptotic we used for the negative real axis works quite well, but the asymptotic we used for the positive real axis works very poorly. Similarly, near the positive real axis, the asymptotics that work will for the negative real axis get enormously inaccurate.

However, if we make a large angle with the real axis, then the approximations all get very close. This is because, in certain directions, the function \(E_+\) exponentially decays, and so barely changes the asymptotic. To get a better sense of which asymptotic works best at angles far from the real axis, it's helpful to test with points that are close to the origin; that way, you can really see the differences between the approximations.

The diagram highlights the \(120^{\circ}\) and \(240^{\circ}\) lines, because those are where where the best approximation changes. Remember that our approximation included the exponential terms \(e^{2x^{3/2}/3}.\) For a complex number \(z,\) it turns out that the magnitude of this exponential is \[e^{\Re(2z^{3/2}/3)},\] where \(\Re(z)\) is the real part of a complex number; for example, \(\Re(4+3i) = 4.\)

Writing the complex number \(z\) in polar form as \(z = re^{i\theta},\) we find that \[z^{3/2} = r^{3/2}e^{3i\theta/2},\] which has real part \(r^{3/2}\cos(3\theta/2).\) This real part is smallest when \(\theta = 120^{\circ}\) and when \(\theta = -120^{\circ}.\) This is why the two yellow lines are at those locations: along those lines, the extra term \(E_-\) does basically nothing; however, if one strays far from those lines, then that \(E_-\) can contribute a lot, and on either side of the yellow line, you need \(E_-\) to contribute in a different way to get a good approximation.

Where does Stokes phenomenon lead?

The Stokes phenomenon does not stop at the Airy function; it is ubiquitous in the study of asymptotics, and plays an important role in mathematical physics -- it turns out that functions like the Airy function (in the sense that Stokes approximation trick works on them) occur all the time in quantum mechanics, and understanding the Stokes phenomenon is essential for getting good approximations of these functions.

However, the writers of this blog are not physicsists. To us, the Stokes phenomenon shows up in a different way: the irregular Riemann--Hilbert correspondence. Remarkably, the Stokes phenomenon plays an important role in understanding certain aspects of representation theory, and in understanding certain aspects of the algebraic geometry of singular shapes. TODO: link trefoil knot article

Also, it's pretty fun and surprising that the asymptotics change so much!

Send feedback

Have something you want to share with us? This feedback form will communicate it to Michael and Kenta, the writers of this blog. This feedback won't be public (mostly because moderating a comment section sounds hard).