2

I want to find the maximum of

$ f(x, y, z) = xy + 2 y z $

subject to

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

My Approach:

The most direct way is to parameterize $(x, y, z)$ which is easy in this case because $(x,y,z)$ lie on a sphere centered at the origin with radius $6$. Therefore, using spherical parameterization,

$ (x, y, z) = 6 ( \sin \theta \cos \phi, \sin \theta \sin \phi, \cos \theta ) $

Hence our function becomes a function of $\theta$ and $\phi$

$f(\theta, \phi) = 36 ( \sin^2 \theta \cos \phi \sin \phi + 2 \sin \theta \cos \theta \sin \phi ) $

Using $\sin^2 \theta = \dfrac{1}{2} (1 - \cos(2 \theta) ) $

and $ 2 \sin \theta \cos \theta = \sin(2 \theta) $

The function now becomes,

$ f(\theta, \phi) = 9 \bigg( (1 - \cos(2 \theta)) \sin(2 \phi) + 4 \sin(2 \theta ) \sin \phi \bigg) $

Maximizing over $\theta$ first

$ f_1(\phi) = 9 \sqrt{ (1 - \cos(2 \phi))^2 + 16 \sin^2(\phi) } $

Using the identities mentioned above this simplifies to

$ f_1(\phi) = 9 \sqrt{ (1 - \cos(2 \phi) )^2 + 8 (1 - \cos(2 \phi) ) } $

Let $u = \cos(2 \phi) $, then basically we want to maximize

$ g(u) = u^2 - 10 u + 9 $

over $[-1, 1]$. It is easy to find that the maximum of $g$ is at $u = -1$ and the maximum is

$g_{Max} = 20 $

Thus the maximum of our function is

$ f_{Max} = 9 \sqrt{ 20 } = 18 \sqrt{5} \approx 40.25 $


Another method is one that requires finding the eigenvalues of the matrix

$ Q = \begin{bmatrix} 0 && \dfrac{1}{2} && 0 \\ \dfrac{1}{2} && 0 && 1 \\ 0 && 1 && 0 \end{bmatrix} $

The characteristic polynomial is

$ \lambda ( \lambda^2 - \dfrac{5}{4} ) = 0 $

Thus $\lambda_{Max} = \sqrt{\dfrac{5}{4}} = \dfrac{1}{2} \sqrt{5} $

Multiplying this by $36$ gives the answer as $ 18 \sqrt{5} $.

I look forward to alternative solutions, or comments on my solutions.

Thank you all.

Hosam Hajeer
  • 21,978

2 Answers2

6

Perhaps another solution $$\begin{align} L &:=xy+2yz\\ &=y(x+2z)\le |y| \sqrt{(x^2+z^2)(1+2^2)} \hspace{1cm}\text{Cauchy–Schwarz inequality}\\ &\le \sqrt{5}\cdot |y|\cdot\sqrt{(x^2+z^2)} \le \sqrt{5}\cdot \frac{y^2 +(x^2+z^2)}{2}=18\sqrt{5} \hspace{1cm}\text{AM-GM inequality} \\ \end{align}$$ The equality occurs if and only if $\frac{x}{1} = \frac{z}{2}$, $y^2 = x^2+z^2$ and $(x,y,z)$ have the same sign, that is $$(x,y,z) =\left(\pm\sqrt{\frac{18}{5}},\pm\sqrt{18},\pm\sqrt{\frac{4\cdot 18}{5}} \right)$$

NN2
  • 15,892
1

NN2 gave a very good answer. I am providing the solution to the general problem instead.

Let us consider the problem $$ \max_{x\in\mathbb{R}^n} x^TPx\text{ such that }x^TQx=r^2 $$ where $P$ is a symmetric matrix, $Q$ is positive definite and $r\ne0$ is a real scalar.

We can consider the following Lagrangian function

$$ L(x,\lambda)=\max_{x\in\mathbb{R}^n} x^T(P-\lambda Q)x+\lambda r^2 $$ where $\lambda\in\mathbb{R}$.

The maximum will be finite if and only if $P-\lambda Q$ is negative semidefinite, which also makes the problem concave in $x$. Therefore, the dual problem is given by

$$ \min_{\lambda\in\mathbb{R}} \lambda r^2 \text{ such that }P-\lambda Q\preceq0. $$

This can be reformulated in terms of the generalized eigenvalue problem for the pair $(P,Q)$. Since $Q$ is invertible and positive definite, then we can consider the Cholesly factorization $Q=R^TR$ to get that $R^{-T}PR^{-1}-\lambda I$ must be negative definite, or, in other words that that $\lambda^*=\max\mathrm{eig}(R^{-T}PR^{-1})$ and we get that the maximum of the original optimization problem is equal to

$$\lambda^*r^2.$$

If we apply to the current, problem we have that $\lambda^*=\sqrt{5}/2$ and we get that the maximum is $18\sqrt{5}$.

KBS
  • 7,114