# How do you maximize and minimize f(x,y)=x^2+9y^2-xy constrained to 3<xy<5?

Nov 17, 2015

If your constraints are as written, then $f$ has no maximum or minimum value. If you meant to write your constraints as $3 \le q x y \le q 5$, then $f$ has a minimum value of 15 at the point $\left(x , y\right) = \left(3 , 1\right)$ but no maximum value. By symmetry in the formula for $f$, similar behavior would occur in the third quadrant.

#### Explanation:

The partial derivatives of $z = f \left(x , y\right) = {x}^{2} + 9 {y}^{2} - x \cdot y$ are $\frac{\partial z}{\partial x} = 2 x - y$ and $\frac{\partial z}{\partial y} = 18 y - x$. Setting these equal to zero and solving for $x$ and $y$ give only one critical point, at the origin $\left(x , y\right) = \left(0 , 0\right)$, which is not in the domain $3 \le q x y \le q 5$.

Therefore, the maximum and minimum values of $f$, if any, must occur along the boundary of the domain, where either $x y = 3$ or $x y = 5$. Using the function $g \left(x , y\right) = x y$, these conditions can be written as $g \left(x , y\right) = 3$ and $g \left(x , y\right) = 5$.

The Method of Lagrange Multipliers can now be used. The gradient vector of $f$ is $\nabla f = < 2 x - y , 18 y - x >$ and the gradient vector of $g$ is $\nabla g = < y , x >$. Setting $\nabla f = \lambda \nabla g$, along with the constraint equation, results in the system $2 x - y = \lambda y$, $18 y - x = \lambda x$, and, for the first boundary curve, $x y = 3$, while for the second boundary curve, $x y = 5$.

We then have $\frac{2 x - y}{y} = \lambda = \frac{18 y - x}{x}$ whenever $y \ne 0$ (for the first equation) and $x \ne 0$ (for the second equation). Cross-multiplication of this leads to $2 {x}^{2} - x y = 18 {y}^{2} - x y$, or ${x}^{2} = 9 {y}^{2}$, or $x = \pm 3 y$. Since we are in the first quadrant, we use $x = 3 y$ to get $3 y \cdot y = 3 \setminus R i g h t a r r o w y = 1 \setminus R i g h t a r r o w x = 3$ for the first boundary curve ($x y = 3$) and $3 y \cdot y = 5 \setminus \rightarrow y = \sqrt{\frac{5}{3}} \setminus \rightarrow x = \sqrt{15}$ for the second boundary curve.

If you now look at the contour map of the level curves (shown further below...dark means smaller outputs and light means higher outputs), you'll see that a global minimum for $f$ occurs on the lower (left) boundary curve at $\left(x , y\right) = \left(3 , 1\right)$, with a global minimum value of $f \left(3 , 1\right) = 15$.

A local minimum value for $f$ along the upper (right) boundary curve occurs at $\left(x , y\right) = \left(\sqrt{15} , \sqrt{\frac{5}{3}}\right)$ with local minimum value $f \left(\sqrt{15} , \sqrt{\frac{5}{3}}\right) = 25$. You can also see there are no global maximum values (the function output keeps going up and up without bound as you move up and up between the boundary curves without bound.