It ain’t about how hard you can hit. Its about how hard you can get hit, and how much you can take, and keep moving forward, Rocky Balboa

A complex function $f(z)$ maps $z = x + iy \in \mathbb{C}$ to another complex number. For example: $f(z) = z^2 = (x + iy)^2 = x^2 - y^2 + 2ixy, f(z) = \frac{1}{z}, f(z) = \sqrt{z^2 + 7}$.
A contour is a continuous, piecewise-smooth curve defined parametrically as: $z(t) = x(t) + iy(t), \quad a \leq t \leq b$. Examples of contours:
Definition (Smooth Contour Integral). Let ᵞ be a smooth contour (a continuously differentiable path in the complex plane), $\gamma: [a, b] \to \mathbb{C}$. Let $f: \gamma^* \to \mathbb{C}$ be a continuous complex-valued function defined on the trace $\gamma^*$ of the contour (i.e. along the image of $\gamma$). Then, the contour integral of f along $\gamma$ is defined as $\int_{\gamma} f(z)dz := \int_{a}^{b} f(\gamma(t)) \gamma^{'}(t)dt$.
In this definition, we integrate the function f along the path traced out by $\gamma(t)$. The term $\gamma^{'}(t)$ (the derivative of $\gamma$) accounts for the direction and speed of traversal along the path. This definition essentially transforms or converts the complex line integral into a regular real integral over the interval [a, b] via the parametrization $\gamma(t)$. The factor $\gamma'(t)dt = d\gamma$ represents an infinitesimal step along the curve, so $f(\gamma(t))\gamma'(t)dt$ is the infinitesimal contribution to the integral from that step.
Theorem. Cauchy Integral Formula. If a function f is analytic in a simply connected domain D and γ is a simply closed contour (positive orientated) in D. Then, for any point $z_0$ inside γ we have $f(z_0) = \frac{1}{2\pi i}\cdot \int_{\gamma} \frac{f(z)}{z-z_0}dz$ (Figure D).

It states that the value of an analytic function at any point z₀ is completely determined by the values the function takes on any simple closed curve that encircles the point. If you know the function’s values on the boundary, you know everything about the function’s behavior inside that boundary. This is quite unlike anything you’ve probably encountered with functions of real variables.
A more generalized version is as follows: $f^{(n)}(z_0) = \frac{n!}{2\pi i}\cdot \int_{\gamma} \frac{f(z)}{(z-z_0)^{(n+1)}}dz$.
Cauchy Integral Formula (Winding Number Lemma). Let γ be a closed rectifiable curve in ℂ, f analytic on an open set containing γ and its interior. For any point a not on γ, the Cauchy Integral Formula states: $\oint_{\gamma} \frac{f(z)}{z-a}dz = 2\pi i \cdot n(\gamma, a) \cdot f(a)$
The winding number is defined as $n(γ, a) = \frac{1}{2πi}\oint_\gamma \frac{dz}{z-a}$. This represents the net number of times γ winds around a counterclockwise.
For simple closed curves with positive orientation n(γ, a) = 1 if a is inside γ, 0 if outside.
For multiple windings n(γ, a) counts the net winding (e.g., 2 for two counterclockwise loops, -1 for one clockwise loop).
The formula reduces to the basic Cauchy Integral Formula when n(γ, a) = 1.
The formula can be used to calculate integrals: $\int_{\gamma} \frac{f(z)}{z-z_0}dz = 2\pi i \cdot f(z_0), \int_{\gamma} \frac{f(z)}{(z-z_0)^{(n+1)}}dz = \frac{2\pi i}{n!} \cdot f^{(n)}(z_0)$
Key Conditions:
Analyticity: $ f(z) $ must be analytic (holomorphic) inside and on $\gamma$.
Contour $ C $: $\gamma$ is a simple closed curve (e.g., a circle, ellipse). A simple closed curve is a curve that has no self-intersections and is closed, meaning it starts and ends at the same point.
Point $z_0$: $z_0$ must lie inside $\gamma$. If $z_0$ is outside $\gamma$, the integral is zero.
Morera’s theorem: The Converse of Cauchy’s Theorem. Suppose that f is a continuous function on an open set G.. If the contour integral of f is zero for every closed contour $\gamma$ in G, i.e., $\oint_\gamma f(z)dz = 0$. Then, f is analytic in G.
Morera’s Theorem is the converse of Cauchy’s (or Cauchy-Goursat) Theorem. Cauchy’s Theorem states that if f is analytic, any closed contour integral having f as an integrand is zero. In other words, analyticity implies vanishing contour integrals. Morera’s Theorem states that if all contour integrals vanish and the function is continuous, then the function must be analytic.
Proof.
Let $a \in G$ be an arbitrary element in G. Since G is open, there exists a radius r such that $\overline{B(a; r)} \subseteq G$.
By the antiderivative theorem, since $\oint_\gamma f(z)dz = 0$ for every closed contour $\gamma$ in G, f has an antiderivative function, i.e., there exists a function F defined in G and analytic (the definition of F’(z) = f(z) means that F is complex differentiable (analytic) at every point in G) at every point in G such that F’(z) = f(z).
The Antiderivative Theorem (Path Independence) states that a continuous function f in a domain G has an antiderivative F in G (meaning F’(z) = f(z)) if and only if the integral of f is path-independent in G (which is equivalent to $\oint_{\gamma} f(z)dz = 0$ for every closed contour $\gamma$ in G).
Since f is the derivative of an analytic function F, by Analyticity Implies Infinite Differentiability, (i) [Suppose that f is analytic (or holomorphic) in an open set G. Then, (i) f' is also analytic in G; (ii) f has derivatives of all orders ($f', f'', f''', \dots$) in G] f is also analytic (the roles of f and F are reversed compared to typical applications, F is analytic in G ⇒ the derivative of F, which is F’(z) = f(z), must also be analytic in G).
Gauss’s mean value theorem. If f(z) is analytic on and inside a circle $\gamma$ with center $z_0$ and radius R, $\gamma(z_0; R)$. Then, $f(z_0) = \frac{1}{2\pi}\int_0^{2\pi}f(z_0+Re^{i\theta})d\theta$
This theorem states that $f(z_0)$ is precisely the average value of $f(z)$ on the circle $\gamma$.
Proof
We begin with the Cauchy Integral Formula, which is the source and core of this theorem. It tells us the value of an analytic function at a point $z_0$ based on its values on a contour $\gamma$ enclosing it, equals:
$$\begin{aligned} f(z_0) &=\frac{1}{2\pi i}\int_{\gamma(z_0; R)} \frac{f(w)}{w-z_0}dw \\[2pt] &\text{Parametrize the Contour} \gamma(z_0; R): w = z_0 + Re^{i\theta}, 0 \le \theta \le 2\pi \leadsto dw = iRe^{i\theta}d\theta \\[2pt] &= \frac{1}{2\pi i}\int_0^{2\pi} \frac{f(z_0 + Re^{i\theta})}{Re^{i\theta}}iRe^{i\theta}d\theta \\[2pt] &\text{This looks complex, but it simplifies beautifully.} \\[2pt] &=\frac{1}{2\pi}\int_0^{2\pi}f(z_0 + Re^{i\theta})d\theta \end{aligned} $$Solution. The core idea is to find a contour, so that the n-th derivative of our function at zero can be bounded appropriately.
Consider the contour $\gamma$ is a circle centered at the origin with radius $1 - \frac{1}{k}$ (a radius that is less than 1), $\forall z \in \gamma, |z| = 1 - \frac{1}{k} \leadsto |f(z)| \le \frac{1}{1-|z|} = \frac{1}{1-(1-\frac{1}{k})} = k$.
By the Cauchy Integral Formula for Derivatives (the order is n, the singularity is zero). It connects the n-th derivative at a point “a” (a = 0) to an integral around that point $f^{(n)}(a) = \frac{n!}{2\pi i} \oint_{\gamma} \frac{f(z)}{(z-a)^{n+1}}dz, f^{(n)}(0) = \frac{n!}{2\pi i} \oint_{\gamma} \frac{f(z)}{z^{n+1}}dz$
By the ML-Inequality (Estimation Lemma), which bounds the magnitude of an integral: $|\oint_{\gamma} g(z) dz| \le M \cdot L$, where L is the path length and M is the max value of $|g(z)|$ on the path, $|f^{(n)}(0)| \le \frac{n!}{2\pi} \oint_{\gamma} \frac{|f(z)|}{|z^{n+1}|}|dz| \le \frac{n!}{2\pi} \oint_{\gamma} \frac{k}{(1-\frac{1}{k})^{n+1|}}|dz|$
Parametrize $\gamma, z = re^{i\theta}, r = 1-\frac{1}{k}, 0 \le \theta \le 2\pi$. Then, $dz = rie^{i\theta}d\theta, |dz| = r|d\theta| = (1-\frac{1}{k})d\theta$
Therefore, $|f^{(n)}(0)| \le \frac{n!}{2\pi}\int_0^{2\pi} \frac{k}{(1-\frac{1}{k})^{n+1|}}(1-\frac{1}{k})d\theta = \frac{n!}{2\pi}\int_0^{2\pi} \frac{k}{(1-\frac{1}{k})^n}d\theta = \frac{n!}{2\pi}\int_0^{2\pi} \frac{k^{n+1}}{(k-1)^n}d\theta = \frac{n!}{2\pi}\int_0^{2\pi} (\frac{k}{k-1})^n k d\theta$
We have an inequality that depends on k. To get the tightest possible bound, we need to choose the value of k that minimizes and simplifies this expression. Let’s make the choice: k = n + 1.
$|f^{(n)}(0)| \le \frac{(n+1)!}{2\pi}\int_0^{2\pi} (\frac{n + 1}{n})^n d\theta = \frac{(n+1)!}{2\pi}(1+\frac{1}{n})^n \int_0^{2\pi}d\theta = \frac{(n+1)!}{2\pi}(1+\frac{1}{n})^n 2\pi = (n+1)!(1+\frac{1}{n})^n$
It is a well-know result that $(1+\frac{1}{n})^n$ is an increasing sequence of real number whose limit as $n \to \infty$ is e. Because the sequence increases towards $e$, it is true for all $n \ge 1$ that: $\left( 1 + \frac{1}{n} \right)^n \le e$. Substituting this into our inequality gives the final answer: $|f^{(n)}(0)| \le (n+1)!e$.