the equations of motion can be derived using lagrange's equations. we refer to the drawing to the right where formula_27 is the angle of the pendulum of length formula_28 with respect to the vertical direction and the acting forces are gravity and an external force "f" in the x-direction. define formula_29 to be the position of the cart. the lagrangian formula_30 of the system is: