Show positivity of a function of two variables in the unit square. Let $$
f(x,y) =  x^3 (1 + y + y^2) + y^2 \Big[x^2  (5 + 2 y) + x  (-6 - 4 y + y^2) +  (1 + 3 y + y^2)\Big] 
$$
Show that $f(x,y) \ge 0 $ for $0\le x \le 1$ and $0\le y \le 1$.
Numerical evaluations seem to support the claim.  This is a cubic function in $x$ with one negative coefficient in the linear term, all other coefficients are positive. Since $f(x=0) > 0$, the last two terms guarantee positivity for  $0 < x < 1/6$. The last three terms show a quadratic function which has its minimum always for $x^* \in [0 \quad 1]$,  namely at $x^* = \frac{6 + 4 y - y^2}{10 + 4 y }$ ; however, for small $y$, the value of the sum of the three last terms is negative at $x^*$. How to continue?
 A: The global minimum of $f$ in the compact set $D=\{(x,y): 0\leq x\leq 1, 0 \leq y \leq 1\}$ will be attained in a stationary point in the interior of $D$ or in a boundary point.
The only stationary point in the interior of $D$ is the point $(0,0)$ and, regarding the boundary,
$$
f(x,0) = x^3 \ge 0, \quad 0\leq x\leq 1$$
$$
f(0,y) = y^2 \left(y^2+3 y+1\right) \ge 0, \quad 0\le y \leq 1
$$
$$
f(x,1) = 3 x^3+7 x^2-9 x+5 \ge 0, \quad 0 \leq x \leq 1
$$
$$
f(1,y)=\left(2 y^2+y\right) y^2+y^2+y+1 \ge 0, \quad 0\leq y \leq 1.
$$
This shows that $f(x,y) \ge 0$ on $D$.
Notes:

*

*It is not trivial to show that $(0,0)$ is the only stationary point in the interior of $D$.

*You still need to solve the one dimensional problems in each portion of the boundary of $D$.

*This way you can also conclude that $f(x,y)\leq 6$ on $D$.

A: We have
\begin{align*}
 f &= (x+1)y^4 + (2x^2 - 4x + 3)y^3 + (x^3 + 5x^2 - 6x + 1)y^2 + x^3y + x^3\\
 &\ge (x+1)y^4 + (2x^2 - 4x + 3)y^4 + (x^3 + 5x^2 - 6x + 1)y^2 + x^3y^2 + x^4 \tag{1}\\
 &= (2x^2 - 3x + 4)y^4 + (2x^3 + 5x^2 - 6x + 1)y^2 + x^4\\
 &\ge (2-x)^2 y^4 + (2x^3 + 5x^2 - 6x + 1)y^2 + x^4\tag{2}\\
 &\ge 2\sqrt{(2-x)^2y^4\cdot x^4} + (2x^3 + 5x^2 - 6x + 1)y^2\tag{3}\\
 &= y^2(3x-1)^2\\
 &\ge 0.
\end{align*}
Explanations:
(1): $(2x^2 - 4x + 3)y^3 \ge (2x^2 - 4x + 3)y^4$ and $x^3y \ge x^3y^2$ and $x^3 \ge x^4$.
(2): $2x^2-3x+4 \ge (2-x)^2$.
(3): AM-GM.
