Euler–Lagrange equation
and applying the Euler–Lagrange equation.