We all love to enjoy the beauty of a rainbow, and potentially even *double rainbows*, right? Well now, through the powers of science, we will learn to love rainbows because of their interesting optical properties!

One thing we have probably all noticed about rainbows is that they commonly appear after storms. Why might that be? Well, one of the essential ingredients of rainbows are water droplets in the atmosphere. After it rains, there is still a lot of moisture in the atmosphere, so voila! We have good conditions for a rainbow! This is also why you may see a rainbow when running through a sprinkler, or at a fountain, or really any other time you have water in the air. The other main ingredient for rainbows is sunlight, and we can look at the image below to see how sunlight and water droplets may interact to form a rainbow (here, we are approximating water droplets as spheres like the good physicists that we are; the approximation is close enough to properly predict what happens in reality).

When looking at the image above, you will note that as the white light of the Sun enters the water molecule, the light “spreads” in the water droplet (signified by the broadened beam of light in the water droplet). This happens due to a phenomenon known as *dispersion*, which means that each wavelength of light in the white light is refracted at a different angle within the water droplet because each wavelength of light “sees” a different index of refraction. Thus, by Snell’s Law, given as:

\begin{equation} sin\theta_i = n_2sin\theta_t \end{equation}

since each wavelength in the beam of white light has the same input $\theta_i$, the changing value of $n_2$ for each wavelength will mean that each wavelength is refracted at a different angle. So, then, that takes care of how the rainbow starts. But then what happens to the light once inside of the water droplet? Well, to explain that, we can use the following diagram where we can do a bit more ray tracing:

Here, the white light is entering the water droplet along the solid arrow, and then is being refracted along the connected solid line. If we follow the solid line within the water droplet to the next border of the water droplet, we can see here that we have another instance where we could have either reflection or refraction. Now we can use some sneaky math! From before, we have that Snell’s Law from the first interface gives us:

\begin{equation} n_isin\theta_i = n_{t_1}sin\theta_{t_1} \end{equation}

where I have relabeled the original “t” to “$t_1$” for reasons that will become clear momentarily. Then, at the second interface, we have:

\begin{equation} n_{t_1}sin\theta_{t_1} = n_{t_2}sin\theta_{t_2} \end{equation}

Combining these two equations, we can see that we now have the equality:

\begin{equation} n_i sin\theta_i = n_{t_2} sin\theta_{t_2} \end{equation}

But, since $n_i$ = $n_{t_2}$ (both are the refractive indices for the atmosphere), then we have:

\begin{equation} sin\theta_i = sin\theta_{t_2} \end{equation}

So the input angle would be equal to the output angle! But now, we need to check the conditions for total internal reflection, which would be:

\begin{equation} \theta_i = sin^{-1}(\frac{n_{t_2}}{n_i}) = 90^{\circ} \end{equation}

Thus, since the input angle would have to be less than 90 degrees by definition, the light at the back of the water droplet would be totally internally reflected for all wavelengths! From there, the light simply refracts back at the third interface at the same angle it entered, and then we have our rainbow. Easy enough, right?

Something interesting to note is that when we are viewing rainbows, we see the red color appear at the top of the rainbow and the purple appear at the bottom, which is inconsistent with the graphic above. What’s the difference? It turns out the discrepancy is accounted for when we consider the angle at which we *view* the rainbow: when we are viewing the rainbow, the order of the colors flips, such that the red color appears on top and blue on the bottom. This also explains why we cannot view the rainbow while facing the Sun: it must be behind us in order for us to view the dispersion of the Sun’s rays.