Euler–Lagrange equation
See also more rigorous derivation Euler–Lagrange equation