Theorem (Euler-Lagrange equation)

Given some function $f$ and constants $x_1,x_2,y_1,y_2$, Suppose $y(x)$ is an extremum of the functional $$ \begin{align*} F[y] = \int_{x_1}^{x_2} f(x,y(x),y'(x))\, dx \end{align*} $$ subject to $y(x_1) = y_1$ and $y(x_2) = y_2$.

Then $y(x)$ satisfies the Euler-Lagrange equation $$ \begin{align*} \dd{x}\left(\pdfd{f}{y'}\right) - \pdfd{f}{y} = 0. \end{align*} $$

Proof