How do i write the analytic function $f(z)$ in terms of $z$? I have an entire function, consider the function :

$f(z)= (3x^2 + 2x - 3y^2 - 1) + i(6xy + 2y)$
I want to write $f(z)$ in terms of $z$.
 A: If you have already checked that function is indeed entire (e.g. using Cauchy-Riemann's equations), there is a clever trick finding $f$ as a function of $z$.
Take your expression, put $y=0$ and substitute $z$ for $x$. You will get
$$
f(z) = 3z^2 + 2z - 1.
$$
Why does this work? Let $g(z) = 3z^2 + 2z - 1$. Then $f$ and $g$ coincide on the the real axis (by construction) and $g$ is clearly entire. Thus, by the identity theorem for holomorphic functions, $f = g$ everywhere.
This method gives much shorter computations than substituting $x$ and $y$ by expressions in $z$ and $\bar z$, especially when the function is a little more complicated.
A: $z^2 =  x^2 - y^2 + i 2xy\\
f(z) - 3z^2 = 2x -1 + i 2y\\
f(z) - 3z^2 - 2z = -1\\
f(z) = 3z^2 + 2z - 1$
A: If you have a polynomial in $x$ and $y$ that you want to write in terms of $z$, one thing you could do is substitute $x=(z+\overline z)/2$, $y=(z-\overline z)/2i$ and multiply everything out. If the thing is analytic in the first place all the $\overline z$'s should drop out.
For example
$$x^2-y^2++2ixy=\left(\frac{z+\overline z}{2}\right)^2
-\left(\frac{z-\overline z}{2i}\right)^2+2i\left(\frac{z+\overline z}{2}\right)\left(\frac{z-\overline z}{2i}\right)=\dots=z^2.$$
A: Let  $$f(z)= (3x^2 + 2x - 3y^2 - 1) + i(6xy + 2y)=u(x,y)+iv(x, y).$$
Then $$f'(z)=u_x+iv_x=6x+2+i6y =6(x+iy)+2=6z+2).$$
Now integrating w.r.t. z we get
$$f(z)=3z^2+2z+c.$$
You can find the value of $c$ to this particular problem! 
