Without pain, without sacrifice, we would have nothing, Fight Club.

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$.
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$.

Deformation of Contours. If two contours $\gamma_1$ and $\gamma_2 $ are homotopic (i.e., one can be continuously deformed into the other without crossing any singularities of f) in a domain where f(z) is analytic, then: $\int_{\gamma_1} f(z)dz = \int_{\gamma_2} f(z)dz.$
Fundamental Theorem of Calculus for Contours. Suppose $\gamma$ is a contour (piecewise smooth path) from a to b, f is defined on a domain D containing $\gamma^*$ (the image of $\gamma$) and admits a primitive (antiderivative) F on D (i.e., $F'(z) = f(z)$), then $\int_{\gamma} f(z)dz = F(\gamma(b)) - F(\gamma(a))$. In particular, if $\gamma$ is a closed contour (i.e., $\gamma(a)=\gamma(b)$), this integral evaluates to zero, $\int_{\gamma} f(z)dz = 0.$
Estimation Theorem or the Triangle Inequality for Integrals. The triangle inequality for integrals in complex analysis states thatfor any continuous complex function $f:[a,b] \to \mathbb{C}$ on a closed real interval [a,b] (f(t) = u(t) + iv(t), t a real parameter), the following holds: $∣\int_a^b f(t)dt| \leq \int_a^b |f(t)|dt$.
Estimation Lemma (ML Inequality) for contour integrals. For any continuous complex function $f:[a,b] \to \mathbb{C}$ on a closed real interval [a,b] (f(z) = u(x, y) + iv(x, y)) with f bounded by some constant M along the entire contour, |f(z)| ≤ M for all $z \in \gamma^*$ (the image/trace of the contour in the complex plane), the following holds: $∣\int_\gamma f(z)dz| \leq M \cdot l(\gamma)$ where l(γ) is the arc length of the contour γ given by $\int_a^b |\gamma^{'}(t)|dt = \int_a^b \sqrt{x'(t)^2 + y'(t)^2} \text{ where } \gamma(t) = x(t) + iy(t)$.
Jordan’s curve theorem. Any simple closed curve (a continuous loop in the plane that does not intersect itself) separates the plane into two disjoint connected regions: one interior (bounded) and one exterior (unbounded). The curve itself is the boundary of both regions. In other words, it partitions the plane into exactly three disjoint sets:
Cauchy’s theorem (Classical “Green’s theorem” version). Let $\Omega \subset \mathbb{C}$ be an open domain. Suppose f = u + iv is analytic in $\Omega$ and its partial derivatives ( $u_x,u_y,v_x,v_y$) are continuous in $\Omega$. If $\gamma$ is a positively oriented, piecewise-smooth $C^1$, simple closed contour with $\gamma^* \cup \operatorname{Int}(\gamma) \subset \Omega$ (its path and interior both lie inside Ω), then $\oint_{\gamma} f(z)dz = 0.$
Cauchy’s Theorem (Cauchy–Goursat). This is the more powerful version, as it removes the need for continuous partial derivatives. If f is analytic in an open set containing a simple closed contour γ and its interior $\gamma^*\cup\operatorname{Int}(\gamma)$, then $\oint_{\gamma} f(z)dz = 0$.
Similarly, Let T be a triangular region. Let f be analytic on an open set that contains T (so f is analytic on and in a neighborhood of T). Then, the positively oriented boundary (∂T) contour integral of f vanishes, $\int_{\partial T}f(z)dz = 0$.
There are several forms of Cauchy’s theorem. If C is a closed polygonal contour lying entirely within a simply connected domain D, f is a complex function analytic in D, then $\int_{\partial C}f(z)dz = 0$.
Cauchy’s Theorem for Rectifiable (the curve can be approximated by polygons whose lengths converge its length) Jordan Curves (simple, closed, and of a finite length) Jordan curves . Let Γ be a rectifiable Jordan curve and let f be analytic on an open set Ω containing Γ ∪ Int(Γ). Then, $\oint_{\Gamma} f(z)dz = 0.$
Cauchy–Goursat theorem. Let γ be a simple closed contour (piecewise smooth, rectifiable Jordan curve) and let f be analytic on an open set Ω containing γ and its interior $\gamma^*\cup\operatorname{Int}(\gamma)$. Then, $\oint_{\gamma} f(z)dz = 0$..
Proof.
Proof 1. A simple closed contour γ is a rectifiable Jordan curve (since it’s piecewise smooth and has finite length). The earlier theorem states: If f is analytic on an open set containing a rectifiable Jordan curve Γ and its interior, then $\oint_{\Gamma} f(z)dz = 0.$
Since γ is a rectifiable Jordan curve and f is analytic on an open set containing γ ∪ Int(γ), the conditions are satisfied. Therefore, $\oint_γ f(z)dz = 0.$
Proof 2. The core idea of this proof is to show that a “complicated” integral over a smooth, curvy path $\gamma$ can be replaced by a “simple” integral over a polygon $P$ without changing the value.
Consider a simple closed contour γ and choose n points $z_1, z_2, \cdots z_n$ on γ arranged in positive orientation. Construct a simple polygon P by connecting consecutive points with straight line segments. Ensure the partition is sufficiently fine so that:
We compare the integrals along γ and P (The total integral is just the sum of the integrals over these small pieces): $|\oint_γ f(z)dz - \oint_P f(z)dz| \le |\sum_{i=1}^n |\oint_{γ_i} f(z)dz - \oint_{P_i} f(z)dz|$ where γᵢ is the small arc from zᵢ to zᵢ₊₁ and Pᵢ is the straight chord (a line segment) from zᵢ to zᵢ₊₁.
Our new, simpler goal is to show that the difference on just one small piece, $\left| \int_{\gamma_i} f(z)dz - \int_{P_i} f(z)dz \right|$, is extremely small.
Parameterize γᵢ by z(t) and Pᵢ by w(t) = zᵢ + t(zᵢ₊₁ - zᵢ) for t ∈ [0,1]. Since f is analytic on Ω which means it is continuous on the compact (closed and bounded) set containing $\gamma$ and its interior, it is uniformly continuous. For any ε > 0, choose δ such that |f(z) - f(w)| < ε when |z - w| < δ. This is a powerful tool. It means we can “tame” the function $f(z)$ over the entire curve at once. Refine the partition so that every single arc length Lᵢ < δ and chord length |zᵢ₊₁ - zᵢ| < δ.
For each segment: $|\oint_{γ_i} f(z)dz - \oint_{P_i} f(z)dz| = |\int_0^1 [f(z(t))z^′(t)−f(w(t))(z_{i+1}−z_i )]dt|$
Add and subtract $f(z(t))(z_{i+1}-z_i), $
$= |\int_0^1 f(z(t))[z^′(t) - (z_{i+1}-z_i)dt] + \int_0^1 [f(z(t)) −f(w(t))](z_{i+1}−z_i )dt|$
First term.
$|\int_0^1 f(z(t))[z^′(t) - (z_{i+1}-z_i)dt] =[\text{ Since } \int_0^1 z^′(t)dt = z_{i+1} - zᵢ] |\int_0^1 [f(z(t)) - f(z_i)] [z^′(t) - (z_{i+1}-z_i)]dt|$
Let Mᵢ = max|f(z(t)) - f(zᵢ)|. Then: First term ≤ $M_i(\int_0^1 |z^′(t)|dt + |z_{i+1}-z_i|dt) ≤ M_i(L_i + L_i)= 2M_i L_i$
z(t) traces the arc γᵢ from zᵢ to zᵢ₊₁. Mᵢ measures how much f deviates from its value at the starting point along the entire arc. Why this maximum exist? The arc γᵢ is compact (closed and bounded). f is continuous (since analytic). A continuous function on a compact set attains its maximum
Second term: $|\int_0^1 [f(z(t)) −f(w(t))](z_{i+1}−z_i )dt| \le N_i|z_{i+1}-z_i| \le N_iL_i$ where Nᵢ = max|f(z(t)) - f(w(t))|
z(t) is on the arc γᵢ. w(t) is on the chord Pᵢ (straight line segment). Both are parameterized by the same t ∈ [0, 1]. Nᵢ measures the maximum difference between f on the arc and f on the chord. Why this maximum exists: The set {(z(t), w(t)) : t ∈ [0,1]} is compact. The function (z, w) ↦ |f(z) - f(w)| is continuous. Therefore, the maximum is attain. Intuitively, the arc and chord are very close (both within the $\delta$-neighborhood), therefore $z(t)$ and $w(t)$ are closer than $\delta$. By uniform continuity, $N_i = \max|f(z(t)) - f(w(t))| < \epsilon$.
f is analytic on Ω, hence continuous. The set γ ∪ Int(γ) is compact. A continuous function on a compact set is uniformly continuous. Therefore, ∀ε > 0, ∃δ > 0 such that: ∣z − w∣ < δ ⇒ ∣f(z) − f(w)∣ < ε.
For sufficiently fine partition: The entire arc γᵢ lies within a δ-ball around zᵢ ⇒ Mᵢ < ε. The distance between z(t) and w(t) < δ for all t ⇒ Nᵢ < ε.
$|\text{Difference}_i| \le |\text{Term 1}| + |\text{Term 2}| < 2\epsilon L_i + \epsilon L_i = 3\epsilon L_i$ So, for each piece i, the error is bounded by $3\epsilon$ times its length.
Thus, each segment difference < 3εLᵢ. Summing over all segments: $|\oint_γ f(z)dz - \oint_P f(z)dz| \le \sum_{i=1}^{n} |\text{Difference}_i| \lt [\text{ Now, substitute the bound we just found for each piece: }] \sum_{i=1}^{n} (3\epsilon L_i)$
$=[\text{We can pull the constant $3\epsilon$ out of the sum } ] 3\varepsilon \sum_{i=1}^{n} L_i = 3\varepsilon L$. We have shown that the difference between the curve integral and the polygon integral is less than $3\epsilon L$. Since L is a fixed number (the length of the curve) and ε is arbitrary (we can make the difference smaller than any positive number), the difference approaches 0 as the partition refines n → ∞.
Note: What is $\sum L_i$? It’s the sum of all the little arc lengths, which is just the total length of the original curve $\gamma$, L.
Polygonal Cauchy Theorem. For any simple polygon P, if f is analytic on P ∪ Int(P), then $\oint_P f(z)dz = 0$. By the approximation, $\oint_γ f(z)dz = lim_{n \to \infty} \oint_{P_n} f(z)dz = \lim_{n \to \infty} 0 = 0.$
Then it can be shown that the difference $|\oint_{\Gamma} f(z)dz -\oint_P f(z)dz|$ can be made arbitrarily small as n. Thus, by the previous result, $\oint_P f(z)dz = 0$ for any n. Therefore, $\oint_{\Gamma} f(z)dz = 0.$
Why this holds? For multiply connected regions with analytic functions, the generalized Cauchy theorem states $\oint_{C} f(z)dz + \sum_{k}\oint_{C_k}^{\text{(CW)}} f(z)dz= 0$.
For our annulus with one outer boundary (∣z∣ = r₂) and one inner boundary (∣z∣ = r₁): $\oint_{|z|=r_2} f + \oint_{|z|=r_1}^{\text{(CW)}} f(z)dz = 0 \rightarrow[\text{Since clockwise (CW) integration is the negative of CCW integration:}] \oint_{|z|=r_2} f(z)dz = \oint_{|z|=r_1} f(z)dz.$
Example 1: f(z)= $z^3$ (entire), take C: |z| = 2, and $C_1$: |z| =1. The region R = {z ∈ ℂ: 1 < ∣z∣ < 2} is an annulus. Then, $\oint_{|z|=2} z^3 dz =\oint_{|z|=1} z^3dz=0$. The identity holds trivially, and also illustrates deformation (you can slide the outer loop to the inner one through the analytic annulus).
Example 2: $f(z) = \frac{1}{z}$. The region R = {z ∈ ℂ: 1 < ∣z∣ < 2} is an annulus. The closure, $\overline{R}$ = {z : 1 ≤ ∣z∣ ≤ 2} is contained in the open set U = {z: 0.5 < ∣z∣ < 2.5} where f is analytic (since $0 \notin U$). By the theorem, $\oint_{|z|=2} \frac{1}{z} dz =\oint_{|z|=1} \frac{1}{z}dz = 2\pi i$.
Example 3. Let $f(z)=\dfrac{1}{z-a}$, with a lying strictly inside $C_1$ but outside all other holes and not on C. Then, $\oint_C f(z)dz = \sum_{k=1}^n \oint_{C_k} f(z)dz = \oint_{C_1} \frac{dz}{z-a} = 2\pi i.$