In this paper, we propose a new approach to design the asymptotically stabilizing control and adaptive control for nonlinear systems. We first propose an infinite-horizon optimal control (OC) problem according to the nonlinear control system. We prove that its OC can be an asymptotically stabilizing control or adaptive control for the original nonlinear system. Then, we convert the infinite-horizon OC problem into an equivalent finite-horizon OC problem. Moreover, we utilize the Legendre pseudospectral method to solve the proposed problem. Finally, several examples are given to illustrate the efficiency of the approach.KEYWORDS adaptive control, brush DC motor, infinite-horizon optimal control, Legendre pseudospectral method, stabilizing control 1952