## Relative Extrema

**Definition**. Let $f$ be a function of two variables $x$ and $y.$

The function $f$ has a relative maximum at $\left(x_0,y_0\right)$ if $f(x,y)\leq f\left(x_0,y_0\right)$ for all $(x,y)$ in an open disk containing $\left(x_0, y_0\right).$

The function $f$ has a relative minimum at $\left(x_0,y_0\right)$ if $f(x,y)\geq f\left(x_0,y_0\right)$ for all $(x,y)$ in an open disk containing $\left(x_0, y_0\right).$

Collectively, relative maxima and relative minima are called relative extrema.

**Theorem**. (** Critical Points**) If $f$ has a relative extremum at $\left(x_0,y_0\right)$ and partial derivatives $f_x$ and $f_y$ both exist at $\left(x_0,y_0\right),$ then $$ f_x \left(x_0, y_0\right) = f_y\left(x_0, y_0\right) = 0. $$

**Proof**. Let $F(x)=f\left(x,y_0\right).$ Then $F(x)$ must have a relative extremum at $x=x_0,$ so $F’\left(x_0\right)=0,$ which means that $f_x\left(x_0,y_0\right) = 0.$ Similarly, $G(y)=f\left(x_0,y\right)$ has a relative extremum at $y=y_0,$ so $G’\left(y_0\right)=0$ and $f_y\left(x_0,y_0\right)=0.$ Thus, we must have both $f_x\left(x_0,y_0\right)=0$ and $f_y\left(x_0,y_0\right)=0.$

**Definition**. A critical point of a function $f$ defined on an open set $D$ is a point $\left(x_0,y_0\right)$ in $D$ where either one of the following is true:

(1) $f_x\left(x_0,y_0\right)=f_y\left(x_0,y_0\right)=0$ or

(2) at least one of $f_x$ or $f_y$ does not exist at $\left(x_0,y_0\right).$

**Example**. Find the critical points for the function \begin{equation} f(x,y)=x^2+y^2-2x-6y+14. \end{equation}

**Solution**. The first partial derivatives of $f$ are \begin{equation} f_x(x,y)=2x-2 \qquad \text{and} \qquad f_y(x,y)=2y-6. \end{equation} These partial derivatives are equal to 0 when $x=1$ and $y=3$ so the only critical point is $(1,3).$ By completing the square we find that \begin{equation} f(x,y)=4+(x-1)^2+(y-3)^2. \end{equation} Since $(x-1)^2\geq 0$ and $(y-3)^2\geq 0,$ we have $f(x,y)\geq 4$ for all values of $x$ and $y.$ Therefore, $f(1,3)=4$ is a local minimum, and in fact it is the absolute minimum of $f.$ This can be confirmed geometrically from the graph of $f$, which is the elliptic paraboloid with vertex $(1,3,4)$ as shown.

**Definition**. A critical point $P_0\left(x_0,y_0\right)$ is called a ** saddle point** of a function $f$ if every open disk centered at $P_0$ contains points in the domain of $f$ that satisfy $f(x,y)>f\left(x_0,y_0\right)$ as well as points in the domain of $f$ that satisfy $f(x,y)<f\left(x_0,y_0\right).$

The next example illustrates what a saddle point is.

**Example**. Find the extreme values of $ f(x,y)=y^2-x^2. $

**Solution**. Since $f_x=-2x$ and $f_y=2y,$ the only critical point is $(0,0).$ Notice that for points on the $x$-axis we have $y=0,$ so $f(x,0)=-x^2<0$ (if $x\neq 0.$) However for points on the $y$-axis we have $x=0,$ so $f(0,y)=y^2>0$ (if $y\neq 0$). Thus every disk with center $(0,0)$ contains points where $f$ takes positive values as well as points where $f$ takes negative values. Therefore $f(0,0)=0$ cannot be an extreme value for $f,$ so $f$ has no extreme values.

This example illustrates the fact that a function need not have a maximum or minimum value at a critical point. The graph of $f$ is the hyperbolic paraboloid which has a horizontal tangent plane $(z=0)$ at the origin. You can see that $f(0,0)=0$ is a maximum in the direction of the $x-\text{axis}$ but not in the direction of the $y$-axis. Near the origin the graph has the shape of a saddle as shown.

**Theorem**. (** Second Partials Test**) Assume $f$ has a critical point at $P_0(x_0,y_0)$ and assume that $f$ has continuous second order partial derivatives in a disk centered at $\left(x_0,y_0\right).$ If $D:=(f_{x x}f_{y y}-\left(f_{x y}\right)^2)\left(x_0,y_0\right)>0$, then

(1) a relative maximum occurs at $P_0$ if $f_{x x}\left(x_0,y_0\right)<0$

(2) a relative minimum occurs at $P_0$ if $f_{x x}\left(x_0,y_0\right)>0.$

If $D\left(x_0,y_0\right)<0$, then a saddle point occurs at $P_0.$

**Example**. Find the relative extrema of the function \begin{equation} f(x,y)=x^4+y^4-4x y+1. \end{equation}

**Solution**. We first locate the critical points \begin{equation} f_x=4x^3-4y \qquad \text{and} \qquad f_y=4y^3-4x. \end{equation} Setting these partial derivatives to 0, we obtain the equations$x^3-y=0$ and $y^3-x=0.$ To solve these equations we substitute $y=x^3$ from the first equation into the second one. This gives \begin{align*} 0 & =x^9-x =x\left(x^8-1\right) \\ & =x\left(x^4 -1 \right) \left(x^4+1 \right) \\ & = x(x-1)(x+1)\left(x^2+1\right)\left(x^4+1\right) \end{align*} So there are three real roots: $x=0,1 ,-1.$ The three critical points are $(0,0), (1,1),$ and $(-1,-1).$ Next we calculate the second partial derivatives and $D(x,y)$: \begin{equation} f_{x x}=12x^2, \qquad f_{x y}=-4, \qquad f_{y y}=12y^2. \end{equation} Thus, \begin{equation}D(x,y)=f_{x x}f_{y y}-\left(f_{x y}\right)^2=144x^2y^2-16. \end{equation} Since $D(0,0)=-16<0,$ it follows that the origin is a saddle point; that is, $f$ has no local extremum at $(0,0).$ Since $D(1,1)=128>0$ and $f_{x x}(1,1)=12>0,$ we see that $f(1,1)=-1$ is a local minimum. Similarly, we have $D(-1,-1)=128>0$ and $f_{x x}(-1,1-1)=12>0,$ so $f(-1,-1)=-1$ is also a local minimum.

## Exercises on Relative Extrema

**Exercise**. Find the absolute extrema for the function $f(x,y)=x y^2-2xy+3y$ in the triangular domain with vertices $(0,0)$, $(1,0)$, and $(1,1).$

**Exercise**. Find and classify the relative extrema and the saddle points of $f(x,y)=xy -2x-4y.$

**Exercise**. Find the critical points of the function

$f(x,y)=x^3+y^2-2xy+7x-8y+2.$

**Exercise**. Find and classify the relative extrema and the saddle points of $f(x,y)=xy -2x-4y.$

**Exercise**. Find the absolute extrema for the function $f(x,y)=x y^2-2xy+3y$ in the triangular domain with vertices $(0,0)$, $(1,0)$, and $(1,1).$

**Exercise**. Find the critical points and classify each as a relative maximum, a relative minimum, or a saddle point.

$(1) \quad f(x,y)=2x^2-4 x y+y^3+2$

$(2) \quad f(x,y)=e^{-x}\sin y$

$(3) \quad f(x,y)=(x-2)^2+(y-3)^4$

$(4) \quad f(x,y)=\left(x^2+2y^2\right)e^{1-x^2-y^2}$

$(5) \quad f(x,y)=x^2+y^2+\frac{32}{x y}$

$(6) \quad f(x,y)=(x-4)\ln (x y)$

$(7) \quad f(x,y)=2x^3+y^3+3x^2-18y^2+81y+5$

$(8) \quad f(x,y)=3x^2+12x+8y^3-12y^2+7$

**Exercise**. Find the absolute maximum and minimum values for each of the following functions.

$(1) \quad f(x,y)=e^{x^2+2x+y^2}$ on the disk $x^2+2x+y^2\leq 0.$

$(2) \quad f(x,y)=x^2+x y +y^2$ on the disk $x^2+y^2\leq 1.$

$(3) \quad f(x,y)=x y-2x-5y$ on the triangular region $S$ with vertices $(0,0),$ $(7,0),$ and $(7,7).$

$(4) \quad f(x,y)=x^2-4 x y+y^3+4y$ on the square $0\leq x\leq 2,$ $0\leq y\leq 2.$

$(5) \quad f(x,y)=x^2+3y^2-4x+2y-3$ on the square region $S$ with vertices $(0,0),$ $(3,0),$ $(3,-3),$ and $(0,-3).$

**Exercise**. Find three positive numbers whose sum is 54 and whose product is as large as possible.

**Exercise**. A wire of length $L$ is cut into three pieces that are bent to form a circle, a square, and a equilateral triangle. How should the cuts be made to minimize the sum of the total area.?

**Exercise**. A rectangular box with no top is to have a fixed volume. What should its dimensions be if we want to use the least amount of material in its

construction?

**Exercise**. Let $R$ be the triangular region in the $x y$-plane with vertices $(-1,-2),$ $(-1,2),$ and $(3,2).$ A plate in the shape of $R$ is heated so that the temperature at $(x,y)$ is $$ T(x,y)=2x^2-x\text{ }y+y^2-2y+1 $$ (in degrees Celsius). At what point in $R$ or on its boundary is $T$ maximized? What are the temperatures?

**Exercise**. Find the maximum and minimum values for the given function in the given closed region.

$(1) \quad z=8x^2+4y^2+4y+5$, $x^2+y^2\leq 1$

$(2) \quad z=6x^2+y^3+6y^2$, $x^2+y^2\leq 25$

$(3) \quad z=8x^2-24xy+y^2$, $x^2+y^2\leq 25$

**Exercise**. Find the volume of the largest box that cane inscribed in the ellipsoid $$

\frac{x^2}{a^2}+\frac{y^2}{b^2}+\frac{z^2}{c^2}=1. $$

**Exercise**. Assuming that the function $$ F= 2x^2+6y^2+45z^2-4xy+6yz+12xz-6y+14 $$ has a minimum, find it. Prove that this function has no maximum value.