5

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.

River Li
  • 49,125

3 Answers3

2

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.

Cactus
  • 9,220
2

Remarks: Note that the objective function and the constraint are both quadratic. Here I introduce a trick for this type of problems. I used this trick for these problems: P1, P2(see Discussion there), and P3(non-quadratic), and P4.

Let $$s := \frac16 \sqrt{33 + 30\cos\left(\frac13 \arccos \frac{17}{125}\right)} \approx 1.28707013$$ and $$M := \frac{144s^4 - 144s^2 - 36}{4s^3 - 5s} \approx 57.62713479.$$

We have the following identity \begin{align*} &M - (xy + 2yz + 6x) + s(x^2 + y^2 + z^2 - 36)\\[6pt] ={}& s \left(z - \frac{y}{s}\right)^2 + s\left(x - \frac{y + 6}{2s}\right)^2 + \frac{4s^2 - 5}{4s}\left(y - \frac{6}{4s^2 - 5}\right)^2. \tag{1} \end{align*} (The details are given at the end.)

Since $\frac{4s^2 - 5}{4s} > 0$, from (1), we have $$xy + 2yz + 6x \le M$$ for all reals $x, y, z$ with $x^2 + y^2 + z^2 = 36$.

Also, when $y = \frac{6}{4s^2 - 5}, z = y/s, x = \frac{y+6}{2s}$, we have $x^2 + y^2 + z^2 = 36$, and $xy + 2yz + 6x = M$ (using (1)).

Thus, the maximum of $xy + 2yz + 6x$ subject to $x^2 + y^2 + z^2 = 36$ is $M$.

We are done.

$\phantom{2}$


Details of (1):

The trick is to find real constants $M$ and $s$ (if any) such that $$f(x, y, z) := M - (xy + 2yz + 6x) + s(x^2 + y^2 + z^2 - 36) \ge 0$$ for all reals $x, y, z$. (Note: We remove the constraint $x^2 + y^2 + z^2 = 36$ by adding the term $s(x^2 + y^2 + z^2 - 36)$.)

Clearly $s \ne 0$. After completing the square in $z, x, y$ (one at a time), we have \begin{align*} f(x, y, z) &= s \left(z - \frac{y}{s}\right)^2 + s\left(x - \frac{y + 6}{2s}\right)^2 + \frac{4s^2 - 5}{4s}\left(y - \frac{6}{4s^2 - 5}\right)^2\\[6pt] &\qquad + M - \frac{144s^4 - 144s^2 - 36}{4s^3 - 5s}. \tag{2} \end{align*}

We have $s > 0$ and $\frac{4s^2 - 5}{4s} \ge 0$. From (2), the minimum of $f(x, y, z)$ occurs when $$y = \frac{6}{4s^2 - 5}, x = \frac{y + 6}{2s}, z = \frac{y}{s}. \tag{3}$$ From (3) and $x^2 + y^2 + z^2 = 36$, we have $$16s^6 - 44s^4 + 32s^2 - 5 = 0. \tag{4}$$ From (4) and $s > 0$ and $\frac{4s^2 - 5}{4s} \ge 0$, we have $$s = \frac16 \sqrt{33 + 30\cos\left(\frac13 \arccos \frac{17}{125}\right)}.$$ (Note: This is the trigonometric solution. Alternatively, the solution can be expressed in terms of radicals. )

We let $M = \frac{144s^4 - 144s^2 - 36}{4s^3 - 5s}$ to obtain the identity (1).

We are done.

River Li
  • 49,125
0

I found a good solution to my problem.

From the equation

$\nabla_r \ g(r) = 2 Q r + b + \lambda (2 r) = \mathbf{0} $

we have

$ Q r + \frac{1}{2} b = - \lambda r $

which is a vector equation that has three components. This translates into the following three equations

$ Q_{11} x + Q_{12} y + Q_{13} z + \dfrac{1}{2} b_x = - \lambda \ x $

$ Q_{21} x + Q_{22} y + Q_{23} z + \dfrac{1}{2} b_y = - \lambda \ y $

$ Q_{31} x + Q_{32} y + Q_{33} z + \dfrac{1}{2} b_z = - \lambda \ z $

Now, we can eliminate $\lambda$ by dividing the first equation by the second, and cross multiplying, and also by dividing the first equation by the third, and cross multiplying. This leads to

$ y (Q_{11} x + Q_{12} y + Q_{13} z + \dfrac{1}{2} b_x) = x (Q_{21} x + Q_{22} y + Q_{23} z + \dfrac{1}{2} b_y) $

and

$ z (Q_{11} x + Q_{12} y + Q_{13} z + \dfrac{1}{2} b_x) = x (Q_{31} x + Q_{32} y + Q_{33} z + \dfrac{1}{2} b_z) $

These two equation are quadratic in $x, y, z$, and in addition to them we have the quadratic equation of the constraint:

$x^2 + y^2 + z^2 = 36 $

Thus, we have a system of $3$ quadrics in $3$ unknowns, $x,y,z$. This system can be solved by Mathematica or Wolframalpha.com or a similar app.

The solutions are then substituted in the function, and the function values at the different points compared. This will give the maximum of $f$.