Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand, Chinese Proverb

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$.
Definition. A domain in complex analysis is a subset $D \subseteq \mathbb{C}$ that is simultaneously:
Examples of domains: The entire complex plane $\mathbb{C}$; any open disk $\{z : |z - z_0| < r\}$; any open half-plane such as $\{z : \operatorname{Re}(z) > 0\}$; the interior of any simple closed curve; any open strip $\{z : a < \operatorname{Im}(z) < b\}$.
Non-examples: A closed disk $\{z : |z| \le 1\}$ (not open — boundary points like $z = 1$ have no open neighborhood inside the set); the union of two disjoint open disks (open but not connected); a single point $\{0\}$ (not open); the real line $\mathbb{R} \subset \mathbb{C}$ (not open in $\mathbb{C}$).
Definition. A domain $D$ is simply connected if it has no holes. Intuitively, $D$ is a “solid” region: there is no missing point, puncture, or gap that a closed loop could wind around. Formally, every simple closed curve (a loop that does not cross itself) lying entirely within $D$ can be continuously shrunk to a single point without ever leaving $D$.
This shrinking process is called a null-homotopy. The closed curve is null-homotopic (or contractible) if such a continuous deformation exists. A domain is simply connected if and only if every closed curve in it is null-homotopic.
Geometric intuition. Imagine the domain is a rubber sheet and the closed curve is a rubber band lying on it. If you can contract the rubber band down to a dot without it ever sliding off the edge of the sheet, the domain is simply connected. If the sheet has a hole (like a ring or a punctured disk), a rubber band looped around that hole gets “stuck” — it cannot shrink past the missing region.
Equivalent characterizations. For a domain $D \subseteq \mathbb{C}$, the following are equivalent:
Examples of simply connected domains:
Definition. A domain is multiply connected if it is not simply connected, i.e., it has at least one “hole.”. More formally, there exists at least one simple closed curve in the domain that cannot be continuously shrunk to a single point while staying within the domain. The curve will get stuck around a hole.
Geometric intuition. Think of a multiply connected domain as a surface with one or more islands removed. A rubber band looped around an island cannot shrink to a point. Different loops can wind around different islands, and the topology of the domain determines which integrals vanish and which do not.
Examples of multiply connected domains:
In a simply connected domain where $f$ is analytic:
In a multiply connected domain, all of these properties can fail:
Cauchy’s Theorem for simply connected domains. If a function f is analytic (a function that is complex-differentiable at every point within a domain, i.e., well-behaved and smooth, with no sharp corners, breaks, or singularities like division by zero) throughout a simple connected domain D, then $\oint_C f(z)dz = 0$ for every closed contour C lying in D.
Proof.
Case 1. If C is a simple close contour (a path that starts and ends at the same point but never crosses itself, e.g, a circle, an ellipse, a polygon, or any non-self-intersecting loop) lying entirely within the simply connected domain D.
Since D is simply connected (it has no holes), and the curve C lies completely within D, the interior region $\operatorname{Int}(C)$ must also lie completely within D.
This is precisely the characterization of simple connectedness we have already identified: there is no hole in $D$ that $\operatorname{Int}(C)$ could contain.
Recall, the Cauchy-Goursat theorem. If a function f is analytic at all points interior to and on a simple closed contour, then the integral of f around that contour is zero.
Since all conditions of the Cauchy-Goursat theorem are met, we can directly apply its conclusion: $\oint_C f(z)dz = 0$
Case 2. If C is closed but self-intersecting contour, meaning a path that starts and ends at the same point but crosses itself a finite number of times, e.g., a figure-eight.
The core idea is to show that the integral over the complex path is just the sum of the integrals over a set of simple closed paths. We can then apply the result from Case 1 to each simple path.
Decomposition. Suppose $C$ is a figure-eight contour that intersects itself at a single point $A$. The contour traces out two loops: starting at $A$, it traverses the first loop $C_1$ (say counterclockwise) and returns to $A$, then traverses the second loop $C_2$ (say counterclockwise) and returns to $A$.
The self-intersection at $A$ naturally divides $C$ into two simple closed contours $C_1$ and $C_2$, each starting and ending at $A$. Neither $C_1$ nor $C_2$ crosses itself (they are simple).
Additivity of the contour integral. The integral over $C$ splits by the additivity of path integrals: the contour $C$ is the concatenation of the path along $C_1$ followed by the path along $C_2$. Therefore, $\oint_C f(z)\,dz = \oint_{C_1} f(z)\,dz + \oint_{C_2} f(z)\,dz.$
Let the path segment that is shared during the intersection be denoted by the line from $A$ to $B$ (in reality, the intersection might just be a single point).
On cancellation of shared segments. If the contour $C$ traverses a segment from $A$ to $B$ as part of $C_1$ and then retraces it from $B$ to $A$ as part of $C_2$, the two integrals over that shared segment cancel: $\int_A^B f(z)\,dz + \int_B^A f(z)\,dz = 0,$ since reversing the direction of integration negates the integral value. After cancellation, only the simple loops remain. This is the mechanism by which self-intersecting contours reduce to sums of simple ones.
Apply Case 1. Both $C_1$ and $C_2$ are simple closed contours lying in the simply connected domain $D$. By Case 1: $\oint_{C_1} f(z)\,dz = 0 \qquad \text{and} \qquad \oint_{C_2} f(z)\,dz = 0.$
Conclusion: $\oint_C f(z)\,dz = 0 + 0 = 0.$
This logic can be extended to a contour $C$ with any finite number of intersections. It can always be decomposed into a finite number of simple closed contours ($C_1, C_2, \ldots, C_n$), and the integral over $C$ will be the sum of the integrals over each $C_k$. Since every individual integral is zero, according to the Cauchy-Goursat theorem, the total sum is zero: $\oint_C f(z)dz = \sum_{k=1}^n \oint_{C_k} f(z)dz = 0$
When decomposing a self-intersecting contour, the induced orientations on the sub-loops must be tracked carefully. Some sub-loops may be traversed clockwise (negative orientation) depending on how the original contour crosses itself. However, the Cauchy–Goursat theorem gives $\oint_{C_k} f\,dz = 0$ regardless of orientation (zero is unchanged by a sign flip), so the conclusion $\oint_C f = 0$ holds in all cases.

It does not matter how absurdly complicated, wiggly, or even self-intersecting the contour $C$ is. As long as $C$ stays inside $|z| < 2$, the integral vanishes. The singularities at $z = \pm 3$ are .
The singularity $z = i$ lies on the boundary of $D$, not inside $D$. This is sufficient! Cauchy's Theorem requires $f$ to be analytic on the (open) domain $D$, and boundary points are not in an open set. The careful choice of domain $\operatorname{Im}(z) > 1$ (strict inequality) excludes the singularity at $z = i$.
For entire functions, the theorem is very powerful: the integral over any closed contour vanishes, with no restrictions on the contour's shape, size, location, or self-intersections. This is because $\mathbb{C}$ is simply connected and the function is analytic everywhere — there is simply nothing that can obstruct the contraction of a loop.
Alternatively, using antiderivatives, since $\mathbb{C}$ is simply connected and $f$ is entire, $f$ has a global antiderivative: $F(z) = \frac{z^5}{5} + 2z^4 - \frac{7z^3}{3} + \frac{3z^2}{2} + 4\sin z + 8\cos z.$ By the Fundamental Theorem of Calculus for contour integrals, $\oint_C f(z)\,dz = F(z_{\text{end}}) - F(z_{\text{start}}) = 0$ for any closed contour (since the start and end points coincide).