# complex function

I must rewrite the function $f$ in the form $f(z)=u(x,y)+iv(x,y)$ where $f(z)=z^3+z-1$.
What I did was to write $z$ as $x+iy$ and I found out that $f(z)=\overbrace{x^3-3xy^2+x-1}^{u(x,y)}+i\overbrace{(y-y^3+3x^2y)}^{v(x,y)}$.