# Why can we take integrals to find derivatives, and (kind of) vice-versa with complex functions?

There is kind of a heuristic thing about complex analysis I have been wondering. I've noticed that you have the Cauchy integral formula, where you can take an integral to find a $k^{th}$ derivative. I've recently learned that you can use residues, which are basically found by taking derivatives, to calculate integrals. Is there something inherent to the nature of complex functions/sequences of numbers that leads to this seemingly strange result?

To condense the question a bit, why is it that we do not have something like CIF with functions $\mathbb{R}^n \Rightarrow \mathbb{R}^n$ to get derivatives from integrals? Or do we, and I just haven't learned the requisite math?

Edit 1: And would this have anything to do with a generalized version of Cauchy-Riemann equations?

Derivatives are a local thing, while integrals are a global thing. When you compute the derivative of a function at a point, you only need information about that function in an arbitrarily small neighborhood of that point. When you compute the integral of a function over a region, you need information about the function at every point in that region.

What makes analytic functions special is that their local behavior determines their global behavior. Statements like the Cauchy integral formula make this statement precise, as do statements like the identity principle.

Look at this decomposition of a scalar field in 3D space:

$$\phi(r) = \oint_{\partial V} G(r-r') \cdot \hat n |dS'| \phi(r') + \int_V G(r-r') \; |dV'| \; \nabla' \phi(r')$$

where $G(r) = (r-r')/4\pi|r-r'|^3$ is a Green's function. Note that when $\nabla \phi = 0$ on the volume, the value of the function at a point is determined entirely by the values of the function on the boundary.

Sound familiar? It should. The residue theorem is just a special case of this basic concept. Complex analysis gets it backwards compared to vector calculus, where to be determined completely by boundary values, a field must have zero gradient (or both zero curl and divergence) rather than being complex differentiable, but the concepts are the same. The analogues of complex analytic functions are those whose vector derivatives (whether they be gradients, divergences, or curls--or their analogues in higher dimensions) are zero, so that the volume term on the RHS vanishes, and the function is entirely determined by its boundary values.

You asked about the Cauchy-Riemann condition. It can be shown that the generalized condition is one that ensures vector fields have no divergence or curl.

In short, the residue theorem does have generalizations to real vector spaces, just in guises that may be harder to recognize, as vector calculus is actually quite a bit more general--in terms of the kinds of functions it considers--than complex analysis. Vector fields with arbitrary sources are common, while holomorphic functions are essentially ones with no divergence or curl, and meromorphic ones are analogous to vector fields generated by only point sources.