Ammonia is a valuable chemical produced in the industry and is wide used in the manufacture of fertilizers, plastics and pharmaceuticals. On the other hand, some important tools in chemical processes are modelling, simulation and optimization, and these types of studies have attracted considerable attention of many researchers. Several models of ammonia synthesis have been developed with the purpose of design and optimization. The typical design problem in this process requires obtained an optimal reactor length with maximum economic return and many works in literature have focused on the optimization of this reactor using different optimization techniques. In this work, an alternative approach to those presented in literature for solving this boundary value problem, and determine the optimal solution, is presented. The model of the reactor along with the kinetic form a non-linear differential-algebraic system. These differential-algebraic equations are discretized using orthogonal collocation on finite elements with continuous profiles approximated by Lagrange polynomials. In this manner, the resulting algebraic collocation equations are written as equality constraints in the optimization problem. Thus, the optimization problem is solved by implementing the IPOPT solver within the GAMS optimization-modeling platform. Although IPOPT solver here implemented is a local solver that does not guarantee the global optimum, multiple initial guesses were used to solve the problem and obtain an optimal solution of the problem. The obtained results are compared with other results available in literature and indicate that the used approach is a good alternative for dealing with this type of problems.