Consider a two degree of freedom system as shown in the figure, where $\text{PQ}$ is a rigid uniform rod of length, $\text{b}$ and mass, $\text{m}$.
Assume that the spring deflects only horizontally and force $\text{F}$ is applied horizontally at $\text{Q}$. For this system, the Lagrangian, $\text{L}$ is
- $\frac{1}{2}\left ( M+m \right )\dot x^{2}+\frac{1}{6}mb^{2}\dot\theta ^{2}-\frac{1}{2}kx^{2}+mg\frac{b}{2}\cos\theta$
- $\frac{1}{2}\left ( M+m \right )\dot x^{2}+\frac{1}{2}mb\dot{\theta }\dot{x}\cos\theta +\frac{1}{6}mb^{2}\dot\theta ^{2}-\frac{1}{2}kx^{2}+mg\frac{b}{2}\cos\theta$
- $\frac{1}{2}M\dot{x}^{2}+\frac{1}{2}mb\dot{\theta }\dot{x}\cos\theta +\frac{1}{6}mb^{2}\dot \theta ^{2}-\frac{1}{2}kx^{2}$
- $\frac{1}{2}M\dot{x}^{2}+\frac{1}{2}mb\dot{\theta }\dot{x}\cos\theta +\frac{1}{6}mb^{2}\dot \theta ^{2}-\frac{1}{2}kx^{2}+mg\frac{b}{2}\cos\theta +Fb\sin\theta$