From ControlTheoryPro.com

1 Inverted Pendulum
The inverted pendulum is a standard controls example and it is related to rocket and missile guidance, where thrust is actuated at the bottom of a tall vehicle. Many undergraduate controls courses use the inverted pendulum as their first example plant. This classic problem in dynamics and control theory is widely used as a benchmark for testing control designs.
1.1 Equations of Motion^{[1]}
Equations of motion usually start with Newton's 2^{nd} Law and the inverted pendulum is no different. Sum of the torques must equal 0.
 where
 is torque and
 is angular momentum.
The torques are the control torque and the gravity (positional) based torque
 where
 is the length of the pendulum,
 is the mass at the end of the pendulum,
 is gravity and
 is the angle of the pendulum off vertical.
Angular torque is . The inertia of the rod is so the angular torque is
Rearranging the 2 sides
IP 1 
Eqn. IP 1 is nonlinear due to the sine function. However, if we can assume that is small (approx. 3 degrees or less) then the small angle approximation () is valid and IP 1 becomes
IP 2 
1.2 StateSpace Formulation
The typical statespace formulation includes a description of the system via state variable
If we make the substitution and then
2 References