Maximize $xy + 2 yz + 6 x $ subject to $x^2 + y^2 + z^2 = 36 $

algebra-precalculuscalculusmaxima-minimaoptimizationquadrics

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.

Best Answer

You can use the fact that $S = \{x^2 + y^2 + z^2 = 36\}$ is a smooth manifold (it is the sphere of center $0$ and radius $6$), thus at any point where $f$ reaches its maximum, its derivative in $S$ vanishes. Let $d_S$ be the exterior derivative in $S$ and $d$ the exterior derivative in $\mathbb{R}^3$ (the normal derivative).

Then, for any $p \in S$, $d_Sf(p) = df(p)_{|T_pS}$ and $T_pS = \{p\}^\bot$ so $d_Sf(p) = 0$ if and only if $\nabla f(p) \in \mathrm{Span}(p)$ and we have, $$ \nabla f(x,y,z) = \begin{pmatrix} y + 6 \\ x + 2z \\ 2y \end{pmatrix}, $$ which is in $\mathrm{Span}(x,y,z)$ if and only if there exists some $\lambda \in \mathbb{R}$ such that $y + 6 = \lambda x$, $x + 2z = \lambda y$ and $2y = \lambda z$. In this case, the first and the third equalities imply $\lambda \neq 0$ and $2y = \lambda z$ implies $y = \frac{\lambda}{2}z$ so $x = \lambda y - 2z = \left(\frac{\lambda^2}{2} - 2\right)z$. It implies that, $$ 36 = x^2 + y^2 + z^2 = \left(\left(\frac{\lambda^2}{2} - 2\right)^2 + \frac{\lambda^2}{4} + 1\right)z^2 = \left(\frac{\lambda^2}{2} - 2\lambda + 5\right)z^2 $$ Finally, $y + 6 = \frac{\lambda}{2}z + 6 = \lambda x = \left(\frac{\lambda^3}{2} - 2\lambda\right)z$ so $6 = \left(\frac{\lambda^3}{2} - \frac{5\lambda}{2}\right)z$. Those two last equalities imply $\left(\frac{\lambda^3}{2} - \frac{5\lambda}{2}\right)^2 = \frac{\lambda^2}{2} - 2\lambda + 5$ or in other words, $$ \lambda^6 - 10\lambda^4 + 23\lambda^2 + 8\lambda - 20 = 0 $$ This polynomial has $4$ real roots and the point associated to each root $\lambda$ is, $$ \begin{pmatrix} x \\ y \\ z \end{pmatrix} = \begin{pmatrix} \left(\frac{\lambda^2}{2} - 2\right)z \\ \frac{\lambda}{2}z \\ z \end{pmatrix} = \begin{pmatrix} \frac{6\lambda^2 - 24}{\lambda^3 - 5\lambda} \\ \frac{6}{\lambda^2 - 5} \\ \frac{12}{\lambda^3 - 5\lambda} \end{pmatrix} $$ $\lambda$ is solution to a degree $6$ equation so you can write the associated $(x,y,z)$ as $(P_1(\lambda),P_2(\lambda),P_3(\lambda))$ where each $P_i$ is a polynomial of degree at most $5$. I don't think we can get exact answers but you can compute it approximatively and check for which $\lambda$ we have a local minimum, a local maximum or a saddle point. One of the local maxima is necessarily a global maximum because $S$ is compact.