A novel and accurate physics-informed method for solving problems involving differential equations, called the Extreme Theory of Functional Connections (or ETFC), is employed to solve optimal control problems. The problems can be treated with an indirect method by defining the Hamiltonian function and obtaining the optimal control by means of the Pontryagin Minimum Principle. The first order necessary conditions for the state and costate equations can be retrieved and the related system of equations, which represents a boundary value problems (BVP), is solved via ETFC. According to the ETFC method, the latent solutions are approximated with particular expansions, called constrained expressions, where the related coefficients are the unknowns. Hence, a least-squared approach is used to compute the unknowns by minimizing the losses, represented by the system of equations. The entire methodology is applied to the Feldbaum problem and shows a low computational time along with comparable accuracy with respect to the literature.