Recently my wife and I saw a double rainbow, shown below. I’m a lousy photographer, but it’s there if you look closely, along the top of the picture:

There are plenty of existing sources that describe the mathematics of rainbows: briefly, rays of sunlight (entering the figure below from the right) strike airborne droplets of water, bending due to refraction, reflecting off the *inside* of the droplet, and finally exiting “back” toward an observer.

The motivation for this post is to describe the calculations involved in predicting where rainbows can be seen, but focusing on *generalization*: with just one equation, so to speak, we can let the sunlight bounce around a while inside the water droplet, and predict all of the different “higher-order” rainbows (double, tertiary, etc.) at once. I think this is a nice “real” problem for students of differential calculus; its solution involves little more than the chain rule and some trigonometry.

The figure above shows the basic setup, where angle parameterizes the location where a ray of sunlight, entering horizontally from the right, strikes the surface of the spherical droplet. The angle is the corresponding normal angle of refraction, related by Snell’s law:

where and are the indices of refraction for air and water, respectively. (Let’s defer for the moment the problem that these indices actually vary slightly with wavelength.)

As a function of , at what angle does the light ray exit the picture? Starting with the angle shown in the center of the droplet, and “reflecting around” the center counterclockwise– and including the final additional refraction upon exiting the droplet– the desired angle is

where– and this is the generalization– the integer indicates *how many* times we want the ray to reflect inside the droplet ( in the figure above). The figure below shows how this exit angle varies with , for various numbers of internal reflections.

The key observation is that for , there is a critical minimum exit angle, in the neighborhood of which there is a concentration of light rays. We can find this critical angle by minimizing as a function of . (Note that there is no critical angle when , and so a rainbow requires at least one reflection inside the droplets.)

At this point, we have a fairly straightforward, if somewhat tedious, calculus problem: find where . It’s an exercise for the reader to show that this occurs at:

Evaluating at yields an angle of about 318 degrees. This requires some interpretation: imagine a line between you and the Sun. Then standing with the Sun *behind* you, a primary rainbow is visible along a cone making an angle of about 360-318=42 degrees with this line.

(Coming back now to the dependence of index of refraction on wavelength: although the variation is negligible for air, the index of refraction for water varies from about 1.33 for red light to about 1.34 for violet light, so that the rainbow is not just a band of brighter light, but a spread of colors from about 41.1 to 42.5 degrees… with the red light on the *outside* of the band.)

For , the critical is about 411 degrees, corresponding to a viewing angle of about 51 degrees… with two differences: first, the additional internal reflection means that the light strikes the *bottom* half of each droplet, making a complete “loop” around the inside of the droplet before exiting toward the observer. Second, this opposite direction of reflection means that the bands of colors are reversed, with red on the *inside* of the band.

Finally, the angle for is about 498 degrees: such a tertiary rainbow may be seen *facing the Sun* (good luck with that), in a sort of “corona” around it at an angle of about 42 degrees.

Very clever. I had thought about this method myself. Are you aware whether someone published this result before?

Enjoyed reading that thanks. It might be of interest to my A-Level physics students. One observation I’ve made with rainbows – it might bean illusion – is the apparent difference in brightness of the sky either side of a rainbow. In your image, the lower sky appears brighter than the sky above the rainbow.

You’re right, and it’s no illusion; in fact, the area between the primary and secondary rainbows is darkest, as described in more detail here.