Cauchy-Riemann conditions theorem
The Cauchy-Riemann conditions, provide both a necessary and sufficient criterion for analyticity, given regularity of the underlying real and imaginary components.
Let f(z) = u(x, y) + iv(x, y), where u and v are real-valued functions defined on a domain D \subseteq \mathbb{C}. If the first-order partial derivatives \frac{\partial u}{\partial x}, \frac{\partial u}{\partial y}, \frac{\partial v}{\partial x}, \frac{\partial v}{\partial y} exist and are continuous throughout D, then f is analytic in D if and only if the Cauchy-Riemann equations hold everywhere in D:
\begin{aligned} & \frac{\partial u}{\partial x} = \frac{\partial v}{\partial y} \\ & \frac{\partial u}{\partial y} = - \frac{\partial v}{\partial x} \end{aligned}
If f is analytic at a point z_0, its complex derivative:
f^\prime(z)(z_0) = \lim_{\Delta z \to 0} \frac{f(z_0 + \Delta z) - f(z_0)}{\Delta z}
must exist and be independent of the direction in which \Delta z \to 0. Computing this limit along both the real and imaginary axes yields the Cauchy-Riemann conditions as a requirement for analyticity at z_0.
Assuming the Cauchy-Riemann equations hold at z_0 and that the relevant partial derivatives are continuous in a neighborhood of z_0, one can expand u and v using the total differential. This gives:
f(z_0 + \Delta z) - f(z_0) = \left( \frac{\partial u}{\partial x} + i \frac{\partial v}{\partial x} \right) \Delta z + o(\Delta z)
as \Delta z \to 0. Dividing by \Delta z and letting \Delta z \to 0 shows that the complex derivative exists and f is analytic at z_0.
The Cauchy-Riemann conditions, together with the continuity of first-order partial derivatives, provide a complete characterization of analyticity for functions of a complex variable.
For more insights into this topic, you can find the details here.