The excitement of learning separates youth from old age. As long as you’re learning, you’re not old, Rosalyn S.Yalow

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$.
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 simply simple connected domain D then $\oint_C f(z)dz = 0$ for every closed contour C lying in D.
General Cauchy Theorem for Multiply Connected Domains. Let $R$ be the multiply connected region (with n holes) inside $C$ but outside of every $C_k$ (each $C_k$ surrounds only one hole in the domain), $R = Int(C) \setminus \bigcup_{k=1}^n \overline{Int(C_k)}$, and let $f(z)$ be analytic on $R$. Now, let $\Gamma$ be any general closed contour (not necessarily simple) that lies entirely in R. This $\Gamma$ can wind around the “holes” (the regions inside each $C_k$) in any way it likes (this is the winding number or index of $\Gamma$ around each hole), the integral over $\Gamma$ is: $\oint_{\Gamma} f(z)dz = \sum_{k=1}^n m_k \oint_{C_k} f(z)dz$.
The Anti-Derivative Theorem. Let f be a continuous function on a region G (a region is an open, connected set). Then, the following statements are equivalent:
Informal definition. Deformation of contours. Think of a closed rubber band $\gamma_0$ lying in a domain D. A loop or closed contour $\gamma_0$ is continuously deformed into the loop $\gamma_1$ in the domain D if you can stretch, shrink, or slide $\gamma_0$ without ever leaving D and without cutting or gluing, until it exactly coincides or matches $\gamma_1$ (same position and orientation), Figure iii.

Basically, we need a set (a continuum of loops sufficiently close to one another) $\{ \gamma_s \}, 0 \le s \le 1 = \gamma_0,\; \gamma_{0.01},\; \gamma_{0.02},\; \dots,\; \gamma_{0.99},\; \gamma_1$ where we move from one loop to the next by stretching, shrinking, or sliding without ever leaving the domain D.
Formal definition. Deformation of contours. A homotopy (continuous deformation) from a loop (closed contour) $\gamma_0$ to the loop $\gamma_1$, written $\gamma_0 \simeq \gamma_1$, in the domain D is a continuos function $H \colon [0,1] \times [0,1] \longrightarrow D, \qquad (s,\,t) \longmapsto H(s,\,t)$ that satisfies:
The parameter $s$ is the deformation parameter (you may want to think of it as “time”): at $s = 0$ we see the original loop $\gamma_0$; as $s$ increases toward $1$, the loop continuously morphs; and at $s = 1$ it has become $\gamma_1$. The parameter $t$ is the usual curve parameter that traces out each individual loop.
Let $\gamma_0$ be parameterized as $z_0(t)$, $0 \le t \le 1$. Consider the function $H(s,t) = (1 - s)\,z_0(t), \qquad 0 \le s \le 1,\quad 0 \le t \le 1$
Continuity: $H$ is continuous because it is the product of the continuous functions $(1-s)$ and $z_0(t)$.
Each $\gamma_s$ is a closed loop: since $z_0(0) = z_0(1)$ (the original loop is closed), we have $H(s,0) = (1-s)\,z_0(0) = (1-s)\,z_0(1) = H(s,1)$.
Every intermediate loop lies in $\mathbb{C}$: trivially satisfied since $\mathbb{C}$ is the entire plane.
Initial loop: $H(0,t) = z_0(t) = \gamma_0(t)$. ✓
Final loop: $H(1,t) = 0 \cdot z_0(t) \equiv 0$, the constant loop at the origin. ✓
Geometrically, each intermediate loop $\gamma_s(t) = (1-s)\,z_0(t)$ is a scaled-down copy of $\gamma_0$, shrinking linearly toward the origin as $s$ goes from $0$ to $1$.

Any domain D possessing the property that every loop in D can be continuously deformed to a point within $D$ is called a simply connected domain. Intuitively, a simply connected domain is a domain without “holes”. The entire complex plane $\mathbb{C}$ is simply connected; a punctured plane $\mathbb{C}\setminus\{0\}$ is not.
Consider the function $H(s,t) = (1+s)\,e^{2\pi i t}, \qquad 0 \le s \le 1,\quad 0 \le t \le 1.$
Continuity: evident. ✓
Each $\gamma_s$ is closed: $H(s,0) = (1+s)\,e^{0} = (1+s) = (1+s)\,e^{2\pi i} = H(s,1)$. ✓
Each $\gamma_s$ stays inside the domain $D$: $|H(s,t)| = 1+s$, and for $s \in [0,1]$ we have $1 \le 1+s \le 2$, so $\tfrac{1}{2} < 1+s < 3$. ✓
Initial loop: $H(0,t) = e^{2\pi i t} = \gamma_0(t)$. ✓
Final loop: $H(1,t) = 2\,e^{2\pi i t} = \gamma_1(t)$. ✓
Hence $\gamma_0 \simeq \gamma_1$ in $D$.

The winding number of $\gamma_0$ around $0$ is $1$. Intuitively, the curve wraps once around the origin. Any continuous deformation preserves the winding number (it is a homotopy invariant, since the winding number is an integer and must vary continuously — hence it is constant). A constant (point) loop has winding number $0$. Since $1 \neq 0$, no homotopy in $D$ can connect $\gamma_0$ to a point.
The winding number of a loop $\gamma$ around a point $z_0 \notin \gamma ([0,1])$ is $\operatorname{Ind} (\gamma ,z_0)=\frac{1}{2\pi i}\int _{\gamma }\frac{1}{z-z_0}\, dz.$ For $\gamma _0, \operatorname{Ind} (\gamma _0,0)=1.$ This quantity has two crucial properties: (i) It is always an integer: $\operatorname{Ind}(\gamma, z_0) \in \mathbb{Z}.$ (ii) It is invariant under homotopy in $D$: If $\gamma$ is continuously deformed within $D$, its winding number around $z_0$ does not change.
This shows $D = \mathbb{C}\setminus\{0\}$ is not simply connected: the puncture (hole) at the origin is the topological obstruction.
Deformation of Contours Theorem. If a function f(z) is analytic throughout a region G, and if $\gamma_1$ and $\gamma_2$ are two simple closed, positively oriented contours that are homotopic in G (meaning $\gamma_1$ can be continuously deformed into $\gamma_2$ entirely within $G$ without crossing any singularities of f), then their contour integrals are equal: $\oint_{\gamma_1} f(z)dz = \oint_{\gamma_2}f(z)dz$.
The integral of an analytic function is invariant under deformation of the contour, provided the deformation doesn’t cross a point where $f(z)$ is not analytic.
Proof.
We define two arbitrary, non-intersecting line segments or cuts $L_1$ and $L_2$, each starting on $\gamma_1$ and ending on $\gamma_2$. They both divide the annular region between $\gamma_1$ and $\gamma_2$ into two simply connected pieces and also divide the original contours:

We construct two new, simple closed contours, $K_1$ and $K_2$, that lie entirely within the region G where f(z) is analytic. The direction of integration is essential to ensure $K_1$ and $K_2$ are positively oriented simple closed loops and the regions enclosed by them are simply connected regions (they have no holes) that lie entirely within G.
Since f(z) is analytic throughout G, and since $K_1$ and $K_2$ are simple closed contours lying entirely within a region where f(z) is analytic, we can apply Cauchy’s Theorem (or Cauchy-Goursat): $\oint_{K_1} f(z)dz = \oint_{K_2}f(z)dz = 0$.
Let’s combine the integrals: $\oint_{K_1+K_2} f(z)dz =[\text{By the linearity property of integrals}] \oint_{K_1} f(z)dz + \oint_{K_2} f(z)dz = 0 + 0 = 0$
Substitute the definitions of $K_1$ and $K_2$: $\oint_{K_1+K_2} f(z)dz = \oint_{(-\gamma_1^* + L_1 + \gamma_2^* - L_2)} f(z)dz + \oint_{(-\gamma_1^{**} + L_2 + \gamma_2^{**} - L_1)} f(z)dz = 0$
We group the terms:
$$= \underbrace{\left( \oint_{-\gamma_1^*} f(z)dz + \oint_{-\gamma_1^{**}} f(z)dz \right)}_{-\oint_{\gamma_1} f(z)dz} + \underbrace{\left( \oint_{\gamma_2^*} f(z)dz + \oint_{\gamma_2^{**}} f(z)dz \right)}_{\oint_{\gamma_2} f(z)dz} + \underbrace{\left( \oint_{L_1} f(z)dz + \oint_{-L_1} f(z)dz \right)}_{0} + \underbrace{\left( \oint_{-L_2} f(z)dz + \oint_{L_2} f(z)dz \right)}_{0}$$Hence, $\oint_{K_1+K_2} f(z)dz = -\oint_{\gamma_1} f(z)dz + \oint_{\gamma_2} f(z)dz = 0$. Rearranging the final equation yields the desired result: $\boxed{\oint_{\gamma_1} f(z)\,dz = \oint_{\gamma_2} f(z)\,dz.} \qquad \blacksquare$
The function f(z) = $\frac{1}{z²}$ has a singularity at z = 0, which lies inside γ. We cannot apply Cauchy’s theorem directly. However, we can use the deformation of contours principle.
Let C be a circle of radius 1 centered at the origin (oriented counterclockwise). Since $\frac{1}{z²}$ is not analytic at z = 0 but it is indeed analytic in the annular region between Γ and C (i.e., the region $1 \le |z| \le \min(\text{dist from } 0 \text{ to sides of } \gamma) = 2$), by the deformation of contours principle: $\oint_\gamma \frac{1}{z²}dz = \oint_C \frac{1}{z²}dz$ (Figure i).

The parametric equations of C are: x = cos(t), y = sin(t), 0 ≤ t ≤ 2π. We parametrize the circle C as: z = x + iy = cos(t) + isin(t) = $e^{it} \leadsto dz = ie^{it}dt$.
Now, we compute the integral: $\oint_C \frac{1}{z²}dz = \int_0^{2\pi} \frac{1}{e^{2it}} ie^{it}dt = i \int_0^{2\pi} e^{-it}dt = i \cdot \frac{1}{-i}e^{-it} = - e^{-it}\Big|_{0}^{2\pi} = -e^{-2\pi i} + e^0 = -1 + 1 = 0$
Since $e^{−2πi} = \cos(−2\pi) + i\sin(−2\pi) = 1$.
Therefore: $\boxed{\oint_\gamma \frac{1}{z^2} dz = 0}$
The vanishing of this integral despite the singularity at the origin is not a contradiction — it reflects the fact that $\frac{1}{z^2}$ has an antiderivative, namely $-\frac{1}{z}$, on $\mathbb{C}\setminus\{0\}$ (its residue at $z=0$ is zero). By contrast, $\oint_\gamma \frac{1}{z}\,dz = 2\pi i \neq 0$ because $\frac{1}{z}$ has residue $1$ at the origin and no single-valued antiderivative on $\mathbb{C}\setminus\{0\}$.
The integrand $\frac{e^z}{z^2-1} = \frac{e^z}{(z-1)(z+1)}$ has singularities at $z = 1$ and $z = -1$. Both lie inside $\gamma$ since $|1| = |-1| = 1 < 2$.
We are going to consider the region inside γ but excluding small circles C₁ and C₂ around z = 1 and z = -1 (oriented clockwise). In other words, we enclose each singularity in its own small circle: $C_1$: a small circle of radius $r < 1$ centered at $z = -1$, oriented counterclockwise; and $C_2$: a small circle of radius $r < 1$ centered at $z = 1$, oriented counterclockwise.
By Cauchy’s Integral Theorem for multiply connected regions, the sum of the integral of a function over the contour of a multiply connected region $\gamma$ traversed counterclockwise is equal to the sum of the integrals over the internal contours (holes) C₁ and C₂, both circles of radius’s length less than one around -1 and 1 respectively and traversed clockwise, $\oint_{\gamma} \frac{e^z}{z²-1} = \oint_{C_1} \frac{e^z}{z²-1} + \oint_{C_2} \frac{e^z}{z²-1}$ (Figure ii)

$\oint_{C_1} \frac{e^z}{z²-1} + \oint_{C_2} \frac{e^z}{z²-1} = \oint_{C_1} \frac{e^z}{z-1}\frac{1}{z+1} + \oint_{C_2} \frac{e^z}{z+1}\frac{1}{z-1}$
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$
Apply the Cauchy Integral Formula to each small circle where $f(z) = \frac{e^z}{z-1}, g(z) = \frac{e^z}{z+1} \text{ at } z_0 = -1 \text{ and } 1$ respectively.
$\oint_{C_1} \frac{e^z}{z-1}\frac{1}{z+1} + \oint_{C_2} \frac{e^z}{z+1}\frac{1}{z-1} = 2\pi i\frac{e^{-1}}{-2} + 2\pi i\frac{e}{2} = 2\pi i \frac{e-e^{-1}}{2} = \pi i(e-e^{-1})$
Combining, $\oint_{\gamma} \frac{e^z}{z²-1} = \pi i(e-e^{-1})$. Recalling the identity $e - e^{-1} = 2\sinh(1)$, we can also write: $\boxed{\oint_\gamma \frac{e^z}{z^2-1}\,dz = \pi i\!\left(e - e^{-1}\right) = 2\pi i\,\sinh(1).}$