There is a growing need for smaller, more economic transportation systems. Personal transportation systems such as hover boards and Segways have made their way onto the market. The two-wheeled configuration of the Segway is a two-wheeled inverted pendulum system. This paper derives the equations of motion of an inverted wheeled pendulum system and a double inverted wheeled pendulum system. The equations are derived using the Euler-Lagrange equations. The first configuration derived is of the single inverted pendulum system. The second configuration derived adds on another inverted pendulum system similar to the first configuration, along with more variables and constraints. The results of this paper provide valuable information about the equations of motion of a Segway. The methods described in this paper lay the groundwork for numerous possible future studies that may investigate the motion of a two-wheeled pendulum system.