I know the formal definition of a derivative of a complex valued function, and how to compute it (same as how I would for real-valued functions), but after doing some problems, I feel as if I could just take the partial derivative w.r.t $x$ of the function to compute the derivative (so it doesn't depend on $y$?) as opposed to taking derivative w.r.t $z$ first then substitute. That might be a bit obscure, so I'll put in a couple of examples
Examples
All of the examples are analytic (satisfy the Riemann conditions) with $z = x+iy$ and $f(z) = u(x,y)+iv(x,y)$.
1. $f(z) = z = x+iy =u(x,y) + iv(x,y)$.
The derivative is $f'(z) = 1$. Another way would be just to take partials of $f(z)$ w.r.t $x$ to get the result.
$f(z) = z^2 = (x+iy)^2 = x^2 - y^2 + 2ixy$
$f'(z) = 2z = 2x + 2iy$
Another way is to just directly take partial derivative of $f$ w.r.t $x$ since $\frac{\partial u}{\partial x} = 2x$ and $\frac{\partial v}{\partial x} = 2y$.$f(z) = z^3 = (x+iy)^3 = x^3 - 3xy^2 + i(3x^2 y - y^3)$.
$ f'(z) = 3z^2 = 3x^2 -3y^2 + 6ixy$.
This can also be found similarly in other examples since $\frac{\partial u}{\partial x} = 3x^2 - 6xy$ and $\frac{\partial v}{\partial x} = 6xy$.
So it seems that I could just take the partial derivatives with respect to $x$ of the resultant complex number, and ignore the $y$ to find the derivatives. How come this is true?