# How to find extrema on a triangle

Let $T\subset\mathbb{R}^2$ be the (closed) triangle bounded by the lines $x+y=4$, $x\ge-1$ and $y\ge-1$. I want to find and classify all the extrema of the function $f(x,y)=-x^2y(x+y-2)$ on the triangle $T$.

I've done the following: Solving $\nabla f=0$ gives the points $(0,0), (0,1)$ and $0,2$. But when I compute the Hessian, I keep getting eigenvalue 0.

Is there someone who can show me how to solve this problem?

-
But according to your function, the critical points are given as $(0,y)$ $(2,0)$ $(1,\frac{1}{2})$. Check it again. – Babak S. Jun 20 '12 at 18:03

Stefan Smith describes the stages for locating extrema in a bounded region, which are analogous to what is done for a closed interval with a single-variable function: critical points in the interior of the region are located by finding the intersection of the curves on which the first partial derivatives are zero; locating critical points on the "edges" of the region may be accomplished by reducing the number of variables in the function to one and finding where the first derivative is zero; and finally we directly evaluate the function at the "vertices" of the region.

For $\ f(x, \ y) \ = \ -x^2 \ y \ (x+y-2) \$ on the specified triangle region, we can do a little preliminary work to find "zones" within the triangle where the function is positive or negative. With the factors indicated, the first, $\ -x^2 \$ is always negative, and the third is positive only "above" the line $\ x \ + \ y \ = \ 2 \$ . We can produce a graph, as shown below, in which the edges of the triangular region are marked in dark blue; the function is zero on the coordinate axes and the faint blue line, is positive in the sections shaded in green, and is negative in those shaded in red. We see from this that the intersection points of the "zero-lines", $\ (0, \ 0) \ , \ (2, \ 0) \$ , and $\ (0, \ 2) \$ are all saddle points.

The first partial derivatives are $\ f_x \ = \ xy \ ( 4 \ - \ 3x \ - \ 2y) \$ and $\ f_y \ = \ x^2 \ ( 2 \ - \ x \ - \ 2y) \$ , which are both zero on the $\ y-$ axis ($x \ = \ 0$) , $\ (2, \ 0) \$ , and at $\ ( 1, \ \frac{1}{2} ) \$ , as Babak S. observes. The function is non-zero only for the last of these, for which $\ f( 1, \ \frac{1}{2} ) \ = \ \frac{1}{4} \$ ; this is sitting within a "positive-value" region, and proves to be a relative maximum.

the first partial derivatives of $\ f(x, \ y) \$ are zero on the coordinate axes and the two red lines, with $\ f_x \ = \ 0$ on both axes and the steeper red line, and $\ f_y \ = \ 0$ on the $\ y-$ axis and the shallower red line

We then examine the three edges of the region:

$\mathbf{x \ = \ -1 \ : } \quad f(-1, \ y ) \ = \ -y \ (y \ - \ 3) \ = \ 3y \ - \ y^2 \ \ \Rightarrow \ \ \frac{df}{dy} \ = \ 3 \ - \ 2y \ \ , \ \ \frac{d^2f}{dy^2} \ = \ -2$

$\Rightarrow \ \$ relative maximum at $\ f(-1, \ \frac{3}{2}) \ = \ \frac{9}{4} \ \ ;$

$\mathbf{y \ = \ -1 \ : } \quad f(x, \ -1 ) \ = \ x^2 \ (x \ - \ 3) \ = \ x^3 \ - \ 3x^2 \ \ \Rightarrow \ \ \frac{df}{dy} \ = \ 3x^2 \ - \ 6x$ $$= \ 3x \ (x \ - \ 2) \ \ , \ \ \frac{d^2f}{dy^2} \ = \ 6x \ - \ 6$$

$\Rightarrow \ \$ relative maximum at $\ f(0, \ -1) \ = \ 0 \$ , relative minimum at $\ f(2, \ -1) \ = \ -4 \ \ ;$

$\mathbf{y \ = \ 4 \ - \ x \ : } \quad f(x, \ 4 - x ) \ = \ 2x^3 \ - \ 8x^2 \ \ \Rightarrow \ \ \frac{df}{dy} \ = \ 6x^2 \ - \ 16x$ $$= \ 2x \ (3x \ - \ 8) \ \ , \ \ \frac{d^2f}{dy^2} \ = \ 12x \ - \ 16$$

$\Rightarrow \ \$ relative maximum at $\ f(0, \ 4) \ = \ 0 \$ , relative minimum at $\ f(\frac{8}{3}, \ \frac{4}{3})$ $$= \ -\frac{512}{27} \ \approx \ -18.96 \ \ .$$

Lastly, we evaluate the function at the three vertices of the triangle:

$$f(-1, \ -1) \ = \ -4 \ \ , \ \ f(-1, \ 5) \ = \ -10 \ \ , \ \ \text{and} \ \ f(5, \ -1) \ = \ 50 \ \ .$$

We find then that the absolute maximum lies at a vertex, with $\ f(5, \ -1) \ = \ 50 \$ , and the absolute minimum is found on the slanted edge of the triangle, with $\ f(\frac{8}{3}, \ \frac{4}{3}) \ = \ -\frac{512}{27} \$ .

The points $\ (0, \ 2) \$ and $\ (2, \ 0 ) \$ are both saddle points. The points along the $\ y-$ axis, other than $\ (0, \ 2) \$ and the origin are either relative maxima or minima along lines oblique to the $\ y-$ axis; all with the value of the function being zero, and so are of limited interest here.

Because the total degree of all the terms in $\ f(x, \ y) \$ is two or larger, the Hessian, which only contains second partial derivatives, may not provide any useful information for points on the coordinate axes. Here are some related problems which present similar situations; we are forced to look instead at details of the function's behavior to understand the nature of such critical points (just as we are in single-variable calculus when the "second derivative test" is uninformative).

-

Find the critical points of $f$. Ignore those that are not in $T$. Find the maximum and minimum of $f$ on the left side; that is, maximize and minimize $f(-1,y)$ for $-1 \leq y \leq 5$. Find the maximum and minimum of $f$ on the bottom side; that is, maximize and minimize $f(x,-1)$ for $-1 \leq x \leq 5$. Find the maximum and minimum of $f$ on the hypotenuse; that is, maximize and minimize $f(x,4-x)$ for $-1 \leq x \leq 5$. Now take the maximum and the minimum of the values of $f$ you found at the critical point(s) and for the three sides. You don't need to take the Hessian of anything; indeed, it is sometimes a waste of time. The procedure is based on the fact that a continuous function on a compact subset of Euclidean space has a (global) maximum and minimum, which occur at critical points or on the boundary.

-