JOVANA
Explore Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Primitives and Path Independence

If a function is the derivative of something, integrating it becomes shockingly easy: the path stops mattering and only the endpoints survive. We build the contour version of the Fundamental Theorem of Calculus, watch closed loops collapse to zero, and meet the famous catch — 1/z has no global primitive, and that single fact is the seed of the whole subject.

The shortcut you have been missing

In the last two guides you learned to compute a contour integral honestly — parametrize the path z(t), substitute, and grind out a real integral in t — and you learned to bound the answer with the ML inequality when you only need its size. Both are excellent tools, but both treat the integral as a chore to be carried out along a specific road. This guide is about the moment when the road stops mattering. For a large and important class of functions, the value of the integral depends only on where you start and where you finish — not on the journey in between. That phenomenon has a name, path independence, and it has a cause: the function is the derivative of something.

Cast your mind back to first-year calculus. The Fundamental Theorem of Calculus says that if F'(x) = f(x), then the integral of f from a to b is just F(b) - F(a). You never parametrize anything; you find an antiderivative and subtract its values at the ends. The miracle of this guide is that the very same theorem holds for contour integrals in the complex plane, almost word for word. The object playing the role of the antiderivative is called a primitive (some books say antiderivative or indefinite integral — same thing), and once you have one, the integral evaluates itself.

The Fundamental Theorem for contour integrals

Here is the precise statement. Suppose F is holomorphic on a domain D with F'(z) = f(z) there — we call such an F a primitive of f. Then for any piecewise-smooth path gamma inside D running from a starting point z_0 to an ending point z_1, the integral of f along gamma equals F(z_1) - F(z_0). That is the whole Fundamental Theorem for contour integrals. Notice what has vanished from the right-hand side: every trace of the path. Two different roads from z_0 to z_1 give the identical answer, because the answer never mentioned the road.

Why is it true? The proof is a one-line application of the chain rule, and it is worth seeing because it demystifies everything. Parametrize gamma by z(t) for t from 0 to 1. Then f(z(t)) z'(t) = F'(z(t)) z'(t), and by the chain rule that is exactly the t-derivative of the composite F(z(t)). So integrating it over t recovers F(z(t)) at the endpoints — F(z(1)) - F(z(0)) = F(z_1) - F(z_0). The parametrization cancels itself out completely, which is the precise mechanism behind path independence.

F'(z) = f(z)   on a domain D

  integral over gamma of f(z) dz  =  F(z_1) - F(z_0)
                                     (endpoints only)

Proof in one line, with z = z(t):
  f(z(t)) z'(t) = F'(z(t)) z'(t) = d/dt [ F(z(t)) ]
  integrate t in [0,1]  =>  F(z_1) - F(z_0)
A primitive turns a contour integral into a subtraction at the endpoints — the path cancels.

Closed loops collapse to zero

Now feed the theorem a closed loop. If gamma comes back to where it started, then z_1 = z_0, and F(z_1) - F(z_0) = 0. So whenever f has a primitive on the domain, the integral of f around any closed contour vanishes. This is a stunningly strong statement dressed in modest clothes: no matter how the loop wiggles, how big it is, or how many times it bends back on itself, the integral is exactly zero the instant a primitive exists. You are getting a glimpse here of the deepest result of the whole rung — Cauchy's integral theorem — which we prove properly in the next guide. The primitive version is the easy half, and it tells you precisely which property a function needs for its loop integrals to die.

Let us make it concrete with the friendliest example. Take f(z) = z^n for a whole number n that is zero or larger. A primitive is the obvious one, F(z) = z^(n+1)/(n+1), holomorphic on the whole plane — recall the power rule works in the complex setting exactly as it did for real x. So the integral of z^n around the unit circle is zero for every n = 0, 1, 2, 3, and so on. You could verify this by the brute-force method of guide one — parametrize z = e^(i theta) and integrate from 0 to 2 pi — but you no longer have to. Any polynomial, e^z, cos z, sin z: each is the derivative of an entire function, so each integrates to zero around every closed loop in the plane.

The famous catch: 1/z has no global primitive

Everything above might lull you into thinking every holomorphic function has a primitive and every loop integral is zero. That is false, and the counterexample is the single most important integral in the subject. Take f(z) = 1/z on the punctured plane — everywhere except the origin. It is holomorphic there. By the power rule you would expect a primitive of z^(-1) to be log z. And indeed F(z) = log z does satisfy F'(z) = 1/z. The trouble is that log z is multivalued: log z = ln|z| + i(arg z + 2 pi k), and there is no way to pick a single value of arg z continuously all the way around a loop that encircles 0. Walk once around the origin and arg z has secretly increased by 2 pi.

So integrate 1/z around the unit circle directly. With z = e^(i theta), dz = i e^(i theta) d theta, and 1/z = e^(-i theta), the integrand becomes i d theta, and integrating theta from 0 to 2 pi gives exactly 2 pi i — not zero. The loop integral refuses to vanish, and the theorem above tells us precisely why: there is no single-valued primitive of 1/z on the whole punctured plane. The best we can do is define a branch of the logarithm on a slit plane (cut along a ray so no loop can encircle 0), and on that smaller domain 1/z does have a primitive and does integrate to zero around loops staying inside the slit region.

That number 2 pi i is not an accident or a nuisance — it is the heartbeat of complex analysis. It counts, in disguise, how many times the loop wraps around the puncture: integrate 1/z around a loop that circles the origin k times and you get 2 pi i times k. That integer is the winding number, the subject of the fifth guide in this rung, and it is the reason multiply-connected domains behave so differently from simply-connected ones. Far from being a failure of the theory, the non-vanishing of this one integral is the door through which residues, the Cauchy integral formula, and most of the subject's power will eventually walk.

How to use a primitive in practice

The working method is short, and it is the same logic as real-variable substitution, just played in the plane. The only genuinely complex-analysis step is the honesty check: make sure your primitive is single-valued and holomorphic on a domain that actually contains your whole path, with no hidden branch cut crossed along the way.

  1. Recognize a primitive. Ask whether the integrand is d/dz of something familiar — z^n integrates to z^(n+1)/(n+1) (for n not equal to -1), e^z to e^z, cos z to sin z, and 1/z to a branch of log z.
  2. Check the domain. Confirm F is holomorphic and single-valued on a region containing the entire path gamma; for anything involving log z or z to a non-integer power, fix a branch and make sure the path never crosses its branch cut.
  3. Read off the endpoints. The answer is F(z_1) - F(z_0). If the path is closed, z_1 = z_0 and the answer is zero — no parametrization needed.
  4. If no primitive exists on your domain (the 1/z situation), STOP — path independence fails, and you must fall back on direct parametrization now and on residues later.