# Euler-Lagrange equation

The **Euler-Lagrange Equation** is the major formula of the Calculus of variations. It provides a way to solve for functions which extremize a given cost functional. It is widely used to solve optimization problems, and in conjunction with the action principle to calculate trajectories. It is analogous to the result from Calculus that a function attains its extreme values when its derivative vanishes.

## Statement

Formally, given a functional *F(x,f(x),f'(x))* with continuous first partial derivatives, any function *f* which extremizes the cost functional

must also satisfy the ordinary differential equation

## Examples

A standard example is finding the shortest path between two points in the plane. Assume that the points to be connected are (*a*,*c*) and (*b*,*d*). The length of a path y=f(x) between these two points is:

The Euler-Lagrange equation yields the differential equation:

In other words, a straight line.

## Multidimensional Variations

There are also various multi-dimensional versions of the Euler-Lagrange equations. If *q* is a path in n-dimensional space, then it extremizes the cost functional

only if it satisfies

This formulation is particularly useful in physics when L is taken to be be the Lagrangian.

Another multi-dimensional generalization comes from considering a function on n variables. If is some surface, then

is extremized only if *f* satisfies the partial differential equation

When n=2 and L is the energy functional, this leads to the soap-film minimal surface problem.