In this paper, the problem of Stabilization of the inverted pendulum utilizing horizontal and vertical inputs is considered. This inverted pendulum system can be transformed into a bilinear system by utilizing coordinate transformation and input transformation. The optimal feedback controller based on an inverse optimal problem is proposed for the bilinear system . And the inverted pendulum system with horizontal and vertical inputs can be transformed into exact linear system utilizing Dynamic Extension. This paper discusses the effectivity of these controllers by experiments.