The paper introduces an approach to solve the optimal control problem applying symbolic regression methods. All known approaches to solve the optimal control problem are based on direct or indirect methods. Indirect methods may provide analytical solution but impose restrictions on the form and dimension of control object. In direct ones the optimal control problem is reduced to the nonlinear programming problem which provides general numerical solution. Also direct methods impose no restrictions on control object and have a wide range of application to complex applied problems. The approach proposed combines the advantages of both direct and indirect methods not involving the disadvantages mentioned previously. The suggested approach provides solution to the optimal control problem as a control function of time in explicit form. This approach benefits in case of applied optimal control problem requiring a solution in explicit form while indirect methods are inapplicable due to the restrictions imposed on the control system. The computational experiment of solving the optimal control problem for a mobile robot with phase constraints is presented. The results illustrate that the proposed approach finds an optimal control as a function of time which provides a mobile robot's motion along the optimal trajectory avoiding phase constraints. © 2021 Elsevier B.V.. All rights reserved.