I have read this sentence on a book about the Snell's law of refraction, referring on a ray that passes from air ($n_1=1$) to glass ($n_2=1.55$):

"Snell's equation can be derived from Fermat's principle of least time. The path length in air has been increased relative to the path length in glass since the speed in air ($c/n_1$) is greater than the speed in glass ($c/n_2$). This is analogous to the situation of a lifeguard who must rescue a swimmer who is down the beach and out to sea. Since the guard can run faster then he can swim, he should not head directly for the swimmer but should run at an angle so that the distance covered on the beach is greater than the distance in the water and the total time can be minimized"

I do not understand it. Why should we increase the path in air? From this sentence it seems that in order to reduce the total time (of travelling in air and in glass), we have to increase the path in air (and what does it mean?).

  • $\begingroup$ (I had mentioned on the EE.SE to delete your question otherwise it might get flagged as a cross-duplicate) $\endgroup$
    – user113622
    Commented Jul 24, 2019 at 15:01
  • $\begingroup$ Yes, but I was not able to delete it (the delete button does not appear in my app, so I asked to close it) $\endgroup$
    – Kinka-Byo
    Commented Jul 24, 2019 at 15:13
  • 3
    $\begingroup$ You increase the total path length in air, but since light travels faster in air it still makes the total travel time shorter. Of course if you make the path length too long then of course you will still get a longer time. This is why we talk about minimizing the travel time. A minimum means that if we change anything about the path we will have a longer travel time. The quote is comparing to the "straight line" path, so this is why they say the time in air needs to be longer $\endgroup$ Commented Jul 24, 2019 at 15:14
  • $\begingroup$ I am sorry, but it continues to be difficult for me to understand it. If light travels in air and then there is the glass, what does it mean "increase the air path length"? It is extablished by the distance from the light source and the separating surface, and it is the same with respect to the case in which the glass is replaced with air (evaluating it at the position of the "previous" separating surface). $\endgroup$
    – Kinka-Byo
    Commented Jul 24, 2019 at 15:41
  • 1
    $\begingroup$ Related : Why one should follow Snell's law for shortest time?. $\endgroup$
    – Frobenius
    Commented Jul 24, 2019 at 23:01

2 Answers 2


Here is a diagram of what is going on

Let's do some math, shall we? Fermat's principle is actually a least-time principle. What it says is, that out of all possible trajectories between two points, light is going to follow the one that minimizes the time spent traversing that trajectory.

We know that light travels in straight lines if it's speed is constant throughout the medium, but at the interface of two media where light changes it's propagation speed we assume that we don't know how the light ray is gonna snap (in other words, we have unknown angles of incidence and refraction. We are going to derive Snell's law.

Suppose the light ray is emitted at point $P_1$ and wants to reach point $P_2$ in the least time possible. These points are fixed and their coordinates are $P_1(0,h_1), P_2(-h_2, D)$. Now we would like to minimize the time traversed on the set of possible trajectories. Assume that the light ray is incident distance $d_1$ away from $P_1$ and $d_2$ away from $P_2$. We know that $d_1+d_2=D$. Also the total time of travel between the two points is:

$$T(d_1,d_2)=t_1+t_2=\frac{L_1}{v_1}+\frac{L_2}{v_2}=\frac{1}{c}\Big[n_1\sqrt{d_1^2+h_1^2}+n_2\sqrt{d_2^2+h_2^2}\Big]~~, ~~ d_1+d_2=D$$

Now we want to minimize $T$ under the constraint written above. Using standard Lagrange multipliers procedures we minimize


and we compute

$$\frac{\partial\tilde{T}}{\partial d_1}=\frac{n_1d_1}{c\sqrt{d_1^2+h_1^2}}-\lambda=0\\ \frac{\partial\tilde{T}}{\partial d_2}=\frac{n_2d_2}{c\sqrt{d_2^2+h_2^2}}-\lambda=0$$

Notice that $\sin\theta_1=\frac{d_1}{\sqrt{d_1^2+h_1^2}}$ and similarly for the angle of incidence (just swap index 1 for 2) and thus we get immediately that:


I guess the take away here is what Fermat really says is that along a trajectory the time traversed is minimized. So when some authors say air path length, this actually means time. To understand why they say that, suppose the index of refraction is varying continuously in space. Then we need to minimize

$$T=\int_{trajectory}dt=\int{\frac{ds}{v(s)}}=\frac{1}{c}\int_{P_1\rightarrow P_2}n(x(s), y(s))ds$$

and this can be minimized using standard calculus of variations techniques. The last quantity (maybe omitting the speed of light) is the "path length" that they're talking about, because in the integral the actual path length $ds$ is considered, but weighted by a certain function of spacetime, the index of refraction.

Hope this is helpful!


You are asking about the speed of light in different media (air, glass).

The speed of light is c in vacuum, when measured locally.

Now in air, the speed of light reduces (when measured locally) relative to c.

In glass, the speed of light reduces (when measured locally) relative to c and relative to the speed of light in air.

There are two ways to think of it:

  1. classically, air is denser then vacuum (and glass is denser then air) in a sense, that light needs to interact with the atoms and molecules of the material, this takes time, and this makes light seem to travel slower in thicker media

  2. in QM, photons, the quanta of EM waves, as they travel through air (or glass), they interact with the atoms and molecules of air, though the wavefront of light travels slower then c, because the individual photons that make up the EM wave, travel actually a longer path through the media, thus it takes for them more time to travel the straight path you calculate for the wavefront (though individual photons travel at speed c in vacuum between atoms).

Now the denser the medium, usually the slower light propagates in it.

In your case, if you have a path that leads through air and glass, you have to select this path so, that light travels the shortest in glass and the longest part of the total path in air.

This way, the longer part of the total path will be traveled by light in air (faster then glass), and only a shorter path will be traveled in glass (slower then air).

So your total travel time for the EM wave will be the minimal.

  • $\begingroup$ Thank you for your answer. Regarding your sentence "you have to select this path so, that light travels the shortest in glass and the longest part of the total path in air" it seems to me that the light has a total path length which is fixed, and the refraction indeces decides the single lengths of the paths in each medium. But why is the total path fixed? $\endgroup$
    – Kinka-Byo
    Commented Jul 24, 2019 at 18:06
  • $\begingroup$ @Kinka-Byo you are correct, the refraction index means that the incident angle and the refraction angle are correlated. In your case, light travels from point Q to point P, that is two fixed points in space. Since the incident angle and the refraction angle are correlated, and the two point are fixed in space, this makes the total path length fixed. Because there is only one point O, where the light has to enter the new medium (so it refracts in the right angle to go to point P). $\endgroup$ Commented Jul 25, 2019 at 11:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.