Physical world and mathematics / Physics / Classical physics / Waves and optics / Geometrical optics and imaging / Ray tracing and refraction / Fermat's principle

General · Edgepedia7 min read

Fermat's principle

Fermat's principle (also called the principle of least time) is the statement of geometrical optics that, of all possible paths a light ray might take between two points, the actual path is the one whose travel time, or equivalently optical path length, is stationary with respect to small changes of the path.1 • 2 It is the single governing principle from which the central results of geometrical optics, including straight-line propagation, the law of reflection, and Snell's law of refraction, can be derived.1 • 3

Key factDetail
StatementThe ray between two points follows the path of least time; more precisely, any small change in the actual path produces only a second-order change in travel time.1
FormulationOptical path length OPL=∫n(r(s)) ds \mathrm{OPL} = \int n(\mathbf{r}(s))\, ds ; travel time equals OPL divided by c c , so least time and shortest OPL are equivalent.4
OriginProposed by Pierre de Fermat in about 1650; the shortest-distance version for reflection was stated earlier by Hero of Alexandria.1
Main consequencesLaw of reflection θi=θr \theta_i = \theta_r and Snell's law n1sin⁡θ1=n2sin⁡θ2 n_1 \sin\theta_1 = n_2 \sin\theta_2 , plus ray reversibility.2
Imaging conditionAn image forms where many paths from object point to image point have equal optical path length.5
LimitsThe simple minimization fails in anisotropic media, where the refractive index depends on ray direction as well as position.5
Wave-optics statusGeometrical optics is the short-wavelength approximation of wave optics; Fermat's principle can be deduced from Feynman's path integral by the method of stationary phase.3

Statement and optical path length

In a medium with refractive index n n , light travels at speed c/n c/n , where c=3×108 c = 3 \times 10^{8} m/s is the vacuum speed of light.4 The travel time along a path is therefore

tS→P=∫0sPn(r(s))c ds, t_{S \to P} = \int_0^{s_P} \frac{n(\mathbf{r}(s))}{c}\, ds,

and the optical path length (OPL) is defined as

OPL=∫0sPn(r(s)) ds, \mathrm{OPL} = \int_0^{s_P} n(\mathbf{r}(s))\, ds,

the geometrical distance weighted by the refractive index.4 In a homogeneous medium the OPL is simply the refractive index times the geometrical length.6 The OPL is not the physical distance the light travels; it is proportional to the number of wavelengths that fit into that distance, so it increases as the wavelength shortens in a higher-index medium.5

Stationary, not always minimal. The popular phrase "least time" is not strictly correct. The accurate statement is that a ray taking a particular path has the property that a small change in the path, in its shape or in the point where it meets a surface, produces no first-order change in the time, only a second-order change.1 In ordinary cases the stationary path is a local minimum compared with nearby paths, but a ray can take two different paths between the same points, each a local minimum of travel time; reflection by a mirror is a standard example.4

Consequences for reflection and refraction

Law of reflection. For two points A and B at perpendicular distance d d from a plane mirror and separated by D D , the broken path length is L=(x2+d2)1/2+((D−x)2+d2)1/2 L = (x^{2} + d^{2})^{1/2} + ((D - x)^{2} + d^{2})^{1/2} . Setting dL/dx=0 dL/dx = 0 gives x=D/2 x = D/2 , which is equivalent to θi=θr \theta_i = \theta_r : the angle of incidence equals the angle of reflection.2 Feynman presents the same result geometrically by reflecting point B through the mirror plane, so the shortest broken path becomes a straight line to the image point.1

Snell's law. For a ray crossing a flat interface between media of indices n1 n_1 and n2 n_2 , minimizing the optical path length OPL=nixi2+yi2+ntxt2+yt2 \mathrm{OPL} = n_i \sqrt{x_i^{2} + y_i^{2}} + n_t \sqrt{x_t^{2} + y_t^{2}} with respect to the crossing point reduces, using sin⁡θi=yi/xi2+yi2 \sin\theta_i = y_i / \sqrt{x_i^{2} + y_i^{2}} and the corresponding expression for θt \theta_t , to

nisin⁡θi=ntsin⁡θt, n_i \sin\theta_i = n_t \sin\theta_t,

the familiar Snell's law.5 The same derivation appears in Leibniz's original 1684 calculus monograph as an illustration of the power of the new calculus.7 Requiring stationarity of L=∫n ds L = \int n\, ds also forces the incident, refracted, and surface-normal directions to be coplanar.8

Ray reversibility. Because the optical path length between two points is the same whether computed from A to B or from B to A, any actual ray reversed in direction retraces the same path backward; this is the principle of geometrical reversibility.2

Imaging and curved paths

Fermat's principle explains both why rays bend in inhomogeneous media and why lenses form images. When the refractive index varies with position, the correct ray between two points need not be straight but can follow a complicated curve determined by how the index varies; a mirage can be calculated by minimizing the functional I[x(y)]=∫n(y)1+x′(y)2 dy I[x(y)] = \int n(y) \sqrt{1 + x'(y)^{2}}\, dy .5 • 9 An imaging situation occurs when many paths from point A to point B have the same optical path length: in a lens, the ray through the center has a shorter geometrical path length but passes through more material, so its OPL equals that of the outer rays, and all rays from the object point arrive at the image point in phase.5 The same constant-OPL requirement fixes the curvature of a reflective surface that images one point to another.5

In the language of variational calculus, rays are extremal curves of the action functional S=∫abc(x)∣X˙(t)∣dt S = \int_a^b \frac{c(x)}{|\dot{X}(t)|} dt , and they are geodesics of the metric ds2=c−2(x) dx2 ds^{2} = c^{-2}(x)\, dx^{2} ; when several rays link the same two points, a situation called multipathing, the travel time takes multiple values, with discontinuities along curves called caustics.10

Relation to wave optics

Geometrical optics is the short-wavelength approximation of wave optics, and all of its results can be derived from the single Fermat principle, while wave optics in the scalar quasi-monochromatic approximation rests on the Huygens-Fresnel principle.3 The two are connected: writing the optical propagator as a Feynman path integral over all virtual paths and applying the method of stationary phase collapses the integral onto the one path whose optical length is stationary, which is exactly the path satisfying Fermat's principle, with the phase function becoming the point eikonal.3 The wavelength sets the scale of this connection: the wavelength tells how far away the light must effectively "smell" the path to check it, which is why the ray picture fails when apertures become comparable to the wavelength.1 • 11

Extensions and limits

The simple minimization of optical path length does not give the correct path in anisotropic media such as crystals, where n n depends on the direction of the ray as well as its location.5 The principle has nonetheless been extended well beyond its original setting. It remains valid when the optical media and the boundaries between them move at relativistic speeds, once the rest-frame isotropic medium is treated as optically anisotropic in the moving frame.12 It has been generalized to stationary space-times for gravitational light rays,13 and detailed derivations from Fermat's principle give generalized Snell-Descartes laws relevant to gradient-index optics and to metasurfaces, where a collection of rays emerges from the surface as a result of multiple reflections inside it.14

Historical note

Fermat proposed the principle in about 1650, inspired by the earlier observation of Hero of Alexandria that reflected light takes the shortest possible distance to the mirror and back.1 At the time, the finiteness of the speed of light was suspected but unmeasured; in 1676 the Danish astronomer Ole Römer computed it from the eclipses of a moon of Jupiter and arrived at an estimate only 30 percent too low.4 Fermat's minimization problem also anticipated the calculus of variations, the field later developed by Euler, Lagrange, and Hamilton, in which the same stationary-integral structure governs mechanics.9

References

  1. The Feynman Lectures on Physics, Vol. I, Ch. 26: Optics: The Principle of Least Time
  2. Fermat's principle, University of Tennessee Physics 421 lecture notes
  3. A. V. Gitin (2012). Mathematical Fundamentals of Modern Linear Optics. International Journal of Antennas and Propagation.
  4. 2.3: Principle of Fermat, Physics LibreTexts (Konijnenberg, Adam, and Urbach, TU Delft)
  5. Optics textbook, Brigham Young University, Ch. 9: Light as Rays
  6. Chapter 1: Ray Optics, KrakenOS documentation
  7. 2.1.2 Light reflection and refraction, University of Illinois course notes
  8. Laws of Reflection and Refraction from Fermat, physics2u
  9. University of Kentucky Physics 404G, Homework #4
  10. Waves and Imaging, Geometrical Optics, MIT 18.325 lecture notes
  11. PHYS 201 Lecture 16: Ray or Geometrical Optics I, Open Yale Courses
  12. Fermat's principle of least time in the presence of uniformly moving boundaries and media, arXiv:physics/0702100
  13. A Fermat principle for stationary space-times and applications to light rays, ScienceDirect
  14. Detailed derivation of the generalized Snell–Descartes laws from Fermat's principle, Journal of the Optical Society of America A

Topic: Encyclopedia › Physical world and mathematics › Physics › Classical physics › Waves and optics › Geometrical optics and imaging › Ray tracing and refraction › Fermat's principle

Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026

Notice something wrong?

© 2026 EdgeChat AI, a subsidiary of Biostate AI. Free to use with credit under the Edgepedia Community License. Developers: read Edgepedia by API or MCP. Embed a reference card.

Report an error in this article

Fermat's principle

Pick at least one reason.