A spectral factorisation algorithm of improper matrices and existence results, under controllability conditions, are presented. Based on these results, an algorithm for linear-quadratic (LQ) control of rectangular descriptor systems without the detectability and infinite observability conditions is presented. The matrix pencil associated with the Euler-Lagrange differential equations can be singular, can have finite generalised eigenvalues on the imaginary axis and infinite generalised eigenvalues of any multiplicity. In the class of optimal state feedback controls, we find a control that renders the closed-loop system marginally stable and impulse-free. Also we find conditions on x(0-) that guarantee the optimality. It is shown how the disturbance attenuation problem of descriptor systems can be re-formulated as an optimal state feedback-feedforward control problem, for which the results of this article can be applied. When applied to state space systems, the algorithm of this article, which is based on using orthogonal matrices, solves the linear matrix inequality that is used in control theory, in its most general form.