# Maximum and Minimum Values of Functions of Several Variables

Just like with functions of a single variable, we often want to find extreme values of functions of several variables, that is, maximum and minimum values. First, let's get some definitions out of the way - all of which we have already seen before in single variable calculus.

Definition: Let $z = f(x, y)$ be a two variable real-valued function. We say that $f$ has a Local Maximum at $(a, b) \in D(f)$ if there exists a disk $\mathcal D$ whose center is $(a, b)$ such that $\forall (x,y) \in \mathcal D$ we have that $f(x,y) ≤ f(a, b)$. The value $f(a, b)$ is called a Local Maximum Value. We say that $f$ has a Local Minimum at $(a, b) \in D(f)$ if there exists a disk $\mathcal D$ whose center is $(a, b)$ such that $\forall (x, y) \in \mathcal D$ we have that $f(a, b) ≤ f(x, y)$. The value $f(a, b)$ is called a Local Minimum Value. |

*Some people use the term "relative maximum/minimum" in place of "local maximum/minimum" to mean the same thing.*

Definition: Let $z = f(x, y)$ be a two variable real-valued function. If $\forall (x, y) \in D(f)$ we have that $f(x, y) ≤ f(a, b)$ then $f(a, b)$ is called an Absolute Maximum Value. If $\forall (x, y) \in D(f)$ we have that $f(a, b) ≤ f(x, y)$ then $f(a, b)$ is called an Absolute Minimum Value. |

*Some people use the term "global maximum/minimum" in place of "absolute maximum/minimum" to mean the same thing.*

The following image represents what the absolute maximum/minimum value and local maximum/minimum values look like on the graph of a two variable function $z = f(x, y)$.

Recall from Fermat's Theorem for Extrema that if a single variable function $y = f(x)$ has a local maximum or local minimum value at $a \in D(f)$ then $f'(a) = 0$. The following theorem is an analogous to Fermat's Theorem for extreme, but instead applies to functions of two variables in terms of partial derivatives.

Theorem 1: If $f$ has a local maximum or local minimum at $(a, b) \in D(f)$ then both $\frac{\partial}{\partial x} f(a, b) = 0$ and $\frac{\partial}{\partial y} f(a, b) = 0$. |

**Proof:**Suppose that $f$ has a local maximum or local minimum value at $(a, b)$.

- Let $g(x) = f(x, b)$. Since $f$ has a local maximum/minimum at $(a, b)$ then $g$ has a local maximum/minimum at $a$ and so by Fermat's Theorem we have that $g'(a) = 0$. But $g'(a) = \frac{\partial}{\partial x} f(a, b)$, so $\frac{\partial}{\partial x} f(a, b) = 0$.

- Let $h(y) = f(a, y)$. Since $f$ has a local maximum/minimum at $(a, b)$ then $h$ has a local maximum/minimum at $b$ and so by Fermat's Theorem we have that $h'(b) = 0$. But $h'(b) = \frac{\partial}{\partial y} f(a, b)$, so $\frac{\partial}{\partial y} f(a, b) = 0$ as well. $\blacksquare$

It is important to note that the converse of Theorem 1 need not be true similarly to how the converse of Fermat's Theorem for Extrema need not be true - that is, if both partial derivatives at $(a, b)$ are zero, it is possible that $f(a, b)$ is not a local maximum and not a local minimum value.

Now recall that if $y = f(x)$ is a single variable real-valued function and if $a \in D(f)$ yields a local maximum or local minimum value, then the tangent line at $(a, f(a))$ is horizontal. Corollary 1 below gives us an analogous geometric interpretation of what the tangent planes at an extreme value look like for a function of two variables.

Corollary 1: If $z = f(x, y)$ has a local maximum or minimum value at $(a, b) \in D(f)$ then the tangent plane at $(a, b, f(a,b))$ is a horizontal plane, i.e, the tangent plane at $(a, b, f(a,b))$ is parallel to the $xy$-plane. |