# Extrema of 3D function

Find the local minima and maxima of function:

$$f(x,y) = x^2-2x+y^2$$

It's easy task with one-variable functions. What should I go about in this case?

-
min is $-1$ at $(x,y)=(1;0)$ – Le Chifre Feb 3 '13 at 17:27

\begin{align} f(x,y)&=x^2 - 2x+y^2\\ \nabla f(x,y)&=\begin{bmatrix} 2x-2\\2y \end{bmatrix}\\ \nabla^2f(x,y)&=\begin{bmatrix} 2&0\\0&2\end{bmatrix}\\ \text{Set : }\nabla f(x,y)&=0\\ \implies (x,y)&=(1,0) \end{align} This is Minima. (Hessian is Positive Definite)

The function has no maxima since Hessian can never be Negative Definite. This is also obvious from the graph of the function.

Graph:

Hint: First of all find the critical points by doing : $$f_x=0,~f_y=0$$ Assume $(a,b)$ is such that oint. Now find the following terms: $$\Delta_1=f_{xx},~~\Delta_2=f_{xx}f_{yy}-f_{xy}$$ Now if $$\Delta_1|_{(a,b)}>0,~\Delta_2|_{(a,b)}>0$$ then $(a,b)$ will make $f$ minimum. If $$\Delta_1|_{(a,b)}<0,~\Delta_2|_{(a,b)}>0$$ then $(a,b)$ will make $f$ maximum. And when $$\Delta_2|_{(a,b)}<0$$ then $(a,b)$ will make $f$ a saddle point.