# Find the max and min values of a multivariable function on the boundary of a domain

I have the multivariable function: $$f(x,y) = x^3 + y^3 - 3xy + 2$$

I want to find the maximum and minimum values of this function on the domain: $$D=[(x,y) : x,y\ge 0, x^2 +y^2\le4]$$

I found the partial derivatives to be:

$$f_x=3x^2 -3y$$

$$f_y=3y^2-3x$$

From here I set both my partial derivatives to equal $$0$$ and solved for $$x$$ and $$y$$ and got $$(1,1)$$ and $$(0,0)$$, I believe these two could potentially be the max/min I'm looking for, however I know there are more possibilities.

I then created a function $$g$$ where $$g=x^2 + y^2$$ ($$g = 4$$)

I know that $$\nabla f= \lambda \nabla g$$ so $$(3x^2-3y,3y^2-3x) = \lambda(2x,2y)$$

I then set up $$3$$ equations:

$$\lambda x = \frac32 (x^2) - \frac32 (y)$$

$$\lambda y = \frac32 (y^2) - \frac32 (x)$$

$$x^2 + y^2 = 4$$

But I'm not sure where to go from here and how to solve these equations for $$x$$ and $$y$$ and $$\lambda$$. To be honest I'm not even sure if this is the best way to go about answering this question.

If anyone could show me how I would find the maximum and minimum of the function on this domain with a better method, or help me continue with mine, it would really help.

In both methods, you will have to additionally check boundary points for extrema.

By the way, Lagrange Multiplier method in this case does not directly give you the points where extrema occurs.

Applying Lagrange Multiplier method,

$$3x^2 - 3 y = 2 \lambda x \tag1$$
$$3y^2 - 3 x = 2 \lambda y \tag2$$
$$x^2+y^2 \leq 4 \tag3$$

If $$x, y \ne 0$$, from $$(1), \lambda = \cfrac{3x^2-3y}{2x}$$

Plugging into $$(2), \cfrac{3y^2-3x}{2y} = \cfrac{3x^2-3y}{2x}$$

$$xy^2 - x^2 = x^2y - y^2$$

$$(x-y) (x+y+xy) = 0$$

So $$x = y$$ is a solution.

Plugging into objective function, we have

$$x^3 + y^3 - 3xy + 2 = 2x^3 - 3x^2 + 2 = (x-1)^2 (2x + 1) + 1$$

As $$x \geq 0$$, the minimum occurs when $$x = y = 1$$

When $$x^2 + y^2 = 4$$, $$x = y$$ gives point $$(\sqrt2, \sqrt2)$$ that you should test.

Lastly, please test boundary points which are $$(0, 0), (2, 0)$$ and $$(0, 2)$$.

Maximum is $$10$$ at points $$(2, 0)$$ and $$(0, 2)$$ and minima is $$1$$ at point $$(1, 1)$$.

• Sorry, I'm still quite new to Lagrange Multipliers, why do we set $(1)$ and $(2)$ to equal $2\lambda x$ and $2\lambda y$? Is this just a rule of Lagrange multipliers? Jul 28, 2021 at 15:54
• If $f(x, y)$ is the objective function that you are trying to maximize / minimize and $g(x, y) = 0$ is the constraint, we set $f(x, y) = \lambda g(x,y)$. Now take partial derivative wrt $x$ and $y$. That gives those two equations. Jul 28, 2021 at 15:59
• Ok, so just to clarify and make sure I've got this right, all the points that I have to test are $(1,1) , (\sqrt 2 , \sqrt 2), (0,0), (2,0),(0,2)$? and from testing these values we can see which one/ones are the maximum and the minimum, correct? Or have I missed some points or made a mistake? Jul 28, 2021 at 16:10
• Also, when you said $x=y$ is a solution from having $x-y = 0$, did we ignore $(x+y+xy)=0$ since it's only possible for $x=y=0$ and we already have this point? Jul 28, 2021 at 16:12
• @CharlieP that is correct and we came to this equation in case $x, y \ne 0$. Jul 28, 2021 at 16:18

Write $$\mu = \frac{2}{3} \lambda$$, the equations becomes

\begin{align} \mu x &= x^2 - y , \\ \mu y &= y^2 - x, \\ x^2 + y^2 &=4. \end{align}

From the first two, we have

$$\mu (x-y) = (x-y)(x+y) + (x-y),$$ thus

$$(x-y) ( \mu -1 -x-y) = 0.$$

Then either $$x=y$$, or $$x + y = \mu-1$$.

In the case $$x=y$$, the third equation would give you two points. In the second case, we add the first two equations to get

$$(\mu +1)( x+y) = 4.$$ Then $$\mu$$ is found (which has two values) and from there it is not difficult to find $$(x, y)$$ using

\begin{align} x+y&= \frac{4}{1+\mu}, \\ x^2 + y^2 &= 4. \end{align}

• Everything makes sense but I'm a bit confused at the part where you got $(x-y)(\mu -1-x-y)=0$ How did you obtain this and why can't we just divide by $(x-y)$ since it appears in every term of the equation? Jul 28, 2021 at 15:33
• You can divide by $x-y$ if $x-y \neq 0$. Thus we need to split into two cases: where $x-y = 0$, or $x-y \neq 0$ and in that case $\mu-1-x-y = 0$. @CharlieP Jul 28, 2021 at 15:37
• Ok, I understand. One more thing I'm a bit confused by is when you say we add the first two equations to get $(\mu +1)(x+y)=4$, what exactly did you add together to get this? Jul 28, 2021 at 15:45
• I used $x^2 + y^2 = 4$ @CharlieP Jul 28, 2021 at 15:46