core24 min studyLesson 201 in Physics

Fermat’s principle and optical path

Derive ray directions from stationary optical path while distinguishing phase, travel time, and a true minimum.

On this page

What you’ll understand

  • Calculate optical path in piecewise uniform media.
  • Derive the planar refraction condition by varying a crossing point.
  • Explain why stationarity does not guarantee a global minimum.

A ruler measures geometric distance, but a monochromatic wave accumulates phase according to both distance and refractive index. This distinction makes it possible for a longer route through a faster medium to compete with a shorter route through a slower one. Fermat’s principle identifies physical ray paths through a first-order stationarity condition. We will derive that condition for a movable interface crossing, then separate its reliable mathematical meaning from the tempting claim that every ray finds the globally fastest route.

The quantity being varied

Assume a transparent, isotropic, stationary medium with a real positive phase index n(r)n(\mathbf r) at the chosen vacuum wavelength λ0\lambda_0. Optical path length is the integral of index times geometric arclength. It has units of metres, although it is not the distance a ruler measures. Multiplying it by the vacuum wavenumber gives propagation phase. A uniform glass segment of length two centimetres and index one and a half therefore contributes three centimetres of optical path.

In a nondispersive medium the speed is c/nc/n, so optical path divided by c is travel time. For a dispersive material, however, phase index and group index differ. A narrow pulse’s delay requires the group index, whereas monochromatic ray geometry is usually formulated with phase index at a fixed frequency. Calling every optical-path calculation a pulse arrival-time calculation silently introduces an assumption about dispersion. We retain the monochromatic formulation throughout this derivation.

L[γ]=∫γn(r) ds,ϕ=k0L,k0=2πλ0,δL=0\mathcal L[\gamma]=\int_\gamma n(\mathbf r)\,ds,\qquad \phi=k_0\mathcal L,\qquad k_0=\frac{2\pi}{\lambda_0},\qquad \delta\mathcal L=0
Gamma is a path between fixed endpoints; s is arclength in metres. The variation vanishes for admissible nearby paths at fixed frequency, while phase is measured in radians.↔ Scroll wide equations horizontally.

A crossing point supplies a derivation

Place a horizontal interface between media with indices n1n_1 and n2n_2. A source is a perpendicular distance a above it, and the receiver is a perpendicular distance b below it with horizontal displacement X. Let x be the crossing coordinate measured from the source’s vertical projection. Each segment is straight because its index is uniform. The remaining freedom is a single real number, so the path integral becomes an ordinary differentiable function.

Differentiating each square root produces a horizontal displacement divided by that segment’s length. Those ratios are the sines of the respective angles to the interface normal. Setting the derivative to zero balances the index-weighted sines. This route also explains which angle convention belongs in Snell’s law; measuring angles from the interface would replace sines with cosines. Endpoint positions stay fixed while the crossing point moves, which is essential to interpreting the derivative.

L(x)=n1a2+x2+n2b2+(X−x)2,dLdx=n1xa2+x2−n2X−xb2+(X−x)2=0\mathcal L(x)=n_1\sqrt{a^2+x^2}+n_2\sqrt{b^2+(X-x)^2},\qquad \frac{d\mathcal L}{dx}=n_1\frac{x}{\sqrt{a^2+x^2}}-n_2\frac{X-x}{\sqrt{b^2+(X-x)^2}}=0
All four distances are in the same length unit. The two fractions are sin theta one and sin theta two for the transmitted path with the crossing between the projections.↔ Scroll wide equations horizontally.

Stationarity is the general statement

For this planar two-segment geometry, positive indices and nonzero perpendicular distances make the second derivative positive. Its stationary crossing is therefore the unique minimum in that restricted family. The same conclusion does not follow for an arbitrary curved reflector or an optical system with multiple images. Stationary paths can have different second variations, and several physical rays can connect the same endpoints. Fermat’s principle is a local variational condition, not an algorithm that compares every possible route.

The wave interpretation helps diagnose the misconception. Nearby nonstationary contributions rapidly acquire different phases and tend to cancel, whereas the phase changes only to second order near a stationary path. This is an asymptotic explanation of rays when wavelengths are small compared with system scales; it does not eliminate diffraction. Near a caustic, several rays crowd together and a naive ray amplitude can diverge even though the wave field remains finite. Stationarity survives as a geometric guide while the amplitude approximation needs repair.

Test a candidate crossing

A source and receiver lie 3 cm and 4 cm from opposite sides of an interface. Their horizontal separation is 8 cm. The upper index is 1 and the lower index is 4/34/3. Test the candidate crossing x=4 cmx=4\,\mathrm{cm} for stationarity.

  1. The upper segment is 32+42=5 cm\sqrt{3^2+4^2}=5\,\mathrm{cm} long. The lower segment is 42+42=42 cm\sqrt{4^2+4^2}=4\sqrt2\,\mathrm{cm} long, so geometric length alone does not determine stationarity.

  2. The derivative is 4/5−(4/3)(1/2)≃0.800−0.943=−0.1434/5-(4/3)(1/\sqrt2)\simeq0.800-0.943=-0.143. Its units are centimetres of optical path per centimetre of crossing displacement, hence dimensionless.

  3. A small positive displacement of the crossing therefore decreases optical path to first order. The candidate is not stationary; the minimum crossing lies farther to the right because the derivative increases strictly in this geometry.

The result

The proposed crossing fails Fermat’s condition. Its negative derivative identifies which adjustment reduces optical path without requiring a numerical solution for the final crossing.

Explore the model

Interactive lab

Interactive lab · function

First and second variation near a candidate

Use the parabola only as a local model of optical-path change near a stationary coordinate. Reset, set Coefficient a = 1 and Position x = 0.5, and predict positive slope 1. For a separate run Reset, set a = −1 and x = 0.5, and predict slope −1. Both curves have zero slope at the origin, with opposite curvature.

First and second variation near a candidateThis lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. Current readings: y at chosen x: 0.608; Tangent slope · 2ax: 1.35; Signed area · ax³/3: 0.182. All parameters are adjustable with the labeled controls below.−2.4−1.201.22.4−9−4.504.59xy(x, ax²)
y = ax²TangentSigned integral
y at chosen x
0.608
Tangent slope · 2ax
1.35
Signed area · ax³/3
0.182
t = 0 s

This lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forA zero first derivative alone does not classify a stationary path. This parabola instrument does not trace an optical interface or calculate an optical-path integral.

Check your understanding

What does Fermat’s principle generally require for a physical ray between fixed endpoints?

Try it yourself

A monochromatic beam traverses 6 mm of air with index 1 and 8 mm of nondispersive glass with index 1.5. Find optical path, phase advance in cycles for λ0=0.5 μm\lambda_0=0.5\,\mathrm{\mu m}, and travel time using c=3×108 m s−1c=3\times10^8\,\mathrm{m\,s^{-1}}.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Add index-weighted lengths before converting millimetres to metres or micrometres.

Compare with the solution

The optical path is 6+1.5(8)=18 mm=0.018 m6+1.5(8)=18\,\mathrm{mm}=0.018\,\mathrm m. The number of cycles is 18000/0.5=3600018000/0.5=36000, so the phase advance is 72000π72000\pi radians. Nondispersion allows the delay 0.018/(3×108)=6×10−11 s0.018/(3\times10^8)=6\times10^{-11}\,\mathrm s, or 60 ps. The geometric length is only 14 mm; using it would underestimate both phase and delay.

Take it with you

  • Optical path weights length by phase index at a specified frequency.
  • Varying an interface crossing derives the index-weighted sine condition.
  • Stationarity is more general than global minimization and does not remove diffraction.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.