This paper presents a new control method for double inverted pendulum on cart problem. Firstly, model of system is presented. Secondly, it offers theorems and mathematical tools of optimal control of pendulum. Then, optimal control for double inverted pendulum on cart is designed. Finally, this algorithm and other methods are compared.