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$.
To prove the general Cauchy-Goursat theorem, mathematicians start with simple geometric shapes and build up.
Cauchy’s Theorem for a Rectangle. Let R be a rectangle (or triangular T) region R = {x + iy: a ≤ x ≤ b, c ≤ y ≤ d}. Let f be analytic on an open set that contains R (so f is analytic on and in a neighborhood of R). Then, the positively oriented boundary (∂R) contour integral of f vanishes, $\int_{\partial R}f(z)dz = 0$.
Once we believe the rectangle case, we get every simple polygon for free by a tiling or triangulation argument. In other words, If P is a closed polygonal contour lying entirely within a simply connected domain D, f is a complex function analytic in P, then $\int_{\partial P}f(z)dz = 0$ (Figure 5).
Cauchy’s Theorem for Rectifiable (the curve can be approximated by polygons whose lengths converge to its length) Jordan Curves (simple, closed, and of a finite length). 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 $\gamma$ is piecewise smooth. Being piecewise smooth, it has finite arc length: $L(\gamma) = \int_a^b |\gamma'(t)|\,dt < \infty.$
Therefore, $\gamma$ is a rectifiable Jordan curve. Since $f$ is analytic on an open set containing $\gamma^* \cup \operatorname{Int}(\gamma)$, Version For Rectifiable Jordan Curves applies directly, giving $\oint_\gamma f(z)\,dz = 0.$ $\blacksquare$
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 an inscribed polygon $P$ without changing the value, by taking the limit of increasingly fine partitions.
Step 1 — Constructing the polygon. Consider a simple closed contour γ and choose n points $z_1, z_2, \cdots z_n$ on γ arranged in positive orientation. Construct a simple inscribed polygon P by connecting consecutive points $z_i \to z_{i+1}$ with straight line segments (indices modulo $n$). Ensure the partition is sufficiently fine so that:
These conditions can always be met because $\gamma$ is simple (preventing self-intersections for fine partitions) and $\Omega$ is open (providing a “safe tubular room” for straight chords to exist without leaving the domain of analyticity).
Step 2 — Comparing integrals piece by piece. Split the contour into arcs and chords, and compare the integrals along γ and P (the total integral is just the sum of the integrals over these small pieces) $\left|\oint_\gamma f(z)\,dz - \oint_P f(z)\,dz\right| \le \sum_{i=1}^{n} \left|\int_{\gamma_i} f(z)\,dz - \int_{P_i} f(z)\,dz\right|$ where $\gamma_i$ is the small arc from $z_i$ to $z_{i+1}$ along $\gamma$, and $P_i$ is the straight chord from $z_i$ to $z_{i+1}$.
Step 3 — Bounding the Error on a Single Segment. 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 the $i$-th arc as $z(t)$ and the $i$-th chord as $w(t) = z_i + t(z_{i+1} - z_i)$, both for $t \in [0, 1]$. Then, $\Delta_i := \int_{\gamma_i} f\,dz - \int_{P_i} f\,dz = \int_0^1 \left[f(z(t))\,z'(t) - f(w(t))(z_{i+1} - z_i)\right] dt.$
The Arc ($\gamma_i$). We have an arbitrary smooth curve from $z_i$ to $z_{i+1}$. Derivative (tangent vector): $z'(t)$. The integral becomes: $\int_{\gamma_i} f(z) dz = \int_0^1 f(z(t)) z'(t) dt$. The Straight Chord ($P_i$): We need a straight line starting at $z_i$ and ending at $z_{i+1}$. The standard linear interpolation formula for this is $w(t) = z_i + t(z_{i+1} - z_i)$ for $t \in [0,1]$. Check the bounds: At $t=0$, $w(0) = z_i$. At $t=1$, $w(1) = z_{i+1}$. What is the derivative $w'(t)$ with respect to $t$? Since $z_i$ and $z_{i+1}$ are just constant complex numbers, the derivative is simply the constant vector pointing from start to finish: $w'(t) = z_{i+1} - z_i$ The integral becomes: $\int_{P_i} f(z) dz = \int_0^1 f(w(t)) \underbrace{(z_{i+1} - z_i)}_{w'(t)} dt$
Now apply the add-and-subtract trick: insert $\pm\, f(z(t))(z_{i+1} - z_i)$ inside the integrand to split the difference into two terms with clear geometric meaning:
$$\Delta_i = \underbrace{\int_0^1 f(z(t))\bigl[z'(t) - (z_{i+1} - z_i)\bigr]\,dt}_{\text{Term I: geometric error}} + \underbrace{\int_0^1 \bigl[f(z(t)) - f(w(t))\bigr](z_{i+1} - z_i)\,dt}_{\text{Term II: function error}}$$Term I captures the error from replacing the curved tangent vector $z'(t)$ with the constant chord vector $z_{i+1} - z_i$. Term II captures the error from evaluating $f$ on the arc versus on the chord.
To bound these terms, we use uniform continuity. Since $f$ is analytic on $\Omega$, it is continuous. The set $\gamma \cup \operatorname{Int}(\gamma)$ is compact (closed and bounded). A continuous function on a compact set is uniformly continuous. Therefore, for any arbitrary $\varepsilon > 0$, there exists a $\delta > 0$ such that $|z - w| < \delta \implies |f(z) - f(w)| < \varepsilon$ ($\star$).
We refine our partition so that every single arc length $L_i < \delta$.
Bounding Term I. The crucial observation is that the “weight” $z'(t) - (z_{i+1} - z_i)$ integrates to zero:
$$\int_0^1 \bigl[z'(t) - (z_{i+1} - z_i)\bigr]\,dt = \bigl[z(1) - z(0)\bigr] - (z_{i+1} - z_i) = 0.$$This means we can subtract any constant from $f(z(t))$ without changing the integral. Subtracting $f(z_i)$: $\text{Term I} = \int_0^1 \bigl[f(z(t)) - f(z_i)\bigr]\bigl[z'(t) - (z_{i+1} - z_i)\bigr]\,dt.$
Why this helps. The factor $f(z(t)) - f(z_i)$ is small when the arc is short (by continuity of $f$), and the factor $z'(t) - (z_{i+1} - z_i)$ is controlled by the arc length. Subtracting $f(z_i)$ converts a term that could be large into a product of two small quantities.
Because the entire arc length $L_i < \delta$, the distance between $z(t)$ and $z_i$ is always less than $\delta$. By uniform continuity ($\star$), the maximum deviation $M_i = \max |f(z(t)) - f(z_i)| < \varepsilon$.Bounding Term II. (Function Error): Let $N_i = \max_{t \in [0,1]} |f(z(t)) - f(w(t))|$.
Because both the arc $z(t)$ and chord $w(t)$ are trapped inside a region smaller than $\delta$, the distance between them is strictly less than $\delta$.
By uniform continuity, $N_i < \varepsilon$.
Combining the bounds for a single segment: $|\Delta_i| \le |\text{Term I}| + |\text{Term II}| < 2\varepsilon L_i + \varepsilon L_i = 3\varepsilon L_i$
Combining: $|\Delta_i| \le |\text{Term I}| + |\text{Term II}| \le 2M_i L_i + N_i L_i.$
Step 4. Summing the Errors. Now we sum the errors over all $n$ segments of the contour: $\left|\oint_\gamma f(z)dz - \oint_P f(z)dz\right| \le \sum_{i=1}^{n} |\Delta_i| < \sum_{i=1}^{n} 3\varepsilon L_i = 3\varepsilon \sum_{i=1}^{n} L_i$
Notice that $\sum_{i=1}^{n} L_i$ is simply $L$, the total finite arc length of the contour $\gamma$. Therefore, $\left|\oint_\gamma f(z)dz - \oint_P f(z)dz\right| < 3\varepsilon L$.
Step 5 — Conclusion. We have shown that the difference between the curve integral and the polygon integral is strictly less than $3\varepsilon L$.
Since $L$ is a fixed constant and $\varepsilon$ is entirely arbitrary, we can make this difference smaller than any positive number by letting the partition refine ($n \to \infty$). $\oint_\gamma f(z)dz = \lim_{n \to \infty} \oint_{P_n} f(z)dz$. By the Polygonal Cauchy Theorem, if $f$ is analytic on a simple polygon and its interior, the integral is exactly zero. $\oint_\gamma f(z)dz = \lim_{n \to \infty} 0 = 0$
Basic Integral Over a Circle. Consider f(z) = $z^2$, and let C be the circle centered at the origin with radius 1. Since f(z) is entire (holomorphic everywhere), we can apply the Cauchy-Goursat theorem: $\oint_C z^2 dz = 0$.
Polygonal/Jordan curves with analytic f: zero integral. Let $\gamma$ be any rectifiable Jordan curve (e.g., a square with vertices 0, 1, 1+i, i or a smooth “wobbly” circle) and f analytic on a neighborhood of $\gamma^*\cup Int(\gamma)$ (e.g., f(z) = $z², sin(z), cos(z)$, etc.) Then, $\oint_{\gamma} f(z)dz = 0$. Because sin(z) is entire, the shape of the loop is irrelevan $\oint_\gamma \sin (z)dz=0.$
Singularity lies strictly outside the loop. Let $f(z)=\dfrac{1}{z-3}$ and C: |z| = 1.5, a circle of radius 1.5 centered at the origin. The interior $|z| \le 1.5$ does not contain z = 3 (the point lies outside the circle). f is analytic on and inside C, so $\oint_{|z|=1.5}\frac{dz}{z-3}=0.$
Singularity inside the loop. Let $f(z) = 1/z$ and let $C$ be the unit circle $|z| = 1$. Here $f$ is not defined at $z = 0$, which lies inside $C$. The Cauchy–Goursat theorem does not apply. Direct computation (or the Residue Theorem) gives: $\oint_C \frac{dz}{z} = 2\pi i \neq 0.$
Counterexample 1. Singularity inside the loop. Let $f(z) = \frac{1}{z}$, and let C be the unit circle centered at the origin. Here, f(z) is not defined at z = 0, which lies inside C. Thus, the Cauchy-Goursat theorem does not apply directly because the function is not analytic on the entire region enclosed by C. Instead, we use other techniques such as the residue theorem to evaluate: $\oint_C \frac{1}{z} dz = 2\pi i \neq 0$
Counterexample 2. Multiply connected domain. Let D be the annulus D = {1 < ∣z∣ < 2} and let C be the circle C: |z| = 1.5. The function $f(z) = \frac{1}{z}$ is analytic on $D$, but $D$ is multiply connected (it has a hole at z = 0, any loop around the origin, like |z| = 1.5, cannot be contracted to a point without leaving the domain — because the origin is missing), and the integral: $\oint_{|z|=1.5} \frac{1}{z} \, dz = 2\pi i \neq 0$. This shows it shows you must have analyticity on and inside the specific loop. Having $f$ analytic on a domain containing the loop is not enough — you need $f$ analytic on the loop and its interior (or equivalently, the domain must be simply connected, or the loop must not encircle any singularity).
The loop $C$ winds around this hole and cannot be contracted to a point within $D$.
The decisive criterion is whether the singularity lies inside or outside the loop. Let $f(z) = 1/z$ and consider two loops:
$C_1$: the circle $|z - 2| = 0.4$. The interior of $C_1$ is the disk $|z - 2| < 0.4$, which does not contain $z = 0$. So $f$ is analytic on $C_1 \cup \operatorname{Int}(C_1)$, and $\oint_{C_1} \frac{dz}{z} = 0.$
$C_2$: the circle $|z| = 1.5$. The interior contains $z = 0$. The hypothesis fails, and $\oint_{C_2} \frac{dz}{z} = 2\pi i.$
Removable singularity. Let $f(z)=\dfrac{\sin(z)}{z}$ and let C be the unit circle. Although f is undefined at z = 0 , the limit $\lim_{z \to 0} \dfrac{\sin(z)}{z} = 1$ exists and is finite; so by Riemann’s Theorem on Removable Singularities the singularity at z = 0 is removable. Define the “Repaired” Function $g(z)= \begin{cases} \dfrac{\sin(z)}{z}, & z\neq 0, \\\\ 1, & z=0, \end{cases}$, then g is entire (it agrees with its Taylor series $1 - z^2/3! + z^4/5! - \cdots$ everywhere; the singularity is removable). Therefore, $\oint_{|z|=1} \dfrac{\sin(z)}{z}dz =[\text{f(z) and g(z) are identical at every point on the contour C}] \oint_{|z|=1} g(z)dz =[\text{Cauchy-Goursat}] 0.$
When a singularity is removable, Cauchy’s theorem applies after “repairing” the function. The contour integral cannot detect removable singularities.
A topological reformulation. A domain $D \subset \mathbb{C}$ is simply connected if it is connected and every closed curve in $D$ can be continuously shrunk to a point without leaving $D$. Equivalently, $D$ has no “holes.”
Cauchy Theorem For Simply Connected Domains. Let $D \subset \mathbb{C}$ be a simply connected domain and let $f$ be analytic on $D$. Then for every closed contour $\gamma$ lying in $D$, $\displaystyle\oint_\gamma f(z)\,dz = 0.$
Common simply connected domains: $\mathbb{C}$ itself, any open disk, any open half-plane, any open convex set, and any “star-shaped” domain. Common domains that are not simply connected: $\mathbb{C} \setminus \{0\}$ (the punctured plane) and any annulus.
When the domain has holes, the integral over the outer boundary equals the sum of the integrals over the inner boundaries, all oriented counterclockwise (CCW).
Generalized Cauchy Theorem (Multiply Connected Regions). Let $R$ be the region inside a simple closed contour $C$ and outside the non-overlapping simple closed contours $C_1, \ldots, C_n$ (each $C_k$ lying in the interior of $C$). If $f$ is analytic on an open set containing $\overline{R}$ (the closure of $R$), then $\displaystyle\oint_C f(z)\,dz = \sum_{k=1}^n \oint_{C_k} f(z)\,dz,$ where all contours are oriented counterclockwise.
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.$
If $f$ is analytic throughout an annular region between two concentric circles, the integral is the same on both circles. You can “slide” the outer contour inward (or the inner one outward) through the region of analyticity without changing the integral’s value.
Example 1: No singularities anywhere. 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: Singularity in the hole. $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$. The singularity at $z = 0$ lies inside the hole (inside $C_1$), so it affects both integrals equally. The integral cannot “see through” the inner boundary.
Example 3. Let $f(z)=\dfrac{1}{z-a}$, with a lying strictly inside $C_1$ but outside all other inner contours $C_2, \ldots, C_n$, and not on $C$. Then, $f$ is analytic on $\overline{R}$, and $\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.$