Where did I go wrong in finding maximum? The question in my book is given as:

If $x^2+y^2+z^2=1$ for $x,y,z$ belongs to all real numbers ($x,y,z$ are independent), then find the maximum of $x^3+y^3+z^3-3xyz$.

What I tried:
As all variables are independent I took the derivative of first equation and I got $x+y+z=0$. 
Then for maximum of second equation I took the derivative and equated to zero 
$$3x^2+3y^2+3z^2-3(xy+yz+zx)=0$$
and now for maximum
$$xy+yz+zx=1$$
(this is because $x^2+y^2+z^2=1$)
We know that $(x+y+z)^3=x^3+y^3+z^3+3[(x+y+z)(xy+yz+zx)]-3xyz$ and here left hand side is zero since $x+y+z=0$ so we get
$x^3+y^3+z^3-3xyz=0$ but this is wrong!
I think I made error by taking the derivative of $x^2+y^2+z^2$ but i don't know why it is wrong.
Any help will be appreciated!

I'm not sure why you are taking derivatives of $x^2+y^2+z^2=1$ and setting them to zeroes. $x^2+y^2+z^2=1$ is your constraint, and $x^3+y^3+z^3-3xyz$ is your function.
For this problem you can use Lagrange Multipliers.
Set $g(x)=x^2+y^2+z^2$ and $f(x)=x^3+y^3+z^3-3xyz$
$g_x=2x$  $f_x=3x^2-3yz$
$g_y=2y$  $f_y=3y^2-3xz$
$g_z=2z$  $f_z=3z^2-3xy$
$$<f_x,f_y,f_z>=\lambda<g_x,g_y,g_z>$$
$$3x^2-3yz=\lambda(2x)$$
$$3y^2-3xz=\lambda(2y)$$
$$3z^2-3zy=\lambda(2z)$$
$$\lambda=\frac{3x^2-3yz}{2x}=\frac{3y^2-3xz}{2y}=\frac{3z^2-3zy}{2z}$$
Along with the condition $x^2+y^2+z^2=1$, after calculations we can get $x=\pm\frac{\sqrt3}{3}$, $y=\pm\frac{\sqrt3}{3}$, $z=\pm\frac{\sqrt3}{3}$ 
So in order to get the maximum value of $x^3+y^3+z^3-3xyz$, x,y,z must all be positive numbers, so $x=y=z=\frac{\sqrt3}{3}$
Plug it into the function and find the answer.
