# Can we differentiate complex functions as if they were real?

I am taking a first course on complex analysis and I am wondering whether we can differentiate complex functions as if they were real.

Most of the functions I have come across i.e. $\cos z, \sin z, \cosh z$ etc. follow the same rules of derivation as their real counterparts.

Are there certain conditions that allow me to make this assumption?

Yes, the differentiation formulas for analytic functions are the same as their real versions. That is, if $f$ and $g$ are analytic functions on some domain $D$ whose intersection $D \cap \mathbb R$ with the real line contains an interval, and $f'(x) = g(x)$ for $x \in D \cap \mathbb R$, then by analytic continuation $f'(z) = g(z)$ for all $z \in D$.
If you actually have a function only containing $z$ and not something like $f(u+iv)=u^2+iv^2$, you can apply all rules that work in the reals.
Complex functions that can be differentiated as if $z$ is real must satisfy Cauchy-Riemann equations. That way they are said to be complex differentiable.