<aside> đź«´ The Lagrangian:
$$ \boxed{L=T-V}=\frac 12 m\dot x^2-V(x) $$
</aside>
its derivative with respect to $x$:
$$ \frac{\partial L}{\partial x}=-\frac{\partial V}{\partial x} $$
By Newton’s 2nd
$$ \frac{\partial L}{\partial x}=-\frac{\partial V}{\partial x}=m\ddot x=\frac{\text d}{\text dt}\left ( \frac{\partial L}{\partial \dot x} \right ) $$
<aside> 🕊️ Lagrange’s equation:
$$ \boxed{\frac{\partial L}{\partial x}=\frac{\text d}{\text dt}\left ( \frac{\partial L}{\partial \dot x} \right )} $$
</aside>
The rate of change of momentum is equal to the force
đź’Ľ Case: Consider a mass on a spring $V=\frac 12 kx^2$
🍎 Newton’s method:
$$ m\ddot x=F=-\frac{\partial V}{\partial x}=-kx $$
⚡ Energy conservation
$$ E=\frac 12 m\dot x^2+\frac 12 kx^2 = \text{constant} $$
Thus we can write
$$ \frac{\text d E}{\text dt}=(m \ddot{x}+kx)\dot x=0 $$
we get either $\dot x=0$ or $m\ddot x=-kx$
🍋 Lagrange’s method
$$ L=\frac 12 m\dot x^2-\frac 12 kx^2 $$
so
$$ \begin{aligned} \frac{\text d}{\text dt}\left ( \frac{\partial L}{\partial \dot x}\right )&=\frac{\partial L}{\partial x} \\ \frac{\text d}{\text dt}(m\dot x)&=-kx \\ m\ddot x&=-kx \end{aligned} $$
In three dimensions $V=V(x,y,z)$ and $T=\frac 12 m(\dot x^2+\dot y^2+\dot z^2)$ and we obtain three Lagrange’s equations:
$$ \begin{aligned} \frac{\text d}{\text dt}\left ( \frac{\partial L}{\partial \dot x}\right )&=\frac{\partial L}{\partial x} \\ \frac{\text d}{\text dt}\left ( \frac{\partial L}{\partial \dot y}\right )&=\frac{\partial L}{\partial y} \\ \frac{\text d}{\text dt}\left ( \frac{\partial L}{\partial \dot z}\right )&=\frac{\partial L}{\partial z}
\end{aligned} $$
or alternatively in a more compact form for $x_i=x,y,z$ :
$$ \frac{\text d}{\text dt}\left ( \frac{\partial L}{\partial \dot x_i}\right )=\frac{\partial L}{\partial x_i} $$
The differences are
đź’» Virtual displacement
$$ \delta \vec r_i=\sum^n_{j=1}\frac{\partial \vec r_i}{\partial q_j}\delta q_j $$
virtual displacement of the generalized coordinates with small change $\{ \delta q_j \}$.
đźš“ Real displacement
$$ \text d \vec r_i=\left [ \sum^n_{j=1}\frac{\partial \vec r_i}{\partial q_j}\dot q_j+\frac{\partial \vec r_i}{\partial t} \right ]\text dt $$
real displacement in time $\text dt$