The calculus of variations is applied to the problem of finding the optimal control for linear systems with quadratic costs which are not necessarily positive definite. The conjugate point condition is transformed to an explicit condition upon the parameters of the problem, in the one-dimensional case for arbitrary costs and in the

-dimensional case for final costs only. The expressions for the optimal controls are given. A numerical example of a second-order system is solved.