# Find maxima and minima of the function

Given: $$f:\mathbb{R}^2 \rightarrow \mathbb{R}, f\left(x,y \right)=-x^4+x^3-3x^2y+3xy^2-y^3$$ Find all points where gradient is equal to zero. Decide whether in those points function has either maxima or minima.

hess's matrix does not help here as gradient is equal to zero at $(0,0)$ thus hess matrix is zero always. Thus how to check whether function has its minimum or maximum at the point of $(0,0)$?

By considering the $y$-derivative, the $y$-coordinate of the gradient is zero iff $y=x$. The $x$-coordinate is then zero iff $y=0$, so the only gradient-zero point is $(0,0)$.
To determine whether this is a minimum or a maximum (or otherwise), we can examine a small perturbation near $(0, 0)$. That is, for small-in-modulus $x, y$, is $f$ positive, negative, or both?
It's clear that if we set $y=x$, we get $-x^4$, so if we leave $(0,0)$ along the line $y=x$, we go negative in both directions.
If we set $y=-x$, we get $f(x, -x) = 8 x^3 - x^4$, which is positive for positive $x$ and negative for negative $x$. Therefore we must have a saddle: if we leave $(0,0)$ along $y=-x$ for positive $x$, we get a positive $f$, while if we leave along $y=-x$ for negative $x$, we get negative $f$.