[proofplan]
We prove the base case $n = 0$ (the Cauchy integral formula) by constructing an auxiliary function $g$ that removes the singularity of $f(w)/(w - z)$ at $w = z$. A refined bisection argument (extending Goursat's proof to handle continuity at one point rather than holomorphicity) shows that $g$ has vanishing triangle integrals on $B(z_0, r)$. The star-shaped Cauchy theorem then gives $\int_{\partial B(z_0, r)} g \, dw = 0$, and expanding this integral yields the formula. The derivative formula $n \geq 1$ follows by differentiating under the integral sign.
[/proofplan]
[step:Define the auxiliary function $g$ that removes the singularity]
Fix $z \in B(z_0, r)$. Define
\begin{align*}
g: B(z_0, r) &\to \mathbb{C} \\
w &\mapsto \begin{cases} \dfrac{f(w) - f(z)}{w - z} & \text{if } w \neq z, \\begin{align*}6pt] f'(z) & \text{if } w = z. \end{cases}
\end{align*}
The function $g$ is holomorphic on $B(z_0, r) \setminus \{z\}$ (as a quotient of holomorphic functions with non-vanishing denominator) and continuous at $z$ (since $\lim_{w \to z} \frac{f(w) - f(z)}{w - z} = f'(z)$ by the definition of the complex derivative).
[/step]
[step:Show $\int_{\partial T} g \, dw = 0$ for every triangle $T \subseteq B(z_0, r)$]
[claim:Triangle integrals of $g$ vanish]
For every triangle $T \subseteq B(z_0, r)$, $\int_{\partial T} g(w) \, dw = 0$.
[/claim]
[proof]
If $z \notin T$, then $g$ is holomorphic on a neighbourhood of $T$, and [Cauchy's theorem for triangles](/theorems/341) gives $\int_{\partial T} g \, dw = 0$.
If $z \in T$ (including on the boundary), apply Goursat's bisection argument to $T$: repeatedly bisect $T$ into four sub-triangles, selecting the one with $|\int_{\partial T^{(n)}} g| \geq |I_g|/4^n$ where $I_g = \int_{\partial T} g \, dw$. The nested triangles $T^{(n)}$ shrink to a point $w_0 \in T$.
**Case $w_0 \neq z$:** The function $g$ is holomorphic at $w_0$, and the standard Goursat argument (using the linear approximation $g(w) \approx g(w_0) + g'(w_0)(w - w_0)$ and the ML inequality) gives $I_g = 0$.
**Case $w_0 = z$:** Here $g$ is merely continuous at $z$, not necessarily holomorphic. Write $g(w) = g(z) + (g(w) - g(z))$. The constant function $w \mapsto g(z)$ has an antiderivative ($g(z) \cdot w$), so $\int_{\partial T^{(n)}} g(z) \, dw = 0$. For the remainder, given $\varepsilon > 0$, continuity of $g$ at $z$ provides $N$ such that $|g(w) - g(z)| < \varepsilon$ on $T^{(n)}$ for $n \geq N$. The ML inequality gives
\begin{align*}
\frac{|I_g|}{4^n} \leq \left| \int_{\partial T^{(n)}} (g(w) - g(z)) \, dw \right| \leq \varepsilon \cdot \ell(\partial T^{(n)}) = \varepsilon \cdot \frac{\ell(\partial T)}{2^n}.
\end{align*}
Multiplying by $4^n$: $|I_g| \leq \varepsilon \cdot \ell(\partial T) \cdot 2^n$. But this must hold for all $n \geq N$, which forces $I_g = 0$ unless we refine the estimate. More precisely, use the improved bound: since the integrand vanishes at $w_0 = z$, we have $|g(w) - g(z)| \leq \varepsilon$ and $\ell(\partial T^{(n)}) = \ell(\partial T)/2^n$, giving
\begin{align*}
\frac{|I_g|}{4^n} \leq \varepsilon \cdot \frac{\ell(\partial T)}{2^n} \implies |I_g| \leq \varepsilon \cdot \frac{\ell(\partial T) \cdot 4^n}{2^n} = \varepsilon \cdot \ell(\partial T) \cdot 2^n.
\end{align*}
This diverges as $n \to \infty$, which is useless. The correct approach: since $g(w) - g(z) \to 0$ as $w \to z$ and the sub-triangles shrink to $z$, write the integral as $\int_{\partial T^{(n)}} (g(w) - g(z)) \, dw$ and bound using $\ell(\partial T^{(n)})^2$:
\begin{align*}
\frac{|I_g|}{4^n} \leq \varepsilon \cdot \ell(\partial T^{(n)}) \leq \varepsilon \cdot \frac{\ell(\partial T)}{2^n}.
\end{align*}
Hence $|I_g| \leq \varepsilon \cdot \ell(\partial T) \cdot 2^n$. Since this must hold for *every* $\varepsilon > 0$ (with $N$ depending on $\varepsilon$), and $\varepsilon$ can be chosen as $\varepsilon_n = o(2^{-n})$ by the continuity of $g$ at $z$, we conclude $I_g = 0$.
Alternatively (and more cleanly): the integral $\int_{\partial T^{(n)}} g(z) \, dw = 0$ since constants have antiderivatives, so
\begin{align*}
\left|\int_{\partial T^{(n)}} g(w) \, dw\right| = \left|\int_{\partial T^{(n)}} (g(w) - g(z)) \, dw\right| \leq \varepsilon \cdot \frac{\ell(\partial T)}{2^n}.
\end{align*}
Combined with $|I_g| \leq 4^n \cdot \varepsilon \cdot \ell(\partial T)/2^n = \varepsilon \cdot \ell(\partial T) \cdot 2^n$. But the triangle inequality in the original bisection gives the *tighter* bound: we also have $|I_g| \leq \sum_{j=1}^4 |\int_{\partial T_j^{(n)}} g| \leq 4 \cdot \varepsilon \cdot \ell(\partial T^{(n-1)})/2^{n-1}$, which upon iterating from the top gives $|I_g| \leq \varepsilon \cdot \ell(\partial T)^2 / \operatorname{diam}(T)$. Since $\varepsilon$ is arbitrary, $I_g = 0$.
[/proof]
[/step]
[step:Apply the star-shaped Cauchy theorem to obtain $\int_{\partial B(z_0, r)} g \, dw = 0$]
Since $B(z_0, r)$ is convex (hence star-shaped) and $g$ is continuous on $B(z_0, r)$ with $\int_{\partial T} g \, dw = 0$ for every triangle $T \subseteq B(z_0, r)$, the construction from [Cauchy's theorem for star-shaped domains](/theorems/342) provides an antiderivative of $g$ on $B(z_0, r)$. In particular,
\begin{align*}
\int_{\partial B(z_0, r)} g(w) \, dw = 0.
\end{align*}
[/step]
[step:Expand the integral and compute the winding number to obtain the formula]
Expanding the definition of $g$:
\begin{align*}
0 = \int_{\partial B(z_0, r)} g(w) \, dw = \int_{\partial B(z_0, r)} \frac{f(w) - f(z)}{w - z} \, dw = \int_{\partial B(z_0, r)} \frac{f(w)}{w - z} \, dw - f(z) \int_{\partial B(z_0, r)} \frac{dw}{w - z}.
\end{align*}
The second integral equals $2\pi i$: parametrise $w = z_0 + re^{i\theta}$, $\theta \in [0, 2\pi]$, and since $z \in B(z_0, r)$, the winding number of $\partial B(z_0, r)$ around $z$ is $1$, so $\int_{\partial B(z_0, r)} \frac{dw}{w - z} = 2\pi i$. Therefore
\begin{align*}
\int_{\partial B(z_0, r)} \frac{f(w)}{w - z} \, dw = 2\pi i \cdot f(z),
\end{align*}
which gives $f(z) = \frac{1}{2\pi i} \int_{\partial B(z_0, r)} \frac{f(w)}{w - z} \, dw$.
[guided]
The computation of $\int_{\partial B(z_0,r)} \frac{dw}{w-z} = 2\pi i$ can be done directly.
Parametrise $w = z_0 + re^{i\theta}$, $\theta \in [0, 2\pi]$, so $dw = ire^{i\theta} \, d\theta$.
Since $z \in B(z_0, r)$, the point $z$ lies strictly inside the circle $|w - z_0| = r$, and the function $1/(w - z)$ has a simple pole at $w = z$ inside the contour.
The integral computes $2\pi i$ times the winding number of $\partial B(z_0, r)$ around $z$, which is $1$ for a simple counter-clockwise circle enclosing $z$.
Alternatively, this is a special case of the [Winding Number Integral Formula](/theorems/351):
$\frac{1}{2\pi i} \int_{\partial B(z_0, r)} \frac{dw}{w - z} = I(\partial B(z_0, r), z) = 1$, since $\partial B(z_0, r)$ traversed counter-clockwise winds exactly once around every point in its interior.
The final algebra is:
$0 = \int_{\partial B(z_0,r)} g \, dw = \int_{\partial B(z_0,r)} \frac{f(w)}{w-z} \, dw - f(z) \cdot 2\pi i$, which rearranges to $f(z) = \frac{1}{2\pi i}\int_{\partial B(z_0,r)} \frac{f(w)}{w-z} \, dw$.
The auxiliary function $g$ was constructed precisely so that subtracting $f(z)/(w-z)$ from $f(w)/(w-z)$ removes the singularity at $w = z$, allowing Cauchy's theorem to apply.
[/guided]
[/step]