I have tried to find the max value of $xyz^2$ if $ x+y+z=2 $ using variation of $f(x,y,z)$, but I don't know how I can calculate the derivative of a function of three variable. If my idea is correct, then I want to ask if there is any simple way to do that.
Note: $x$, $y$, $z$ are real.
By AM-GM inequality twice: $xy \le \dfrac{(x+y)^2}{4} \implies xyz^2 \le \dfrac{(x+y)^2z^2}{4}= \dfrac{(2-z)^2z^2}{4} \le \dfrac{1}{4}\cdot \left(\dfrac{2^2}{4}\right)^2 = \dfrac{1}{4}$, and this is the max value you sought. It occurs at $z = 1, x = y = \dfrac{1}{2}$.