# How do you minimize and maximize f(x,y)=(x-y)/x^2 constrained to xy=4?

Aug 12, 2016

${f}_{\max} = f \left(2 \sqrt{3} , \frac{2}{\sqrt{3}}\right) = \frac{1}{3 \sqrt{3}}$
${f}_{\min} = f \left(- 2 \sqrt{3} , - \frac{2}{\sqrt{3}}\right) = - \frac{1}{3 \sqrt{3}}$

#### Explanation:

simplest way here is to convert this to a problem in single variable calculus

$f \left(x , y\right) = \frac{x - y}{x} ^ 2$ and $x y = 4$

$\implies f \left(x\right) = \frac{x - \frac{4}{x}}{x} ^ 2 = \frac{1}{x} - \frac{4}{x} ^ 3$

$f ' \left(x\right) = - \frac{1}{x} ^ 2 + \frac{12}{x} ^ 4$

$f ' \left(x\right) = 0 \implies \frac{12}{x} ^ 4 - \frac{1}{x} ^ 2 = 0$

$12 - {x}^{2} = 0 , x = \pm 2 \sqrt{3}$

and $y = \frac{4}{x} = \pm \frac{4}{2 \sqrt{3}} = \pm \frac{2}{\sqrt{3}}$

so the fixed points are

$\left(2 \sqrt{3} , \frac{2}{\sqrt{3}}\right)$ and $\left(- 2 \sqrt{3} , - \frac{2}{\sqrt{3}}\right)$

the advantage of single var over Lagrange Multipe is that the nature of the fixed points are found mechanically via the second derivative

$f ' ' \left(x\right) = \frac{2}{x} ^ 3 - \frac{48}{x} ^ 5$

$= \frac{2}{x} ^ 3 \left(1 - \frac{24}{x} ^ 2\right)$

$x = + 2 \sqrt{3} , f ' ' = \frac{2}{2 \sqrt{3}} ^ 3 \left(1 - 2\right)$ ie negative, so this is a local max

$x = - 2 \sqrt{3} , f ' ' = - \frac{2}{2 \sqrt{3}} ^ 3 \left(1 - 2\right)$ ie positive, so this is a local min

this is consistent with evaluation of the function at these points

${f}_{\max} = f \left(2 \sqrt{3}\right) = \frac{1}{3 \sqrt{3}}$
${f}_{\min} = f \left(- 2 \sqrt{3}\right) = - \frac{1}{3 \sqrt{3}}$

repeating this to check using the Lagrange Multiplier to optimise function $f \left(x , y\right) = \frac{x - y}{x} ^ 2 = \frac{1}{x} - \frac{y}{x} ^ 2$ subject to constraint $g \left(x , y\right) = x y - 4 = 0$

$\nabla f = \lambda \nabla g$

$\implies \left(\begin{matrix}- \frac{1}{x} ^ 2 + \frac{2 y}{x} ^ 3 \\ - \frac{1}{x} ^ 2\end{matrix}\right) = \lambda \left(\begin{matrix}y \\ x\end{matrix}\right)$

$\implies \setminus \lambda = \frac{- \frac{1}{x} ^ 2 + \frac{2 y}{x} ^ 3}{y} = \frac{- \frac{1}{x} ^ 2}{x}$

$\implies - \frac{1}{x} + \frac{2 y}{x} ^ 2 = - \frac{y}{x} ^ 2$

$\implies \frac{3 y}{x} ^ 2 = \frac{1}{x} , 3 y = x$ telling us that the critical points lie on the intersection of $x y = 4$ and $y = \frac{1}{3} x$

so if we plug this into the constraint $x y = 4$ then

$3 y \cdot y = 4 , y = \pm \frac{2}{\sqrt{3}}$ same as above

further work on the Hessian matrix might reveal the nature of the fixed points but that is already apparent from the single variable approach