In this paper, inverse optimal control problem for an inverted pendulum with horizontal and vertical movements is considered. This inverted pendulum can be transformed into a bilinear system by using input transformation and coordinate transformation focused on the center of percussion of the pendulum. For bilinear systems, an optical control algorithm which minimizes a new quadratic cost function was proposed. However, there are no experiments by using this controller. Thus this control algorithm may not able to be applied to real examples. And so, in this paper, this control algorithm is applied to the bilinear system of the inverted pendulum. Furthermore, the effectiveness of this controller is shown by experiments.