This document presents a detailed analysis of the dynamic modeling and optimal control scheme for a wheel-inverted pendulum (WIP) intended for mobile robot applications. It employs Kane's method to derive a nonlinear mathematical model and proposes a partial-state PID controller using quadratic optimal regulation for improved performance. The paper emphasizes the significance of the WIP system in both industrial and research contexts, highlighting its potential as a future urban robot and transporter.