In this paper, a numerical solution for solving a special class of optimal control problems is considered. The main idea of the solution is to parameterize the state space by approximating the state function using a linear combination of Hermite polynomial with unknown coefficients an iterative method is proposed in order to facilitate the computation of unknown coefficients. Some illustrated examples are included to test the efficiency of algorithm.