This paper deals with optimization of a class of nonlinear dynamic systems with n states and m control inputs commanded to move between two fixed states in a prescribed time. Using conventional procedures with Lagrange multipliers, it is well known that the optimal trajectory is the solution of a two-point boundary-value problem. In this paper, a new procedure for dynamic optimization is presented which relies on tools of feedback linearization to transform nonlinear dynamic systems into linear systems. In this new form, the states and controls can be written as higher derivatives of a subset of the states. Using this new form, it is possible to change constrained dynamic optimization problems into unconstrained problems. The necessary conditions for optimality are then solved efficiently using weighted residual methods.