# Refraction in Action

Fermat’s principle states that the path taken by a ray of light travelling between two points is that which is traversed in the least time.

This simple statement can be used to explain why light travels in straight lines in homogeneous media, is reflected at an angle equal to the angle at which it strikes a specular surface, and why a ray is refracted at the boundary between media of different refractive indices.

It’s this last phenomenon that forms the topic of this post: refraction, or the bending of a light ray as its propagation speed changes. But rather than looking at discrete, discontinuous jumps in speed, like the one that occurs at a glass-air or water-air interface, I want to explore how a ray behaves when its speed varies continuously with position.

The following set-up is a bit contrived, but stay with me; the result is pretty neat!

A ray of light emerges from a plane containing the origin. It travels through a uniform medium with constant refractive index $n_0$.

The ray reaches an interface displaced a transverse distance $z_0$ from the origin. Beyond this boundary, there exists a strange region of space whose refractive index varies as the inverse distance from the plane containing the origin.

The refractive index of this funny region starts at $n_0$ and decays to 1.

We can sum up this information with a piecewise definition of the refractive index as a function of the ray’s distance from the plane containing the origin:

$n(z)=\begin{cases}n_0\,\,\,\,\quad\text{for}\quad 0\le z\le z_0 \\ \frac{n_0 z_0}{z}\quad\text{for}\quad z_0\le z \le n_0 z_0 \\ 1\,\quad\quad\text{for}\quad n_0 z_0 \le z\end{cases}$

What does this mean in terms of ray’s propagation speed? The refractive index $n$ of a material is defined such that a beam of light moving through it travels at speed

$\displaystyle v=\frac{c}{n}$

where $c$ is the speed of light in vacuum. The greater the refractive index of a material, the slower light passes through it.

We can rewrite the information above in terms of the ray’s propagation speed $v$:

$v(z)=\begin{cases}\frac{c}{n_0}\,\,\,\,\quad\text{for}\quad 0\le z\le z_0 \\ \frac{c}{n_0 z_0}z\quad\text{for}\quad z_0\le z \le n_0 z_0 \\ c\,\quad\quad\text{for}\quad n_0 z_0 \le z\end{cases}$

This is perhaps the clearer definition: in the funny region, the speed of the beam increases linearly with position.

$\$

We know that the beam travels in straight lines in the regions of uniform refractive index. What we want to work out is how the beam behaves in the intermediate region.

To do so we’ll use Fermat’s principle. This says we should find the path that minimises the functional $T$, the time taken for the beam to move between two points (just as for the brachistochrone).

Let’s set up the problem. The functional $T$ is given by

$\displaystyle T=\int_{x_A}^{x_B} \frac{dS}{v}$

That is, the time taken for the beam to traverse its path is the sum of lots of little time intervals, during which it travels an infinitesimal distance $dS$ at speed $v$. Written in terms of refractive index, this is

$\displaystyle T=\frac{1}{c}\int_{x_A}^{x_B} n\,dS$

I’ve tacitly introduced the coordinate $x$, the independent variable which measures the beam’s position in a direction normal to the planes of constant $z$.

The differential $dS$ is related to small changes in $x$ and $z$ by

$dS=\sqrt{(dx)^2+(dz)^2}$

from Pythagoras’ theorem. This means

$dS=\sqrt{1+z'^2}\,dx$,

hence

$\displaystyle T=\frac{1}{c}\int_{x_A}^{x_B} n(z)\sqrt{1+z'^2}\,dx$

To minimise this functional, we can use the Euler-Lagrange equation, which says the function $z$ that minimises this integral satisfies the differential equation

$\displaystyle \frac{\partial L}{\partial z}=\frac{d}{dx}\left(\frac{\partial L}{\partial z'}\right)$

where

$\displaystyle L=n(z)\sqrt{1+z'^2}$

Since this Lagrangian does not explicitly depend on $x$, we can use the Beltrami identity, derived from the Euler-Lagrange equation, which tells us

$\displaystyle L-z'\frac{\partial L}{\partial z'}=a$

where $a$ is a constant. So $z$ satisfies the equation

$\displaystyle n(z)\sqrt{1+z'^2}-z'\frac{\partial}{\partial z'}\left(n(z)\sqrt{1+z'^2}\right)=a$

After some manipulation we end up with

$\displaystyle n(z)=a\sqrt{1+z'^2}$

This first-order differential equation can be solved by rearranging and integrating directly:

$\displaystyle x-x_0=\int \frac{dz}{\sqrt{\left(\frac{n(z)}{a}\right)^2-1}}$

where $x_0$ is a constant. Note that we can get this far without even needing to know the form of $n$! Now we can substitute in the expression for the refractive index of the funny region of space:

$\displaystyle n(z)=\frac{n_0 z_0}{z}$

$\displaystyle x-x_0=\int \frac{dz}{\sqrt{\left(\frac{n_0 z_0}{az}\right)^2-1}}$

For convenience, we can just stick all the constants together into a blob:

$\displaystyle r=\frac{n_0 z_0}{a}$

So we want to solve the integral

$\displaystyle x-x_0=\int \frac{dz}{\sqrt{\left(\frac{r}{z}\right)^2-1}}$

Let’s try the substitution

$z=r\cos\theta$

$dz=-r\sin\theta\,d\theta$

Hence

$\displaystyle x-x_0=\int\frac{-r\sin\theta}{\sqrt{\sec^2\theta-1}}\,d\theta$

$\displaystyle x-x_0=\int\frac{-r\sin\theta}{\sqrt{\tan^2\theta}}\,d\theta$

$\displaystyle x-x_0=-r\int\cos\theta\,d\theta$

$x-x_0=-r\sin\theta$

$x-x_0=-r\sqrt{1-\cos^2\theta}$

$\displaystyle x-x_0=-r\sqrt{1-\left(\frac{z}{r}\right)^2}$

Rearranging, we find

$(x-x_0)^2+z^2=r^2$

Hence, in the region in which the refractive index varies inversely with distance, the beam moves in a circular arc!

To understand how the beam behaves on a quantitative level, we should determine the values of the constants in the expression above.

We can choose the position of the centre of the circular arc such that the position at which the beam meets the interface at $z_0$ coincides with the $z$ axis. If the beam meets the boundary at angle $\theta$ to the normal, then the diagram to the right should convince you that

$x_0=-r\cos\theta$

This doesn’t tell us anything, though: we need to work out the radius of curvature of the beam’s path, $r$.

To do so, we can consider the gradient of the beam’s path at the position at which it meets the interface. We have the expression

$(x+r\cos\theta)^2+z^2=r^2$

Differentiating implicitly gives

$\displaystyle 2(x+r\cos\theta)\frac{dx}{dz}+2z=0$

$\displaystyle \frac{dx}{dz}=-\frac{z}{x+r\cos\theta}$

Trigonometry tells us that

$\displaystyle \frac{dx}{dz}=-\tan\theta\quad\text{at}\quad z=z_0, x=0$

Hence

$\displaystyle -\tan\theta=\frac{z_0}{-r\cos\theta}$

$r(\theta)=z_0\csc\theta$

So the radius of curvature of the beam’s path is proportional to the cosecant of its angle of incidence $\theta$. Cosecant, or one over sine (not arcsine!) is a function which approaches 0 as $\theta$ goes to 90 degrees, but blows up to infinity as $\theta$ goes to zero.

This means the shallower the angle of incidence, the greater the radius of curvature of the beam’s path. An important consequence of this is that if the beam approaches the interface at normal incidence, its path is unperturbed – it keeps travelling in a straight line (on the edge of a circle of infinite radius).

What else does this tell us? We can use $r(\theta)$ to work out how far into the funny region the beam gets before it turns around. From the diagram above, this depth $d$ is equal to

$d=r-z_0$

$d(\theta)=z_0(\csc\theta - 1)$

So the penetration depth tends to 0 as the angle of incidence tends to 90 degrees, and tends to infinity at normal incidence.

Here’s another interesting question: below what angle of incidence $\theta_c$ does the beam escape the funny region, rather than being turned around? At this critical angle $\theta_c$, the beam will just touch the edge of intermediate region before turning around.

This happens when the radius of curvature of the beam (the $z$ coordinate at which the beam turns around) coincides with the edge of the funny region of space. From the piecewise definition of $n(z)$ above, this edge is at $z=n_0 z_0$. So

$r(\theta_c)=n_0 z_0=z_0\csc\theta_c$

$\displaystyle \theta_c=\arcsin\left(\frac{1}{n_0}\right)$

This is precisely the critical angle predicted by Snell’s Law. If, for instance, the beam were gradually escaping from water, the critical angle would be about 49 degrees. Any beam approaching at an angle shallower than this would escape; any beam approaching at an angle steeper than this would be turned around.

If you’re so inclined, you can work out the angle $\varphi$ at which an escaping beam would emerge from the funny region relative to the normal, and you would find this also agrees with the prediction of Snell’s law:

$\sin\varphi=n_0\sin\theta$

To the right is an animation of the beam’s path varying with angle of incidence.

Where can we see this kind of effect?

The peak of the Sun’s emission spectrum is in the visible range of the electromagnetic spectrum. Visible light can pass through the atmosphere untrammelled (ignoring Rayleigh scattering); we can see the Sun through the sky.

On reaching the Earth’s surface, some of this solar radiation is absorbed, causing the ground to become hot. The Earth then re-rediates some of this heat, not in the visible but in the infrared range of the electromagnetic spectrum.

While the atmosphere is largely unresponsive to visible light, it has an appetite for infrared radiation! Infrared rays emitted from Earth are eagerly absorbed by the atmosphere, with those constituent particles nearer Earth’s surface getting the bigger portion.

This creates a steep temperature gradient near the Earth’s surface – the air is hot near the ground, and cools quickly with increasing altitude.

Hot particles in an ideal gas are less friendly than cold particles. They rush about furiously, smashing into their neighbours, angrily pushing them away. The gap between hot air particles is much greater than that between cold, calm air particles. Hot air expands, and in doing so, decreases in density.

The less dense the air it is, the ‘easier’ it is for light to pass through it – this means the refractive index of the hot air near the ground is less than that of the cooler air above it.

So consider a beam of light sailing in from the upper atmosphere. As it approaches the ground, it enters a region in which the refractive index decreases with increasing depth. As shown above, this causes the beam of light to steadily turn and, if it approached at a sufficiently shallow angle, reverse its direction completely and travel back up into the atmosphere.

Now imagine this beam of light smacks into your retina. This beam, having come from the atmosphere, is blue. But to see it, you had to look towards the ground! Hence there appears to you to be a puddle of blue in the middle of the ground.

This is the origin of an inferior mirage.

A disclaimer: I’m not suggesting the refractive index of the atmosphere actually varies with inverse distance from some plane. The real situation would be much more complicated, particularly because hot air below cold air is not a stable configuration. The earth-baked air just above the ground will try to rise up through the cold air above it. This causes convection currents, bringing about the shimmering you see in a heat haze.

The general idea is the important bit – that rays of light tend to bend away from regions of decreasing refractive index.

The derivation of paths taken by light rays in inhomogeneous media is a really interesting application of the Euler-Lagrange equation(s). The next application I hope to show is in the derivation of the geodesics of a cone.