In this work, we have proposed a new approach for solving the linear-quadratic optimal control problem, where the quality criterion is a quadratic function, which can be convex or non-convex. In this approach, we transform the continuous optimal control problem into a quadratic optimization problem using the Cauchy discretization technique, then we solve it with the active-set method. In order to study the efficiency and the accuracy of the proposed approach, we developed an implementation with MATLAB, and we performed numerical experiments on several convex and non-convex linearquadratic optimal control problems. The obtained simulation results show that our method is more accurate and more efficient than the method using the classical Euler discretization technique. Furthermore, it was shown that our method fastly converges to the optimal control of the continuous problem found analytically using the Pontryagin's maximum principle.