# Constrained optimisation for quadratic form with linear term

I need to maximise a quadratic form in 3D with the constraint that the solution vector, $\mathbf{x}$, lies on the unit sphere. I know that for a simple quadratic form:

$$\mathbf{x}^T\mathbf{A}\mathbf{x}$$

this would simply be the eigenvector with the highest eigenvalue, and it can be proved simply enough. However, my situation is a more general form

$$\mathbf{x}^T\mathbf{A}\mathbf{x} + \mathbf{b}\mathbf{x} + c$$

(not even sure if I can call it quadratic any more at this point since there's linear terms mixed into it...), basically corresponding to a translation from the origin. In these conditions, I can't see how to find the constrained maximum in an elegant way. Of course I could just optimise it numerically but it would be nice if there was an analytical method, even just to find the stationary points (and then check them one by one). Thanks!

• Wouldn't you be able to write $x^TAx+bx+c$ as $x^TDx$? – skr Dec 5 '17 at 19:39
• You can rewrite your problem as $$\mathbf{x}^T\mathbf{A}\mathbf{x} + \mathbf{b}\mathbf{x} + c = \begin{pmatrix}x\\1\end{pmatrix}^T\begin{bmatrix}A&b/2\\b/2&c\end{bmatrix} \begin{pmatrix}x\\1\end{pmatrix}$$ – percusse Dec 5 '17 at 22:05
• Sorry, maybe it's not clear from the notation, but $\mathbf{b}$ is a vector, not a scalar, and that's a dot product there. – Okarin Dec 6 '17 at 8:44