A lifeguard is on the sand and sees someone drowning in the sea, further out and off to one side. Which path should the lifeguard take? The straight line is the shortest path but not the fastest: running on sand is much quicker than swimming. It pays to run a bit further along the beach so as to swim less.

Fermat realized that light makes exactly this choice.

Reflection: the shortest path

The oldest idea concerns mirrors. In the 1st century, Heron of Alexandria had already noticed that light, when reflected, follows the shortest path between two points by way of the mirror.

Let us check it with a derivative. A light source $S$ is at height $a$ above the mirror, and the eye $T$ at height $b$. The horizontal distance between them is $\ell$. The light hits the mirror at a point $M$, at distance $x$ from the foot of $S$.

The length of the path $S\to M\to T$ is

$$P(x)=\sqrt{x^2+a^2}+\sqrt{(\ell-x)^2+b^2}.$$

At the minimum, the derivative vanishes:

$$P'(x)=\frac{x}{\sqrt{x^2+a^2}}-\frac{\ell-x}{\sqrt{(\ell-x)^2+b^2}}=0.$$

Each fraction is the sine of an angle: $\dfrac{x}{\sqrt{x^2+a^2}}$ is the sine of the angle of incidence $\hat i$, measured from the line perpendicular to the mirror, and $\dfrac{\ell-x}{\sqrt{(\ell-x)^2+b^2}}$ is the sine of the angle of reflection $\hat r$. So

$$\sin\hat i=\sin\hat r\qquad\Longrightarrow\qquad\hat i=\hat r.$$

That is the law of reflection: the angle of incidence equals the angle of reflection.

Refraction: the least time

In reflection, light stays in the same medium, and the shortest path is also the fastest. But when light passes from air into water, it changes direction. The bent path is longer than the straight one. Why would light do that?

In 1662 Fermat proposed the answer: light does not follow the shortest path but the fastest. If it travels more slowly in water, it pays to cover more distance in air, like the lifeguard on the sand.

Two media: the crossing point P determines the distances travelled in each medium and the total time. The angles are measured from the normal to the surface.
Two media: the crossing point P determines the distances travelled in each medium and the total time. The angles are measured from the normal to the surface.Original illustration for the blog.

Let $v_1$ be the speed of light in the first medium and $v_2$ in the second. With the same distances as before, now with point $T$ below the surface, the total time is

$$t(x)=\frac{\sqrt{x^2+a^2}}{v_1}+\frac{\sqrt{(\ell-x)^2+b^2}}{v_2}.$$

Differentiating and setting the result to zero:

$$\frac{x}{v_1\sqrt{x^2+a^2}}=\frac{\ell-x}{v_2\sqrt{(\ell-x)^2+b^2}}.$$

Recognizing the sines of the angles with the perpendicular:

$$\frac{\sin\theta_1}{v_1}=\frac{\sin\theta_2}{v_2}\qquad\text{or}\qquad\frac{\sin\theta_1}{\sin\theta_2}=\frac{v_1}{v_2}.$$

This is Snell’s law, the law of refraction taught in high school. If light is slower in the second medium ($v_2

A principle that went far

Fermat’s principle was the first time anyone explained a physical phenomenon by saying that nature optimizes something. The idea was hugely successful. In the 18th century Maupertuis, Euler and Lagrange created the principle of least action, which holds for the whole of mechanics. Today principles like this lie at the heart of modern physics, from relativity to quantum mechanics.

A technical correction: in some situations, such as certain curved mirrors, light follows a path of maximum or “stationary” time rather than minimum time. That is why physics today says the travel time is stationary: the derivative vanishes, as in Fermat’s own method of maxima and minima.

Exercise: if the speeds in the two media are equal, does the ray change direction?

No. With $v_1=v_2$ we have $\sin\theta_1=\sin\theta_2$, so $\theta_1=\theta_2$: the ray goes straight on.

Exercise: light goes from air into water, where it is 4/3 times slower. If θ₁ = 30°, what is sin θ₂?

$\sin\theta_2=\sin\theta_1\cdot\dfrac{v_2}{v_1}=0.5\cdot\dfrac34=0.375$, and $\theta_2\approx22°$. The ray bends towards the perpendicular.

Sources: Fermat biography, MacTutor.


All Fermat topics · ← Fermat and Pascal: fairly dividing an interrupted game · Infinite descent: a smaller solution leads to a contradiction →

Image credits.