Find an analytical function if initial value and the imaginary part is given. So I must find $f(z) = u(x,y) + v(x,y), \ \ f(0)=1$ if $v(x,y) = 2x^3 - 6xy^2-4xy+2x$
$$\frac{\partial v}{\partial x} = 6x^2-6y^2-4y +2 \\ \frac{\partial v}{ \partial y} = -12xy -4x \\ f'(z) = -12xy-4x + i(6x^2-6y^2-4y+2) \\ \int-4z+i(6z^2+2) dz = -2z^2+i(2z^3+2z) + C \Rightarrow \\ f(0) = 1 \Rightarrow C =1 \\ f(z) = (-2x^2+3x^2y-2y^2) +i(-4xy+x^3+xy^2) $$ 
It is visible that the imaginary part is not equal to the given $v(x,y)$ function. Where is my mistake?

You got the right answer: $f(z)$ is $-2z^2+2iz^3+2iz+1$ indeed. And\begin{multline}2(x+yi)^2+2i(x+yi)^3+2i(x+yi)+1=\\=-6 x^2 y-2 x^2+2 y^3+2 y^2-2 y+1+i(2x^3-6xy^2-4xy+2x).\end{multline}So, again, yes, you got the right answer.
