Suppose \(\Sigma^2\subset\mathbb{R}^3\) is a regular surface, and \(\gamma\) is a “curved polygon” on \(\Sigma^2\), which means that \(\gamma:[a,b]\to\Sigma\) is a simple closed continuous curve, with vertices \(\{p_1,\ldots,p_k\}\) given by \(p_i=\gamma(s_i)\) with \(a=s_0<s_1<\cdots<s_{k-1}<s_k=b\), such that \(\gamma|_{[s_{i-1},s_i]}\) is \(C^\infty\) arc-length parametrized curve. Let \(\alpha_i\in(0,\pi)\) be the exterior angle of \(p_i\), defined by \[\cos\alpha_i=\langle\gamma'(s_i^+),\gamma'(s_i^-)\rangle.\] Denote \(\Delta\) to be the region on \(\Sigma\) enclosed by \(\gamma\) such that \(\partial\Delta=\gamma\). Then \[\int_\Delta K\,dS+\oint_\gamma k_g\,ds=2\pi-\sum_{i=1}^k\alpha_i.\]

Let \(X_1=\gamma'(s)\) for any smooth point of \(\gamma\), and \(X_2\) be the unit tangent vector orthogonal to \(X_1\) pointing inward into \(\Delta\). Then \(\{X_1,X_2\}\) is an orthonormal frame. Parametrize \(\Sigma^2\) by \(F(u^1,u^2)\) and define another orthonormal frame \(e_1:=\frac{\partial F}{\partial u^1}\big/\left|\frac{\partial F}{\partial u^1}\right|\) and \(e_2\) orthogonal to \(e_1\) with the same orientation as \(\{X_1,X_2\}\). Regard \(\{e_1,e_2\}\) as the “background” frame and \(\{X_1,X_2\}\) as the “moving” frame. Define the angle \(\varphi(s)\) between \(X_1\) and \(e_1\) at each non-vertex point \(\gamma(s)\) by \(\cos\varphi(s)=\langle X_1,e_1\rangle|_{\gamma(s)}\). Each exterior angle satisfies \(\alpha_i=\lim_{s\to s_i^+}\varphi(s)-\lim_{s\to s_i^-}\varphi(s)\).
By the intuitive observation (consequence of the Theorem of Turning Tangents): \[\lim_{s\to b^+}\varphi(s)-\lim_{s\to a^-}\varphi(s)=2\pi-\alpha_1.\] Applying the Newton-Leibniz formula to each smooth edge: \[\int_a^b\frac{d\varphi}{ds}\,ds=\sum_{i=1}^k\int_{s_{i-1}}^{s_i}\frac{d\varphi}{ds}\,ds=2\pi-\sum_{i=1}^k\alpha_i.\]
On the other hand, from \(\langle X_1,e_1\rangle=\cos\varphi\) we get \(\frac{d\varphi}{ds}=-\frac{1}{\sin\varphi}\frac{d}{ds}\langle X_1,e_1\rangle\). By the product rule \(\frac{d}{ds}\langle X_1,e_1\rangle=\langle\nabla_{X_1}X_1,e_1\rangle+\langle X_1,\nabla_{X_1}e_1\rangle\). Using \(X_1=(\cos\varphi)e_1+(\sin\varphi)e_2\) and \(e_1=(\cos\varphi)X_1-(\sin\varphi)X_2\), we get \(\langle\nabla_{X_1}X_1,e_1\rangle=-(\sin\varphi)k_g\) and \(\langle X_1,\nabla_{X_1}e_1\rangle=-(\sin\varphi)\omega_{12}(X_1)\). Therefore \[\frac{d}{ds}\langle X_1,e_1\rangle=-(\sin\varphi)k_g-(\sin\varphi)\omega_{12}(X_1),\] which gives \(\int_a^b\frac{d\varphi}{ds}\,ds=\int_a^b(k_g+\omega_{12}(X_1))\,ds=\int_\gamma k_g\,ds+\int_\gamma\omega_{12}\).
Since \(\gamma=\partial\Delta\), by Stokes' Theorem and (4.4): \[\int_\gamma\omega_{12}=\int_{\partial\Delta}\omega_{12}=\int_\Delta d\omega_{12}=\int_\Delta K\eta^1\wedge\eta^2=\int_\Delta K\,dS.\] Putting it all together: \[2\pi-\sum_{i=1}^k\alpha_i=\int_\gamma k_g\,ds+\int_\Delta K\,dS.\quad\square\]