Question: Maximize $f(x,y, z) = x y + 2 y z + 6 x $ subject to $ x^2 + y^2 + z^2 = 36 $.
This question is different from a a previous one due to the existence of the linear term $6x$.
Here is my approach:
Following the analysis done in the previous problem, we find that
$ (x, y, z) = 6 ( \sin \theta \cos \phi, \sin \theta \sin \phi, \cos \theta ) $
So,
$ f(x,y,z) = f(\theta, \phi) = 36 ( \sin^2 \theta \cos \phi \sin \phi + 2 \sin \theta \cos \theta \sin \phi + \sin \theta \cos \phi) $
I am not sure how to maximize this expression because of the existence of linear terms as well as quadratic terms.
So, instead, may be using Lagrange multiplier method will prove to be the right way.
The Lagrange multiplier function is
$ g(x, y, z) = x y + 2 y z + 6 x + \lambda ( x^2 + y^2 + z^2 - 36) $
This can be written concisely as
$ g(r) = r^T Q r + b^T r + \lambda ( r^T r - 36 ) $
where $ r = [x, y, z]^T $,
$ Q = \begin{bmatrix} 0 && \dfrac{1}{2} && 0 \\ \dfrac{1}{2} && 0 && 1 \\ 0 && 1 && 0 \end{bmatrix} $
and $b = [6, 0, 0]^T$
Taking the partial derivatives leads to
$ \nabla_r \ g(r) = 2 Q r + b + \lambda (2 r ) = \mathbf{0} $
$ r^T r = 36 $
From the first equation (the vector equation), I can write
$ 2 (Q + \lambda I) r = - b $
So,
$ r = - \dfrac{1}{2} (Q + \lambda I)^{-1} b $
Plugging this into the constraint equation, and simplifying, I get,
$ b^T (Q + \lambda I)^{-2} b = 144 $
But how can this be solved for $\lambda$ ??
That's where I am stuck.
Your help is greatly appreciated.