Appendix 12 — Derivation of the Euler–Lagrange Equation
Appendix 12.1 — Definition of the Functional
We start with a function \( f_{1} \) that depends on three variables: \(t\), \(x_{1}(t)\) and \( \dot{x}_{1}(t) = \frac{dx_{1}}{dt} \):
\[ f_{1} = f\!\left(t,\, x_{1}(t),\, \dot{x}_{1}(t)\right). \tag{1} \]Here \(x_{1}(t)\) is a function of \(t\), so \(\dot{x}_{1}(t)\) is not zero. In fact, \(t\) is the only independent variable; \(f_{1}\) is therefore a function of a function.
We now consider the functional:
\[ I_{1} = \int_{t_{1}}^{t_{2}} f\!\left(t,\, x_{1}(t),\, \dot{x}_{1}(t)\right)\, dt. \tag{2} \]We seek the extremal value (minimum, maximum, or saddle point) of \(I_{1}\). This requires:
\[ \delta I_{1} = 0. \tag{3} \]Appendix 12.2 — Variation of the Path
To prove that \(I_{1}\) is extremal, consider a slightly displaced curve:
\[ x_{2}(t,\lambda) = x_{1}(t) + \lambda\, \xi(t), \tag{4} \]where:
- \(\lambda\) is a small parameter, independent of \(t\),
- \(\xi(t)\) is an arbitrary smooth function.
Because the variation cannot change the endpoints, we have:
\[ \xi(t_{1}) = 0, \qquad \xi(t_{2}) = 0. \tag{5} \]Thus, the function \(x_{2}(t,\lambda)\) differs only between \(t_{1}\) and \(t_{2}\), but coincides with \(x_{1}(t)\) at the endpoints.
Appendix 12.3 — Variation of the Functional
The integral \(I_{2}\) for the nearby curve is:
\[ I_{2} = \int_{t_{1}}^{t_{2}} f_{2}\, dt. \tag{6} \]With: \[ f_{2} = f\!\left(t,\; x_{2}(t,\lambda),\; \frac{d{x}_{2}(t,\lambda)}{dt}\right). \]
Substituting (6) into equation (4) gives:
\[ I_2 = \int_{t_1}^{t_2} f\!\left(t,\; x_{2}(t,\lambda),\; \frac{d{x}_{2}(t,\lambda)}{dt}\right) dt \]\[ = \int_{t_1}^{t_2} f\!\left(t,\; x_{1}(t)+\lambda\xi(t),\; \frac{d\left(x_{1}(t)+ \lambda\xi(t)\right)}{dt}\right) dt \]\[ I_2= \int_{t_1}^{t_2} f\!\left(t,\; x_{1}(t)+\lambda\xi(t),\; \frac{dx_{1}(t)}{dt}+ \frac{d\lambda\xi(t)}{dt}{dt}\right) dt \tag{7} \]Because \(I_{1}\) is an extremum, \(I_{2}\) must also be extremal for \(\lambda = 0\):
\[ \lim_{\lambda \to 0} I_{2} = \text{minimum, maximum, or saddle point}. \tag{8} \]The extremum is found by taking the derivative with respect to \(\lambda\) and setting it to zero:
\[ \lim_{\lambda \to 0} \frac{d I_{2}}{d\lambda} = 0. \tag{9} \]In combination with equation (6):
\[ \lim_{\lambda \to 0} \frac{d}{d\lambda} \int_{t_{1}}^{t_{2}} f_{2}\, dt = 0, \tag{10} \]or equivalently:
\[ \lim_{\lambda \to 0} \int_{t_{1}}^{t_{2}} \frac{d f_{2}}{d\lambda}\, dt = 0. \]Appendix 12.4 — Differentiation with Respect to the Variation Parameter
We had: \[ \lim_{\lambda \to 0} \frac{d}{d\lambda} \int_{t_{1}}^{t_{2}} f_{2}\, dt = 0. \] Since this is a product of two functions, we apply the rule of partial differentiation:
\[ \lim_{\lambda \to 0} \int_{t_{1}}^{t_{2}} \left( \frac{d f_{2}}{d\lambda}\, dt + f_{2}\, \frac{d}{d\lambda}(dt) \right) = 0. \tag{11} \]Because \(t\) and \(\lambda\) are independent: \[ \frac{dt}{d\lambda} = 0, \] so the second term vanishes:
\[ \lim_{\lambda \to 0} \int_{t_{1}}^{t_{2}} \frac{d f_{2}}{d\lambda}\, dt = 0. \tag{12} \]Appendix 12.5 — Expanding \( \frac{d f_{2}}{d\lambda} \)
As previously stated, \(f_2\) is a function of three variables: \[ f_{2} = f\!\left(t,\; x_{2},\; \dot{x}_{2}\right). \]
We now apply the chain rule:
\[ \frac{d f_{2}}{d\lambda} = \frac{\partial f_{2}}{\partial t}\frac{dt}{d\lambda} + \frac{\partial f_{2}}{\partial x_{2}}\frac{dx_{2}}{d\lambda} + \frac{\partial f_{2}}{\partial \dot{x}_{2}} \frac{d\dot{x}_{2}}{d\lambda}. \]Thus:
\[ \lim_{\lambda \to 0} \int_{t_{1}}^{t_{2}} \left( \frac{\partial f_{2}}{\partial t}\frac{dt}{d\lambda} + \frac{\partial f_{2}}{\partial x_{2}}\frac{dx_{2}}{d\lambda} + \frac{\partial f_{2}}{\partial \dot{x}_{2}} \frac{d\dot{x}_{2}}{d\lambda} \right) dt = 0. \tag{13} \]Since \(t\) and \(\lambda\) are independent, the first term vanishes:
\[ \lim_{\lambda \to 0} \int_{t_{1}}^{t_{2}} \left( \frac{\partial f_{2}}{\partial t} \cdot 0 + \frac{\partial f_{2}}{\partial x_{2}}\frac{dx_{2}}{d\lambda} + \frac{\partial f_{2}}{\partial \dot{x}_{2}} \frac{d\dot{x}_{2}}{d\lambda} \right)\, dt = 0 \tag{14} \] \[ \lim_{\lambda \to 0} \int_{t_{1}}^{t_{2}} \left( \frac{\partial f_{2}}{\partial x_{2}}\frac{dx_{2}}{d\lambda} + \frac{\partial f_{2}}{\partial \dot{x}_{2}} \frac{d\dot{x}_{2}}{d\lambda} \right)\, dt = 0 \]Since: \[ \frac{d\dot{x}_{2}}{d\lambda} = \frac{d^2 x_2}{dt\, d\lambda} = \frac{d}{dt} \left( \frac{dx_{2}}{d\lambda} \right) \tag{15} \] equation (14), together with (15), leads to:
\[ \lim_{\lambda \to 0} \int_{t_{1}}^{t_{2}} \left( \frac{\partial f_{2}}{\partial x_{2}}\frac{dx_{2}}{d\lambda} + \frac{\partial f_{2}}{\partial \dot{x}_{2}} \frac{d}{dt}\left(\frac{dx_{2}}{d\lambda}\right) \right) dt = 0 \tag{16} \]
\[ \lim_{\lambda \to 0} \left( \int_{t_{1}}^{t_{2}} \frac{\partial f_{2}}{\partial x_{2}} \frac{dx_{2}}{d\lambda} dt + \int_{t_{1}}^{t_{2}} \frac{\partial f_{2}}{\partial \dot{x}_{2}} \frac{d}{dt} \left( \frac{dx_{2}}{d\lambda} \right) dt \right) = 0 \]
Appendix 12.6 — Integration by Parts
We now partially integrate the second term:
\[ \int_{t_{1}}^{t_{2}} \frac{\partial f_{2}}{\partial \dot{x}_{2}} \frac{d}{dt}\left(\frac{dx_{2}}{d\lambda}\right)\, dt = \int_{t_{1}}^{t_{2}} \frac{\partial f_{2}}{\partial \dot{x}_{2}} d\left(\frac{dx_{2}}{d\lambda}\right) \]\[ = \left[ \frac{\partial f_{2}}{\partial \dot{x}_{2}} \frac{dx_{2}}{d\lambda} \right]_{t_{1}}^{t_{2}} - \int_{t_{1}}^{t_{2}} \frac{dx_{2}}{d\lambda}\, \frac{d}{dt}\left( \frac{\partial f_{2}}{\partial \dot{x}_{2}} \right) \, dt \tag{17} \]The derivative of \(x_2\) with respect to \(\lambda\) is found from equation (4):
\[ \frac{dx_2(t,\lambda)}{d\lambda} = \frac{d\left(x_1(t)+\lambda\xi(t)\right)}{d\lambda} = 0 + \xi(t) = \xi(t) \tag{18} \]Since \(\xi(t)\) vanishes at the boundaries of the integral (see equation (5)), the first term on the right-hand side of equation (17) disappears:
\[ \int_{t_{1}}^{t_{2}} \frac{\partial f_{2}}{\partial \dot{x}_{2}} \frac{d}{dt}\left(\frac{dx_{2}}{d\lambda}\right)\, dt = \left[ \frac{\partial f_{2}}{\partial \dot{x}_{2}} \frac{dx_{2}}{d\lambda} \right]_{t_{1}}^{t_{2}} - \int_{t_{1}}^{t_{2}} \frac{dx_{2}}{d\lambda}\, \frac{d}{dt}\left( \frac{\partial f_{2}}{\partial \dot{x}_{2}} \right) \, dt \]So this gives:
\[ \int_{t_{1}}^{t_{2}} \frac{\partial f_{2}}{\partial \dot{x}_{2}} \frac{d}{dt}\left(\frac{dx_{2}}{d\lambda}\right)\, dt = - \int_{t_{1}}^{t_{2}} \frac{dx_{2}}{d\lambda}\, \frac{d}{dt}\left( \frac{\partial f_{2}}{\partial \dot{x}_{2}} \right) \, dt \tag{19} \]Combining this result with equation (16) yields:
\[ \lim_{\lambda \to 0} \left( \int_{t_{1}}^{t_{2}} \frac{\partial f_{2}}{\partial x_2}\frac{dx_2}{d\lambda}\, dt + \int_{t_{1}}^{t_{2}} \frac{\partial f_{2}}{\partial \dot x_2}\, \frac{d\left(\frac{dx_2}{d\lambda}\right)}{dt}dt \right) = 0 \tag{20} \]
\[ \lim_{\lambda \to 0} \left( \int_{t_{1}}^{t_{2}} \frac{\partial f_{2}}{\partial x_2}\frac{dx_2}{d\lambda}\, dt - \int_{t_{1}}^{t_{2}} \frac{dx_{2}}{d\lambda}\, \frac{d}{dt}\left( \frac{\partial f_{2}}{\partial \dot{x}_{2}}\right)dt \right) = 0 \]
\[ \lim_{\lambda \to 0} \int_{t_{1}}^{t_{2}} \left( \frac{\partial f_{2}}{\partial x_2}\frac{dx_2}{d\lambda} - \frac{dx_{2}}{d\lambda}\, \frac{d}{dt} \left(\frac{\partial f_{2}}{\partial \dot{x}_{2}}\right)\right)dt = 0 \]
\[ \lim_{\lambda \to 0} \int_{t_{1}}^{t_{2}} \left( \frac{\partial f_{2}}{\partial x_2} - \, \frac{d}{dt} \left(\frac{\partial f_{2}}{\partial \dot{x}_{2}}\right)\right)\frac{dx_2}{d\lambda}dt = 0 \]
Factoring out \(dx_2/d\lambda\) and taking the limit \(\lambda \to 0\) gives the Euler–Lagrange condition:
\[ \lim_{\lambda \to 0} \left( \frac{\partial f_{2}}{\partial x_2} - \, \frac{d}{dt} \left(\frac{\partial f_{2}}{\partial \dot{x}_{2}}\right)\right) = 0 \]
\[ \frac{\partial f_{2}}{\partial x_2} - \frac{d}{dt} \left(\frac{\partial f_{2}}{\partial \dot{x}_{2}}\right) = 0 \tag{21} \]Thus, \(\lambda\) has completely disappeared and we have obtained a general expression for the condition a function must satisfy for the integral \(I\) to have an extremum.
We started with equation (1) for our derivation, but we could generalize further by taking a function of multiple variables:
\[ f_1 = f\left(t, x_1(t), \frac{dx_1(t)}{dt}, x_2(t), \frac{dx_2(t)}{dt}, \dots, x_n(t), \frac{dx_n(t)}{dt} \right) \tag{22} \]This leads to the generalized form of equation (21):
\[ \frac{\partial f}{\partial x_n} - \frac{d}{dt} \left(\frac{\partial f}{\partial \dot{x_n}}\right) = 0 \tag{23} \]Or equivalently:
\[ \frac{d}{dt} \left(\frac{\partial f}{\partial \dot{x_n}}\right) = \frac{\partial f}{\partial x_n} \tag{24} \]Equation (24) is the Euler–Lagrange equation. It gives the condition that a function must satisfy so that the integral \(I\) has an extremum.
This forms the foundation of variational calculus, classical mechanics, field theory, and general relativity.