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 γ₀ 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 one to another) $\{ \gamma_s \}, 0 \le s \le 1 = \gamma_0, \gamma_{00\cdots 01}, \cdots, \gamma_{09\cdots 91}, \gamma_1$ where we move from one loop to another 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$, γ₀ ≃ γ₁, in the domain D is a continuos function z: [0, 1] x [0, 1] → D, (s, t) → z(s, t) that satisfies:
Let γ₀ be parameterized as γ₀ = z₀(t), 0 ≤ t ≤ 1. Consider the function z(s, t) = (1 - z)·z₀(t), 0 ≤ s ≤ 1, 0 ≤ t ≤ 1. z(0, t) = (1 - 0)·z₀(t) = z₀(t). At s = 1 the loop shrinks to the constant loop, z(1, t) = (1 - 1)·z₀(t) ≡ 0.

Any domain D possessing the property that every loop in D can be continuously deformed to a point is called a simply connected domain. Intuitively, a simply connected domain is a domain without “holes”.

Deformation of Contours Theorem. If a function f(z) is analytic throughout a region G, and if γ₁ and γ₂ 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$. $L_1$ and $L_2$ start on $\gamma_1$ and end on $\gamma_2$. They both divide the space between $\gamma_1$ and $\gamma_2$ 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: $\oint_{\gamma_2} f(z)dz = \oint_{\gamma_1} f(z)dz$
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 0 < ∣z∣ < dist(0, γ)), 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 function f has singularities at z ± 1, both of which lie inside γ, $|z| = 2$ since their magnitudes are 1.
We are going to consider the region inside γ but excluding small circles C₁ and C₂ around z = 1 and z = -1 (oriented clockwise).
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 γ 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{e^z}{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 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{e^z}{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})$
Therefore, $\oint_{\gamma} \frac{e^z}{z²-1} = \pi i(e-e^{-1})$