A novel approach based on a polynomial approximation of the singular optimal control (PASOC) is proposed. The polynomial approximation solves an optimization problem for a switching system using the Hamiltonian formulation, Pon-tryagin's Minimum Principle and Legendre-Clebsch conditions, and reduces computational cost. The polynomial approximation (PASOC) is validated on a Boost converter in nominal operation, input voltage variation, and load perturbation, showing excellent performance.