Calculus of variations is a field of mathematical analysis that deals with maximizing or minimizing functionals, which are mappings from a set of functions to the real numbers. Functionals are often expressed as definite integrals involving functions and their derivatives. The interest is in extremal functions that make the functional attain a maximum or minimum value – or stationary functions – those where the rate of change of the functional is zero.
A simple example of such a problem is to find the curve of shortest length connecting two points. If there are no constraints, the solution is obviously a straight line between the points. However, if the curve is constrained to lie on a surface in space, then the solution is less obvious, and possibly many solutions may exist. Such solutions are known as geodesics. A related problem is posed by Fermat's principle: light follows the path of shortest optical length connecting two points, where the optical length depends upon the material of the medium. One corresponding concept in mechanics is the principle of least action.
Many important problems involve functions of several variables. Solutions of boundary value problems for the Laplace equation satisfy the Dirichlet principle. Plateau's problem requires finding a surface of minimal area that spans a given contour in space: a solution can often be found by dipping a frame in a solution of soap suds. Although such experiments are relatively easy to perform, their mathematical interpretation is far from simple: there may be more than one locally minimizing surface, and they may have nontrivial topology.
History
The calculus of variations may be said to begin with the brachistochrone curve problem raised by Johann Bernoulli (1696).^{[1]} It immediately occupied the attention of Jakob Bernoulli and the Marquis de l'Hôpital, but Leonhard Euler first elaborated the subject. His contributions began in 1733, and his Elementa Calculi Variationum gave to the science its name. Lagrange contributed extensively to the theory, and Legendre (1786) laid down a method, not entirely satisfactory, for the discrimination of maxima and minima. Isaac Newton and Gottfried Leibniz also gave some early attention to the subject.^{[2]} To this discrimination Vincenzo Brunacci (1810), Carl Friedrich Gauss (1829), Siméon Poisson (1831), Mikhail Ostrogradsky (1834), and Carl Jacobi (1837) have been among the contributors. An important general work is that of Sarrus (1842) which was condensed and improved by Cauchy (1844). Other valuable treatises and memoirs have been written by Strauch (1849), Jellett (1850), Otto Hesse (1857), Alfred Clebsch (1858), and Carll (1885), but perhaps the most important work of the century is that of Weierstrass. His celebrated course on the theory is epochmaking, and it may be asserted that he was the first to place it on a firm and unquestionable foundation. The 20th and the 23rd Hilbert problem published in 1900 encouraged further development.^{[2]} In the 20th century David Hilbert, Emmy Noether, Leonida Tonelli, Henri Lebesgue and Jacques Hadamard among others made significant contributions.^{[2]} Marston Morse applied calculus of variations in what is now called Morse theory.^{[3]} Lev Pontryagin, Ralph Rockafellar and F. H. Clarke developed new mathematical tools for the calculus of variations in optimal control theory.^{[3]} The Dynamic Programming of Richard Bellman is an alternative to the calculus of variations.^{[4]}^{[5]}^{[6]}
Extrema
The calculus of variations is concerned with the maxima or minima of functionals, which are collectively called extrema. A functional depends on a function, somewhat analogous to the way a function can depend on a numerical variable, and thus a functional has been described as a function of a function. Functionals have extrema with respect to the elements y of a given function space defined over a given domain. A functional J [ y ] is said to have an extremum at the function f if ΔJ = J [ y ]  J [ f] has the same sign for all y in an arbitrarily small neighborhood of f .^{[Note 1]} The function f is called an extremal function or extremal. The extremum J [ f ] is called a maximum if ΔJ ≤ 0 everywhere in an arbitrarily small neighborhood of f , and a minimum if ΔJ ≥ 0 there. For a function space of continuous functions, extrema of corresponding functionals are called weak or strong, depending on whether the first derivatives of the continuous functions are respectively all continuous or not.^{[8]}
A more detailed definition of weak and strong extrema involves the concept of the norm of a function in a function space, which has a role that is similar to the length of a vector in a vector space. If y is an element of the function space C(a,b) of all continuous functions that are defined on a closed interval [a,b], the norm  y _{0} defined on C(a,b) is the maximum absolute value of y (x) for a ≤ x ≤ b,^{[9]}

\ y \_0 \equiv \max_{a \le x \le b} y(x) \qquad \text{where} \ \ y \in C(a,b) \, .
Similarly, if y is an element of the function space D_{1}(a,b) of all functions of C(a,b) that have continuous first derivatives, the norm  y _{1} defined on D_{1}(a,b) is the sum of the maximum absolute value of y (x) and the maximum absolute value of its first derivative y ′(x), for a ≤ x ≤ b,^{[9]}

\ y \_1 \equiv \max_{a \le x \le b} y(x) \ + \max_{a \le x \le b} y\,'(x) \qquad \text{where} \ \ y \in D_1(a,b) \, .
A functional J [ y ] is said to have a weak extremum at the function f if there exists some δ > 0 such that, J [ y ]  J [ f] has the same sign for all functions y ∈ D_{1}(a,b) with  y  f _{1} < δ. Similarly, a functional J [ y ] is said to have a strong extremum at the function f if there exists some δ > 0 such that, J [ y ]  J [ f] has the same sign for all functions y ∈ C (a,b) with  y  f _{0} < δ.^{[10]}
Both strong and weak extrema of functionals are for a space of continuous functions but weak extrema have the additional requirement that the first derivatives of the functions in the space be continuous. Thus a strong extremum is also a weak extremum, but the converse may not hold. Finding strong extrema is more difficult than finding weak extrema.^{[10]} An example of a necessary condition that is used for finding weak extrema is the Euler–Lagrange equation.^{[11]}^{[Note 2]}
Euler–Lagrange equation
Finding the extrema of functionals is similar to finding the maxima and minima of functions. The maxima and minima of a function may be located by finding the points where its derivative vanishes (i.e., is equal to zero). The extrema of functionals may be obtained by finding functions where the functional derivative is equal to zero. This leads to solving the associated Euler–Lagrange equation.^{[Note 3]}
Consider the functional

J[y] = \int_{x_1}^{x_2} L[x,y(x),y'(x)]\, dx \, .
where

x_{1}, x_{2} are constants,

y (x) is twice continuously differentiable,

y ′(x) = dy / dx ,

L[x, y (x), y ′(x)] is twice continuously differentiable with respect to its arguments x, y, y ′.
If the functional J[y ] attains a local minimum at f , and η(x) is an arbitrary function that has at least one derivative and vanishes at the endpoints x_{1} and x_{2} , then for any number ε close to 0,

J[f] \le J[f + \varepsilon \eta] \, .
The term εη is called the variation of the function f and is denoted by δf .^{[12]}
Substituting f + εη for y in the functional J[ y ] , the result is a function of ε,

\Phi(\varepsilon) = J[f+\varepsilon\eta] \, .
Since the functional J[ y ] has a minimum for y = f , the function Φ(ε) has a minimum at ε = 0 and thus,^{[Note 4]}

\Phi'(0) \equiv \left.\frac{d\Phi}{d\varepsilon}\right_{\varepsilon = 0} = \int_{x_1}^{x_2} \left.\frac{dL}{d\varepsilon}\right_{\varepsilon = 0} dx = 0 \, .
Taking the total derivative of L[x, y, y ′] , where y = f + ε η and y ′ = f ′ + ε η′ are functions of ε but x is not,

\frac{dL}{d\varepsilon}=\frac{\partial L}{\partial y}\frac{dy}{d\varepsilon} + \frac{\partial L}{\partial y'}\frac{dy'}{d\varepsilon}
and since dy /dε = η and dy ′/dε = η' ,

\frac{dL}{d\varepsilon}=\frac{\partial L}{\partial y}\eta + \frac{\partial L}{\partial y'}\eta' .
Therefore,

\begin{align} \int_{x_1}^{x_2} \left.\frac{dL}{d\varepsilon}\right_{\varepsilon = 0} dx & = \int_{x_1}^{x_2} \left(\frac{\partial L}{\partial f} \eta + \frac{\partial L}{\partial f'} \eta'\right)\, dx \\ & = \int_{x_1}^{x_2} \left(\frac{\partial L}{\partial f} \eta  \eta \frac{d}{dx}\frac{\partial L}{\partial f'} \right)\, dx + \left.\frac{\partial L}{\partial f'} \eta \right_{x_1}^{x_2}\\ \end{align}
where L[x, y, y ′] → L[x, f, f ′] when ε = 0 and we have used integration by parts. The last term vanishes because η = 0 at x_{1} and x_{2} by definition. Also, as previously mentioned the left side of the equation is zero so that

\int_{x_1}^{x_2} \eta \left(\frac{\partial L}{\partial f}  \frac{d}{dx}\frac{\partial L}{\partial f'} \right) \, dx = 0 \, .
According to the fundamental lemma of calculus of variations, the part of the integrand in parentheses is zero, i.e.

\frac{\part L}{\part f} \frac{d}{dx} \frac{\part L}{\part f'}=0
which is called the Euler–Lagrange equation. The left hand side of this equation is called the functional derivative of J[f] and is denoted δJ/δf(x) .
In general this gives a secondorder ordinary differential equation which can be solved to obtain the extremal function f(x) . The Euler–Lagrange equation is a necessary, but not sufficient, condition for an extremum J[f]. Sufficient conditions for an extremum are discussed in the references.^{[Note 2]}
Example
In order to illustrate this process, consider the problem of finding the extremal function y = f (x) , which is the shortest curve that connects two points (x_{1}, y_{1}) and (x_{2}, y_{2}) . The arc length of the curve is given by

A[y] = \int_{x_1}^{x_2} \sqrt{1 + [ y'(x) ]^2} \, dx \, ,
with

y\,'(x) = \frac{dy}{dx} \, , \ \ y_1=f(x_1) \, , \ \ y_2=f(x_2) \, .
The Euler–Lagrange equation will now be used to find the extremal function f (x) that minimizes the functional A[y ] .

\frac{\part L}{\part f} \frac{d}{dx} \frac{\part L}{\part f'}=0
with

L = \sqrt{1 + [ f'(x) ]^2} \, .
Since f does not appear explicitly in L , the first term in the Euler–Lagrange equation vanishes for all f (x) and thus,

\frac{d}{dx} \frac{\part L}{\part f'} = 0 \, .
Substituting for L and taking the partial derivative,

\frac{d}{dx} \ \frac{ f'(x) } {\sqrt{1 + [ f'(x) ]^2}} \ = 0 \, .
Taking the derivative d/dx and simplifying gives,

\frac{d^2 f}{dx^2}\ \cdot\ \frac{1}{\left[\sqrt{1+[f'(x)]^2}\ \right]^3} = 0 \, ,
and because 1+[f ′(x)]^{2} is positive,

\frac{d^2 f}{dx^2} = 0 \, ,
which implies that the shortest curve that connects two points (x_{1}, y_{1}) and (x_{2}, y_{2}) is

f(x) = m x + b \qquad \text{with} \ \ m = \frac{y_2  y_1}{x_2  x_1} \quad \text{and} \quad b = \frac{x_2 y_1  x_1 y_2}{x_2  x_1}
and we have thus found the extremal function f(x) that minimizes the functional A[y] so that A[f] is a minimum. Note that y = f(x) is the equation for a straight line as expected.
Beltrami identity
In physics problems it frequently turns out that ∂L / ∂x = 0. In that case, the Euler–Lagrange equation can be simplified to the Beltrami identity:^{[13]}

Lf'\frac{\part L}{\part f'}=C \, ,
where C is a constant. The left hand side is the Legendre transformation of L with respect to f ′.
Du BoisReymond's theorem
The discussion thus far has assumed that extremal functions possess two continuous derivatives, although the existence of the integral A requires only first derivatives of trial functions. The condition that the first variation vanish at an extremal may be regarded as a weak form of the Euler–Lagrange equation. The theorem of Du BoisReymond asserts that this weak form implies the strong form. If L has continuous first and second derivatives with respect to all of its arguments, and if

\frac{\part^2 L}{(\part f')^2} \ne 0,
then f_0 has two continuous derivatives, and it satisfies the Euler–Lagrange equation.
Lavrentiev phenomenon
Hilbert was the first to give good conditions for the Euler–Lagrange equations to give a stationary solution. Within a convex area and a positive thrice differentiable Lagrangian the solutions are composed of a countable collection of sections that either go along the boundary or satisfy the Euler–Lagrange equations in the interior.
However Lavrentiev in 1926 showed that there are circumstances where there is no optimum solution but one can be approached arbitrarily closely by increasing numbers of sections. For instance the following:

L(t,x,x') = (x^3t)^2 x'^6,\,

x(0)=0,\, x(1)=1.\,
Here a zig zag path gives a better solution than any smooth path and increasing the number of sections improves the solution.
Functions of several variables
Variational problems that involve multiple integrals arise in numerous applications. For example, if φ(x,y) denotes the displacement of a membrane above the domain D in the x,y plane, then its potential energy is proportional to its surface area:

U[\varphi] = \iint_D \sqrt{1 +\nabla \varphi \cdot \nabla \varphi} dx\,dy.\,
Plateau's problem consists of finding a function that minimizes the surface area while assuming prescribed values on the boundary of D; the solutions are called minimal surfaces. The Euler–Lagrange equation for this problem is nonlinear:

\varphi_{xx}(1 + \varphi_y^2) + \varphi_{yy}(1 + \varphi_x^2)  2\varphi_x \varphi_y \varphi_{xy} = 0.\,
See Courant (1950) for details.
Dirichlet's principle
It is often sufficient to consider only small displacements of the membrane, whose energy difference from no displacement is approximated by

V[\varphi] = \frac{1}{2}\iint_D \nabla \varphi \cdot \nabla \varphi \, dx\, dy.\,
The functional V is to be minimized among all trial functions φ that assume prescribed values on the boundary of D. If u is the minimizing function and v is an arbitrary smooth function that vanishes on the boundary of D, then the first variation of V[u + \varepsilon v] must vanish:

\frac{d}{d\varepsilon} V[u + \varepsilon v]_{\varepsilon=0} = \iint_D \nabla u \cdot \nabla v \, dx\,dy = 0.\,
Provided that u has two derivatives, we may apply the divergence theorem to obtain

\iint_D \nabla \cdot (v \nabla u) \,dx\,dy = \iint_D \nabla u \cdot \nabla v + v \nabla \cdot \nabla u \,dx\,dy = \iint_C v \frac{\part u}{\part n} ds, \,
where C is the boundary of D, s is arclength along C and \part u / \part n is the normal derivative of u on C. Since v vanishes on C and the first variation vanishes, the result is

\iint_D v\nabla \cdot \nabla u \,dx\,dy =0 \,
for all smooth functions v that vanish on the boundary of D. The proof for the case of one dimensional integrals may be adapted to this case to show that

\nabla \cdot \nabla u= 0 \, in D.
The difficulty with this reasoning is the assumption that the minimizing function u must have two derivatives. Riemann argued that the existence of a smooth minimizing function was assured by the connection with the physical problem: membranes do indeed assume configurations with minimal potential energy. Riemann named this idea the Dirichlet principle in honor of his teacher Peter Gustav Lejeune Dirichlet. However Weierstrass gave an example of a variational problem with no solution: minimize

W[\varphi] = \int_{1}^{1} (x\varphi')^2 \, dx\,
among all functions φ that satisfy \varphi(1)=1 and \varphi(1)=1. W can be made arbitrarily small by choosing piecewise linear functions that make a transition between 1 and 1 in a small neighborhood of the origin. However, there is no function that makes W=0. The resulting controversy over the validity of Dirichlet's principle is explained in http://turnbull.mcs.stand.ac.uk/~history/Biographies/Riemann.html . Eventually it was shown that Dirichlet's principle is valid, but it requires a sophisticated application of the regularity theory for elliptic partial differential equations; see Jost and LiJost (1998).
Generalization to other boundary value problems
A more general expression for the potential energy of a membrane is

V[\varphi] = \iint_D \left[ \frac{1}{2} \nabla \varphi \cdot \nabla \varphi + f(x,y) \varphi \right] \, dx\,dy \, + \int_C \left[ \frac{1}{2} \sigma(s) \varphi^2 + g(s) \varphi \right] \, ds.
This corresponds to an external force density f(x,y) in D, an external force g(s) on the boundary C, and elastic forces with modulus \sigma(s) acting on C. The function that minimizes the potential energy with no restriction on its boundary values will be denoted by u. Provided that f and g are continuous, regularity theory implies that the minimizing function u will have two derivatives. In taking the first variation, no boundary condition need be imposed on the increment v. The first variation of V[u + \varepsilon v] is given by

\iint_D \left[ \nabla u \cdot \nabla v + f v \right] \, dx\, dy + \int_C \left[ \sigma u v + g v \right] \, ds =0. \,
If we apply the divergence theorem, the result is

\iint_D \left[ v \nabla \cdot \nabla u + v f \right] \, dx \, dy + \int_C v \left[ \frac{\part u}{\part n} + \sigma u + g \right] \, ds =0. \,
If we first set v=0 on C, the boundary integral vanishes, and we conclude as before that

 \nabla \cdot \nabla u + f =0 \,
in D. Then if we allow v to assume arbitrary boundary values, this implies that u must satisfy the boundary condition

\frac{\part u}{\part n} + \sigma u + g =0, \,
on C. Note that this boundary condition is a consequence of the minimizing property of u: it is not imposed beforehand. Such conditions are called natural boundary conditions.
The preceding reasoning is not valid if \sigma vanishes identically on C. In such a case, we could allow a trial function \varphi \equiv c, where c is a constant. For such a trial function,

V[c] = c\left[ \iint_D f \, dx\,dy + \int_C g ds \right].
By appropriate choice of c, V can assume any value unless the quantity inside the brackets vanishes. Therefore the variational problem is meaningless unless

\iint_D f \, dx\,dy + \int_C g \, ds =0.\,
This condition implies that net external forces on the system are in equilibrium. If these forces are in equilibrium, then the variational problem has a solution, but it is not unique, since an arbitrary constant may be added. Further details and examples are in Courant and Hilbert (1953).
Eigenvalue problems
Both onedimensional and multidimensional eigenvalue problems can be formulated as variational problems.
SturmLiouville problems
The SturmLiouville eigenvalue problem involves a general quadratic form

Q[\varphi] = \int_{x_1}^{x_2} \left[ p(x) \varphi'(x)^2 + q(x) \varphi(x)^2 \right] \, dx, \,
where φ is restricted to functions that satisfy the boundary conditions

\varphi(x_1)=0, \quad \varphi(x_2)=0. \,
Let R be a normalization integral

R[\varphi] =\int_{x_1}^{x_2} r(x)\varphi(x)^2 \, dx.\,
The functions p(x) and r(x) are required to be everywhere positive and bounded away from zero. The primary variational problem is to minimize the ratio Q/R among all φ satisfying the endpoint conditions. It is shown below that the Euler–Lagrange equation for the minimizing u is

(pu')' +q u \lambda r u =0, \,
where λ is the quotient

\lambda = \frac{Q[u]}{R[u]}. \,
It can be shown (see Gelfand and Fomin 1963) that the minimizing u has two derivatives and satisfies the Euler–Lagrange equation. The associated λ will be denoted by \lambda_1; it is the lowest eigenvalue for this equation and boundary conditions. The associated minimizing function will be denoted by u_1(x). This variational characterization of eigenvalues leads to the Rayleigh–Ritz method: choose an approximating u as a linear combination of basis functions (for example trigonometric functions) and carry out a finitedimensional minimization among such linear combinations. This method is often surprisingly accurate.
The next smallest eigenvalue and eigenfunction can be obtained by minimizing Q under the additional constraint

\int_{x_1}^{x_2} r(x) u_1(x) \varphi(x) \, dx=0. \,
This procedure can be extended to obtain the complete sequence of eigenvalues and eigenfunctions for the problem.
The variational problem also applies to more general boundary conditions. Instead of requiring that φ vanish at the endpoints, we may not impose any condition at the endpoints, and set

Q[\varphi] = \int_{x_1}^{x_2} \left[ p(x) \varphi'(x)^2 + q(x)\varphi(x)^2 \right] \, dx + a_1 \varphi(x_1)^2 + a_2 \varphi(x_2)^2, \,
where a_1 and a_2 are arbitrary. If we set \varphi = u + \varepsilon v the first variation for the ratio Q/R is

V_1 = \frac{2}{R[u]} \left( \int_{x_1}^{x_2} \left[ p(x) u'(x)v'(x) + q(x)u(x)v(x) \lambda u(x) v(x) \right] \, dx + a_1 u(x_1)v(x_1) + a_2 u(x_2)v(x_2) \right) , \,
where λ is given by the ratio Q[u]/R[u] as previously. After integration by parts,

\frac{R[u]}{2} V_1 = \int_{x_1}^{x_2} v(x) \left[ (p u')' + q u \lambda r u \right] \, dx + v(x_1)[ p(x_1)u'(x_1) + a_1 u(x_1)] + v(x_2) [p(x_2) u'(x_2) + a_2 u(x_2)]. \,
If we first require that v vanish at the endpoints, the first variation will vanish for all such v only if

(p u')' + q u \lambda r u =0 \quad \hbox{for} \quad x_1 < x < x_2.\,
If u satisfies this condition, then the first variation will vanish for arbitrary v only if

p(x_1)u'(x_1) + a_1 u(x_1)=0, \quad \hbox{and} \quad p(x_2) u'(x_2) + a_2 u(x_2)=0.\,
These latter conditions are the natural boundary conditions for this problem, since they are not imposed on trial functions for the minimization, but are instead a consequence of the minimization.
Eigenvalue problems in several dimensions
Eigenvalue problems in higher dimensions are defined in analogy with the onedimensional case. For example, given a domain D with boundary B in three dimensions we may define

Q[\varphi] = \iiint_D p(X) \nabla \varphi \cdot \nabla \varphi + q(X) \varphi^2 \, dx \, dy \, dz + \iint_B \sigma(S) \varphi^2 \, dS, \,
and

R[\varphi] = \iiint_D r(X) \varphi(X)^3 \, dx \, dy \, dz.\,
Let u be the function that minimizes the quotient Q[\varphi] / R[\varphi], with no condition prescribed on the boundary B. The Euler–Lagrange equation satisfied by u is

\nabla \cdot (p(X) \nabla u) + q(x) u  \lambda r(x) u=0,\,
where

\lambda = \frac{Q[u]}{R[u]}.\,
The minimizing u must also satisfy the natural boundary condition

p(S) \frac{\part u}{\part n} + \sigma(S) u =0,
on the boundary B. This result depends upon the regularity theory for elliptic partial differential equations; see Jost and LiJost (1998) for details. Many extensions, including completeness results, asymptotic properties of the eigenvalues and results concerning the nodes of the eigenfunctions are in Courant and Hilbert (1953).
Applications
Some applications of the calculus of variations include:
Fermat's principle
Fermat's principle states that light takes a path that (locally) minimizes the optical length between its endpoints. If the xcoordinate is chosen as the parameter along the path, and y=f(x) along the path, then the optical length is given by

A[f] = \int_{x=x_0}^{x_1} n(x,f(x)) \sqrt{1 + f'(x)^2} dx, \,
where the refractive index n(x,y) depends upon the material. If we try f(x) = f_0 (x) + \varepsilon f_1 (x) then the first variation of A (the derivative of A with respect to ε) is

\delta A[f_0,f_1] = \int_{x=x_0}^{x_1} \left[ \frac{ n(x,f_0) f_0'(x) f_1'(x)}{\sqrt{1 + f_0'(x)^2}} + n_y (x,f_0) f_1 \sqrt{1 + f_0'(x)^2} \right] dx.
After integration by parts of the first term within brackets, we obtain the Euler–Lagrange equation

\frac{d}{dx} \left[\frac{ n(x,f_0) f_0'}{\sqrt{1 + f_0'^2}} \right] + n_y (x,f_0) \sqrt{1 + f_0'(x)^2} =0. \,
The light rays may be determined by integrating this equation. This formalism is used in the context of Lagrangian optics and Hamiltonian optics.
Snell's law
There is a discontinuity of the refractive index when light enters or leaves a lens. Let

n(x,y) = n_ \quad \hbox{if} \quad x<0, \,

n(x,y) = n_+ \quad \hbox{if} \quad x>0,\,
where n_ and n_+ are constants. Then the Euler–Lagrange equation holds as before in the region where x<0 or x>0, and in fact the path is a straight line there, since the refractive index is constant. At the x=0, f must be continuous, but f' may be discontinuous. After integration by parts in the separate regions and using the Euler–Lagrange equations, the first variation takes the form

\delta A[f_0,f_1] = f_1(0)\left[ n_\frac{f_0'(0_)}{\sqrt{1 + f_0'(0_)^2}} n_+\frac{f_0'(0_+)}{\sqrt{1 + f_0'(0_+)^2}} \right].\,
The factor multiplying n_ is the sine of angle of the incident ray with the x axis, and the factor multiplying n_+ is the sine of angle of the refracted ray with the x axis. Snell's law for refraction requires that these terms be equal. As this calculation demonstrates, Snell's law is equivalent to vanishing of the first variation of the optical path length.
Fermat's principle in three dimensions
It is expedient to use vector notation: let X=(x_1,x_2,x_3), let t be a parameter, let X(t) be the parametric representation of a curve C, and let \dot X(t) be its tangent vector. The optical length of the curve is given by

A[C] = \int_{t=t_0}^{t_1} n(X) \sqrt{ \dot X \cdot \dot X} dt. \,
Note that this integral is invariant with respect to changes in the parametric representation of C. The Euler–Lagrange equations for a minimizing curve have the symmetric form

\frac{d}{dt} P = \sqrt{ \dot X \cdot \dot X} \nabla n, \,
where

P = \frac{n(X) \dot X}{\sqrt{\dot X \cdot \dot X} }.\,
It follows from the definition that P satisfies

P \cdot P = n(X)^2. \,
Therefore the integral may also be written as

A[C] = \int_{t=t_0}^{t_1} P \cdot \dot X \, dt.\,
This form suggests that if we can find a function ψ whose gradient is given by P, then the integral A is given by the difference of ψ at the endpoints of the interval of integration. Thus the problem of studying the curves that make the integral stationary can be related to the study of the level surfaces of ψ. In order to find such a function, we turn to the wave equation, which governs the propagation of light. This formalism is used in the context of Lagrangian optics and Hamiltonian optics.
Connection with the wave equation
The wave equation for an inhomogeneous medium is

u_{tt} = c^2 \nabla \cdot \nabla u, \,
where c is the velocity, which generally depends upon X. Wave fronts for light are characteristic surfaces for this partial differential equation: they satisfy

\varphi_t^2 = c(X)^2 \nabla \varphi \cdot \nabla \varphi. \,
We may look for solutions in the form

\varphi(t,X) = t  \psi(X). \,
In that case, ψ satisfies

\nabla \psi \cdot \nabla \psi = n^2, \,
where n=1/c. According to the theory of firstorder partial differential equations, if P = \nabla \psi, then P satisfies

\frac{dP}{ds} = n \nabla n, \,
along a system of curves (the light rays) that are given by

\frac{dX}{ds} = P. \,
These equations for solution of a firstorder partial differential equation are identical to the Euler–Lagrange equations if we make the identification

\frac{ds}{dt} = \frac{\sqrt{ \dot X \cdot \dot X} }{n}. \,
We conclude that the function ψ is the value of the minimizing integral A as a function of the upper end point. That is, when a family of minimizing curves is constructed, the values of the optical length satisfy the characteristic equation corresponding the wave equation. Hence, solving the associated partial differential equation of first order is equivalent to finding families of solutions of the variational problem. This is the essential content of the Hamilton–Jacobi theory, which applies to more general variational problems.
Action principle
In classical mechanics, the action, S, is defined as the time integral of the Lagrangian, L. The Lagrangian is the difference of energies,

L = T  U, \,
where T is the kinetic energy of a mechanical system and U its potential energy. Hamilton's principle (or the action principle) states that the motion of a conservative holonomic (integrable constraints) mechanical system is such that the action integral

S = \int_{t=t_0}^{t_1} L(x, \dot x, t) dt \,
is stationary with respect to variations in the path x(t). The Euler–Lagrange equations for this system are known as Lagrange's equations:

\frac{d}{dt} \frac{\part L}{\part \dot x} = \frac{\part L}{\part x}, \,
and they are equivalent to Newton's equations of motion (for such systems).
The conjugate momenta P are defined by

p = \frac{\part L}{\part \dot x}. \,
For example, if

T = \frac{1}{2} m \dot x^2, \,
then

p = m \dot x. \,
Hamiltonian mechanics results if the conjugate momenta are introduced in place of \dot x, and the Lagrangian L is replaced by the Hamiltonian H defined by

H(x, p, t) = p \,\dot x  L(x,\dot x, t).\,
The Hamiltonian is the total energy of the system: H = T + U. Analogy with Fermat's principle suggests that solutions of Lagrange's equations (the particle trajectories) may be described in terms of level surfaces of some function of X. This function is a solution of the Hamilton–Jacobi equation:

\frac{\part \psi}{\part t} + H\left(x,\frac{\part \psi}{\part x},t\right) =0.\,
See also
Notes

^ The neighborhood of f is the part of the given function space where  y  f < h over the whole domain of the functions, with h a positive number that specifies the size of the neighborhood.^{[7]}

^ ^{a} ^{b} For sufficient conditions, see Gelfand & Fomin 2000. Chapter 5: "The Second Variation. Sufficient Conditions for a Weak Extremum". Sufficient conditions for a weak minimum are given by the theorem on p. 116. Chapter 6: "Fields. Sufficient Conditions for a Strong Extremum". Sufficient conditions for a strong minimum are given by the theorem on p. 148.

^ The following derivation of the Euler–Lagrange equation corresponds to the derivation on pp. 184–5 of:

^ The product εΦ′(0) is called the first variation of the functional J and is denoted by δJ. Some references define the first variation differently by leaving out the ε factor.
References

^

^ ^{}a ^{b} ^{c} van Brunt, Bruce (2004). The Calculus of Variations. Springer.

^ ^{}a ^{b} Ferguson, James (2004). "Brief Survey of the History of the Calculus of Variations and its Applications". arXiv:arXiv:math/0402357.

^ Dimitri P Bertsekas. Dynamic programming and optimal control. Athena Scientific, 2005.

^ Bellman, Richard E. (1954). "Dynamic Programming and a new formalism in the calculus of variations". Proc. Nat. Acad. Sci. 40 (4): 231–235.

^ Kushner, Harold J. (2004). "Richard E. Bellman Control Heritage Award". American Automatic Control Council. Retrieved 20130728. See 2004: Harold J. Kushner: regarding Dynamic Programming, "The calculus of variations had related ideas (e.g., the work of Caratheodory, the HamiltonJacobi equation). This led to conflicts with the calculus of variations community."

^

^ (Gelfand & Fomin 2000, pp. 12–13)

^ ^{a} ^{b} (Gelfand & Fomin 2000, p. 6)

^ ^{a} ^{b} (Gelfand & Fomin 2000, p. 13)

^ (Gelfand & Fomin 2000, pp. 14–15)

^ (Courant & Hilbert 1953, p. 184)

^ Weisstein, Eric W. "EulerLagrange Differential Equation." From MathWorldA Wolfram Web Resource. See Eq. (5).
Further reading

Dacorogna, Bernard. Introduction to the Calculus of Variations (3rd Edition), 2014, World Scientific Publishing, ISBN 9781783265510. Introduction

Bolza, O.: Lectures on the Calculus of Variations. Chelsea Publishing Company, 1904, available on Digital Mathematics library [1]. 2nd edition republished in 1961, paperback in 2005, ISBN 9781418182014.

Cassel, Kevin W.: Variational Methods with Applications in Science and Engineering, Cambridge University Press, 2013.

Clegg, J.C.: Calculus of Variations, Interscience Publishers Inc., 1968.

Courant, R.: Dirichlet's principle, conformal mapping and minimal surfaces. Interscience, 1950.

Elsgolc, L.E.: Calculus of Variations, Pergamon Press Ltd., 1962.

Fischer, Jim Introduction to the calculus of variations, a quick and readable guide. (Note: There are typos in the Euler–Lagrange equation on page 5 of the document; the equation should read: \frac{\partial f}{\partial y}  \frac{d}{dx} \frac{\partial f}{\partial y'} = 0 . Similar errors are present in equations 5.1 and 5.2 on page 8 of the document.)

Forsyth, A.R.: Calculus of Variations, Dover, 1960.

Fox, Charles: An Introduction to the Calculus of Variations, Dover Publ., 1987.

Jost, J. and X. LiJost: Calculus of Variations. Cambridge University Press, 1998.

Lebedev, L.P. and Cloud, M.J.: The Calculus of Variations and Functional Analysis with Optimal Control and Applications in Mechanics, World Scientific, 2003, pages 1–98.

Logan, J. David: Applied Mathematics, 3rd Ed. WileyInterscience, 2006

Roubicek, T.: Calculus of variations. Chap.17 in: Mathematical Tools for Physicists. (Ed. M. Grinfeld) J. Wiley, Weinheim, 2014, ISBN 9783527411887, pp.551588.

Sagan, Hans: Introduction to the Calculus of Variations, Dover, 1992.

Weinstock, Robert: Calculus of Variations with Applications to Physics and Engineering, Dover, 1974.

Chapter 8: Calculus of Variations, from Optimization for Engineering Systems, by Ralph W. Pike, Louisiana State University.
External links

Hazewinkel, Michiel, ed. (2001), "Variational calculus",

Calculus of variations at PlanetMath.org.

Weisstein, Eric W., "Calculus of Variations", MathWorld.

Calculus of variations example problems.

, Part I, trans. and edited by D. H. DelphenichSelected papers on Geodesic Fields

, Part IISelected papers on Geodesic Fields
This article was sourced from Creative Commons AttributionShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, EGovernment Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a nonprofit organization.