Do, or do not. There is no try, Yoda.

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:
Proof.
(1) ⇒ (2)
Let $\gamma$ be any closed contour in G. Let’s parameterize it by z(t) for t in an interval $[\alpha, \beta]$. Since the loop is closed, it starts and ends at the same point, let’s call it a, $z(\alpha) = z(\beta) = a$.
Now, let’s write out the integral using its definition:
$$ \begin{aligned} \oint_\gamma f(z)dz &=\int_\alpha^\beta f(z(t)) \cdot z'(t) dt \\[2pt] &=[\text{Since we assumed F'(z) = f(z)}] \int_\alpha^\beta F'(z(t)) \cdot z'(t) dt \\[2pt] & [\text{By the chain rule, }] \frac{d}{dt} \left( F(z(t)) \right) = F'(z(t)) \cdot z'(t) \\[2pt] &=\int_\alpha^\beta \frac{d}{dt} \left( F(z(t)) \right) dt \\[2pt] &= [\text{By the Fundamental Theorem of Calculus, }] \left[ F(z(t)) \right]_\alpha^\beta = F(z(\beta)) - F(z(\alpha)) \\[2pt] &= [z(\alpha) = z(\beta) = a] F(a) - F(a) = 0. \end{aligned} $$The proof for $(1) \implies (3)$ is almost identical. The integral from $a$ to $b$ would be $F(z(\beta)) - F(z(\alpha)) = F(b) - F(a)$, which depends only on the endpoints, not the path.
(2) ⇒ (3). Let $\gamma_1 \text{ and } \gamma_2$ be two contours or paths from a to b in G.
Consider the new contour $\Gamma = \gamma_1 - \gamma_2$ where $-\gamma_2$ is the path $\gamma_2$ but traversed in reversed (from b back to a). This path starts at a, goes to b (via $\gamma_1$), and then returns to a (via $-\gamma_2$). Therefore, it is a closed contour.
By our assumption 2, $\oint_{\gamma_1 - \gamma_2} f(z)dz = 0$. Using the linearity of integrals, we can split the integral over $\Gamma, \int_{\gamma_1} f(z)dz + \int_{-\gamma_2} f(z)dz = 0.$
A key property of contour integrals is that reversing the path negates the value, $\oint_{\gamma_1}f(z)dz - \oint_{\gamma_2}f(z)dz = 0 \leadsto \oint_{\gamma_1}f(z)dz = \oint_{\gamma_2}f(z)dz$.
This shows that the integral’s value only depends on the endpoints (a and b), not the path taken. This is the definition of path independence.
3 ⇒ 1
Suppose the integral $\oint_{\gamma}f(z)dz$ depends only on the initial and final points of a contour γ lying in G. Since $G$ is a region (connected), we can fix a starting point $z_0$ anywhere in G. Let’s define a function F(z) for any other point z in G as follows: $F(z) = \oint_{\gamma}f(z)dz$ where γ is any contour lying in G from $z_0$ to z.
F is well-defined (meaning it gives a single, unambiguous value) because we are assuming path independence (3). It doesn’t matter which path we take from $z_0$ to z, the integral’s value will be the same, $F(z) = \oint_{\gamma}f(z)dz = \int_{z_0}^z f(z)dz$.
We aim to prove that F’(z) = f(z). Let z ∈ G and consider $|\frac{F(z+h) - F(z)}{h} - f(z)| = |\frac{\int_{z_0}^{z+h} f(ξ)dξ - \int_{z_0}^z f(ξ)dξ}{h} - f(z)|$
Because of path independence (F is well defined), we can choose our integration paths to be convenient. Let’s consider a path from $z_0$ to z + h to be a path from $z_0$ to z, followed by a straight line segment from z to z + h (This is allowed because G is an open set, so for a small enough h, the straight line segment from z to z + h will be entirely contained within G). Now we can split the first integral: $\int_{z_0}^{z+h} f(ξ)dξ - \int_{z_0}^z f(ξ)dξ = (\int_{z_0}^{z} f(ξ)dξ + \int_{z}^{z+h} f(ξ)dξ) - \int_{z_0}^z f(ξ)dξ = \int_{z}^{z+h} f(ξ)dξ$ (the $\int_{z_0}^{z} f(ξ)dξ$ terms cancel) where the integral is over the straight line from z to z + h.
Hence, $|\frac{\int_{z_0}^{z+h} f(ξ)dξ - \int_{z_0}^z f(ξ)dξ}{h} - f(z)| = |\frac{\int_{z}^{z+h} f(ξ)dξ}{h} - f(z)|$.
Since G is open and z ∈ G, there is a $\delta_0 \gt 0$ such that $B(z; \delta_0) \subseteq G$. When $|h| \lt \frac{\delta_0}{2}$, the straight line joining z and z + h is contained in G. Therefore, we choose the straight line (contour) from z to z + h for the above integral when $|h| \lt \frac{\delta_0}{2}$.
Then, $\frac{\int_{z}^{z+h} f(ξ)dξ}{h} - f(z) = \frac{\int_{[z, z+h]} (f(ξ) - f(z))dξ}{h}$ where $\int_{[z, z+h]}$ indicates the straight line (contour) from z to z + h, and we can write the constant f(z) as an integral over the straight line $[z, z+h]$. The path has length $L = |(z+h) - z| = |h|$; we can parameterize the path as $\gamma(t) = z + th$ for $t \in [0, 1], \gamma'(t) = h$.
Then, $\int_{[z, z+h]} f(z)dξ = \int_0^1 f(z) \cdot \gamma'(t) dt = \int_0^1 f(z) \cdot h dt = f(z) \cdot h \cdot t\bigg|_{0}^{1} = f(z)\cdot h$.
Therefore, we can write $f(z) = \frac{1}{h} \int_z^{z+h} f(z)d\xi$.
By the Estimation Theorem, $|\frac{\int_{[z, z+h]} (f(ξ) - f(z))dξ}{h}| \le \frac{1}{|h|} \int_{[z, z+h]} |f(ξ) - f(z)| dξ$
Analicity implies continuity and by continuity of f, given $\epsilon \gt 0$, there is a $\delta \gt 0$ such that whenever $|ξ -z| \lt \delta, |f(ξ) - f(z)| \lt \epsilon$ (as $\xi$ gets closer to $z, f(\xi)$ gets closer to $f(z)$).
So given $\epsilon \gt 0$, choose $\delta_1 = min(\delta, \delta_0)$ so that whenever $|ξ -z| \lt \delta_1, |f(ξ) - f(z)| \lt \epsilon \text{ and } \frac{1}{|h|} \int_{[z, z+h]} |f(ξ) - f(z)| dξ \lt \epsilon \frac{1}{|h|} \cdot \int_{[z, z+h]} dξ = \epsilon$.
Therefore, given $\epsilon \gt 0$, we have found a $\delta_1$ so that whenever $|ξ -z| \lt \delta_1, |\frac{F(z+h) - F(z)}{h} - f(z)| \lt \epsilon$. So F is differentiable at every point z ∈ G and F’(z) = f(z).