Fermat's principle, also known as the principle of least time, is the link between ray optics and wave optics. Fermat's principle states that the path taken by a ray between two given points is the path that can be traveled in the least time.

First proposed by the French mathematician Pierre de Fermat in 1662, as a means of explaining the ordinary law of refraction of light (Fig.1), Fermat's principle was initially controversial because it seemed to ascribe knowledge and intent to nature. Not until the 19th century was it understood that nature's ability to test alternative paths is merely a fundamental property of waves.Cf. Young, 1809, p.342; Fresnel, 1827, tr. Hobson, ; De Witte, 1959, p.293n. If points A and B are given, a wavefront expanding from A sweeps all possible ray paths radiating from A, whether they pass through B or not. If the wavefront reaches point B, it sweeps not only the ray path(s) from A to B, but also an infinitude of nearby paths with the same endpoints. Fermat's principle describes any ray that happens to reach point B; there is no implication that the ray "knew" the quickest path or "intended" to take that path.

In its original "strong" form,Cf. Born & Wolf, 2002, p.876. Fermat's principle states that the path taken by a ray between two given points is the path that can be traveled in the least time. In order to be true in all cases, this statement must be weakened by replacing the "least" time with a time that is "stationary" with respect to variations of the path – so that a deviation in the path causes, at most, a second-order change in the traversal time. To put it loosely, a ray path is surrounded by close paths that can be traversed in very close times. It can be shown that this technical definition corresponds to more intuitive notions of a ray, such as a line of sight or the path of a narrow beam.

For the purpose of comparing traversal times, the time from one point to the next nominated point is taken as if the first point were a point-source.De Witte (1959) invokes the point-source condition at the outset (p.294, col.1). Without this condition, the traversal time would be ambiguous; for example, if the propagation time from to were reckoned from an arbitrary wavefront W containing (Fig.2), that time could be made arbitrarily small by suitably angling the wavefront.

Treating a point on the path as a source is the minimum requirement of Huygens's principle, and is part of the explanation of Fermat's principle. But it can also be shown that the geometric construction by which Huygens tried to apply his own principle (as distinct from the principle itself) is simply an invocation of Fermat's principle.De Witte (1959) gives a proof based on calculus of variations. The present article offers a simpler explanation. Hence all the conclusions that Huygens drew from that construction – including, without limitation, the laws of rectilinear propagation of light, ordinary reflection, ordinary refraction, and the extraordinary refraction of "Iceland crystal" (calcite) – are also consequences of Fermat's principle.

Derivation

Sufficient conditions

Suppose that: A disturbance propagates sequentially through a medium (a vacuum or some material, not necessarily homogeneous or isotropic), without action at a distance; During propagation, the influence of the disturbance at any intermediate point P upon surrounding points has a non-zero angular spread (as if P were a source), so that a disturbance originating from any point A arrives at any other point B via an infinitude of paths, by which B receives an infinitude of delayed versions of the disturbance at A;Assumption (2) almost follows from (1) because: (a) to the extent that the disturbance at the intermediate point P can be represented by a scalar, its influence is omnidirectional; (b) to the extent that it can be represented by a vector in the supposed direction of propagation (as in a longitudinal wave), it has a non-zero component in a range of neighboring directions; and (c) to the extent that it can be represented by a vector across the supposed direction of propagation (as in a transverse wave), it has a non-zero component across a range of neighboring directions. Thus there are infinitely many paths from A to B because there are infinitely many paths radiating from every intermediate point P. and These delayed versions of the disturbance will reinforce each other at B if they are synchronized within some tolerance.

Then the various propagation paths from A to B will help each other, or interfere constructively, if their traversal times agree within the said tolerance. For a small tolerance (in the limiting case), the permissible range of variations of the path is maximized if the path is such that its traversal time is stationary with respect to the variations, so that a variation of the path causes at most a second-order change in the traversal time.

The most obvious example of a stationarity in traversal time is a (local or global) minimum – that is, a path of least time, as in the "strong" form of Fermat's principle. But that condition is not essential to the argument.If a ray is reflected off a sufficiently concave surface, the point of reflection is such that the total traversal time is a local maximum, provided that the paths to and from the point of reflection, considered separately, are required to be possible ray paths. But Fermat's principle imposes no such restriction; and without that restriction it is always possible to vary the overall path so as to increase its traversal time. Thus the stationary traversal time of the ray path is never a local maximum (cf. Born & Wolf, 2002, p.137n). But, as the case of the concave reflector shows, neither is it necessarily a local minimum. Hence it is not necessarily an extremum. It must therefore be called a stationarity.

Having established that a path of stationary traversal time is reinforced by a maximally wide corridor of neighboring paths, it remains to be explained how this reinforcement corresponds to intuitive notions of a ray. But, for brevity in the explanations, a ray path is first defined as a path of stationary traversal time.

A ray as a signal path (line of sight)

If the corridor of paths reinforcing a ray path from A to B is substantially obstructed, this will significantly alter the disturbance reaching B from A – unlike a similar-sized obstruction outside any such corridor, blocking paths that do not reinforce each other. The former obstruction will significantly disrupt the signal reaching B from A, while the latter will not; thus the ray path marks a signal path. If the signal is visible light, the former obstruction will significantly affect the appearance of an object at A as seen by an observer at B, while the latter will not; so the ray path marks a line of sight.

In optical experiments, a line of sight is routinely assumed to be a ray path.See (e.g.) Huygens, 1690, tr. Thompson, pp.47,55,58,60,; Newton, 1730, pp.8,18,137,143,166,173.

A ray as an energy path (beam)

If the corridor of paths reinforcing a ray path from A to B is substantially obstructed, this will significantly affect the energyMore precisely, the energy flux density. reaching B from A – unlike a similar-sized obstruction outside any such corridor. Thus the ray path marks an energy path – as does a beam.

Suppose that a wavefront expanding from point A passes point P, which lies on a ray path from point A to point B. By definition, all points on the wavefront have the same propagation time from A. Now let the wavefront be blocked except for a window, centered on P, and small enough to lie within the corridor of paths that reinforce the ray path from A to B. Then all points on the unobstructed portion of the wavefront will have, nearly enough, equal propagation times to B, but not to points in other directions, so that B will be in the direction of peak intensity of the beam admitted through the window.This is the essence of the argument given by Fresnel (1827, tr. Hobson, ). So the ray path marks the beam. And in optical experiments, a beam is routinely considered as a collection of rays or (if it is narrow) as an approximation to a ray (Fig.3).See (e.g.) Newton, 1730, p.55; Huygens, 1690, tr. Thompson, pp.40–41,56.

Analogies

According to the "strong" form of Fermat's principle, the problem of finding the path of a light ray from point A in a medium of faster propagation, to point B in a medium of slower propagation (Fig.1), is analogous to the problem faced by a lifeguard in deciding where to enter the water in order to reach a drowning swimmer as soon as possible, given that the lifeguard can run faster than (s)he can swim. But that analogy falls short of explaining the behavior of the light, because the lifeguard can think about the problem (even if only for an instant) whereas the light presumably cannot. The discovery that ants are capable of similar calculations does not bridge the gap between the animate and the inanimate.

In contrast, the above assumptions (1) to (3) hold for any wavelike disturbance and explain Fermat's principle in purely mechanistic terms, without any imputation of knowledge or purpose.

The principle applies to waves in general, including (e.g.) sound waves in fluids and elastic waves in solids.De Witte, 1959, p.294. In a modified form, it even works for matter waves: in quantum mechanics, the classical path of a particle is obtainable by applying Fermat's principle to the associated wave – except that, because the frequency may vary with the path, the stationarity is in the phase shift (or number of cycles) and not necessarily in the time.

Fermat's principle is most familiar, however, in the case of visible light: it is the link between geometrical optics, which describes certain optical phenomena in terms of rays, and the wave theory of light (or physical optics), which explains the same phenomena on the hypothesis that light consists of waves. Partial obstructions are also described under diffraction.

Equivalence to Huygens's construction

This article distinguishes between Huygens's principle, which states that every point crossed by a traveling wave becomes the source of a secondary wave, and Huygens's construction, which is described below.Dijksterhuis, 2004, pp.165–179, for a detailed treatment of the distinction in the context of Huygens's own work.

Let the surface be a wavefront at time , and let the surface be the same wavefront at the later time (Fig.4). Let be a general point on . Then, according to Huygens's construction,Huygens, 1690, tr. Thompson, pp.19,50–51,63–65,68,75.Hecht, 2017, §4.4–4.5. is the envelope (common tangent surface), on the forward side of , of all the secondary wavefronts each of which would expand in time from a point on , and if the secondary wavefront expanding from point in time touches the surface at point , then and lie on a ray. The construction may be repeated in order to find successive positions of the primary wavefront, and successive points on the ray.

The ray direction given by this construction is the radial direction of the secondary wavefront,Fresnel, 1827, tr. Hobson, p.309. and may differ from the normal of the secondary wavefront (cf. Fig.2), and therefore from the normal of the primary wavefront at the point of tangency. Hence the ray velocity, in magnitude and direction, is the radial velocity of an infinitesimal secondary wavefront, and is generally a function of location and direction.De Witte, 1959, p.294, col.2.D.D. Holm, 2011, Geometric Mechanics, 2nd Ed., London: Imperial College Press, Part 1: "Dynamics and Symmetry", pp.7–12.

Now let be a point on close to , and let be a point on close to . Then, by the construction,   the time taken for a secondary wavefront from to reach has at most a second-order dependence on the displacement , and