Determine all local and global extrema of the function \begin{equation*}f:\mathbb{R}^2\rightarrow \mathbb{R} , \ \ f(x,y)=x^3+3xy^2-3x+1\end{equation*} Determine also the type of extrema : minimum, maximum, local, global.
$$$$
I have done the following :
First we calculate the gradient : \begin{equation*}\nabla f=\begin{pmatrix}f_x \\ f_y\end{pmatrix}=\begin{pmatrix}3x^2+3y^2-3 \\ 6xy\end{pmatrix}\end{equation*} Then we set the gradient equal to $0$ and we solve the syste that we get: \begin{equation*}\begin{pmatrix}3x^2+3y^2-3 \\ 6xy\end{pmatrix}=\begin{pmatrix}0\\ 0\end{pmatrix}\Rightarrow \begin{cases}3x^2+3y^2-3=0 \\ 6xy=0\end{cases}\end{equation*} From the second equation we get $x=0$ or $y=0$. If $x=0$ we get from the first equation $3y^2-3=0\Rightarrow y^2=1 \Rightarrow y\pm 1$. If $y=0$ we get from the first equation $3x^2-3=0\Rightarrow x^2=1 \Rightarrow x\pm 1$. So we get the extrema $(0,-1)$, $(0,1)$, $(-1,0)$, $(1,0)$.
Now we determine the Hessian matrix : \begin{equation*}H_f(x,y)=\begin{pmatrix}f_{xx} & f_{xy} \\ f_{yx} & f_{yy}\end{pmatrix}=\begin{pmatrix}6x & 6y \\ 6y & 6x\end{pmatrix}\end{equation*}
- \begin{equation*}H_f(0,-1)=\begin{pmatrix}0 & -6 \\ -6 & 0\end{pmatrix}\end{equation*} The eigenvalues are $\lambda_1=-6$ and $\lambda_2=6$. The matrix is indefinite. So at $(0,1)$ the function has a saddle point.
- \begin{equation*}H_f(0,1)=\begin{pmatrix}0 & 6 \\ 6 & 0\end{pmatrix}\end{equation*} The eigenvalues are $\lambda_1=-6$ and $\lambda_2=6$. The matrix is indefinite. So at $(0,1)$ the function has a saddle point.
- \begin{equation*}H_f(-1,0)=\begin{pmatrix}-6 & 0 \\ 0 & -6\end{pmatrix}\end{equation*} The eigenvalues are $\lambda_1=-6$ and $\lambda_2=-6$. The matrix is negative definite. So at $(-1,0)$ the function has a local maximum.
- \begin{equation*}H_f(1,0)=\begin{pmatrix}6 & 0 \\ 0 & 6\end{pmatrix}\end{equation*} The eigenvalues are $\lambda_1=6$ and $\lambda_2=6$. The matrix is positive definite. So at $(1,0)$ the function has a local minimum.
Do we have to check also some other points or can we say that at $(-1,0)$ the function has also a global maximum and at $(1,0)$ a global minimum?