= Solution
For a positively oriented curvilinear polygon bounding a disk $D$ in one coordinate patch, with exterior turning angles $\theta_i$, the <Gauss-Bonnet theorem> states
$$
\boxed{\int_DK\,dA+\int_{\partial D}\kappa_g\,ds+\sum_i\theta_i=2\pi.}
$$
For a closed compact <surface> the global formula is
$$
\boxed{\int_SK\,dA=2\pi\chi(S).}
$$
Triangulate the <surface> with each triangle contained in a coordinate patch. For each face, writing its exterior angles as $\pi$ minus its interior angles gives $\int K+\int\kappa_g=\sum\text{interior angles}-\pi$. On summing, the two contributions on each internal edge cancel, and all angles at each vertex sum to $2\pi$. Thus $\int_SK=2\pi V-\pi F$. Since $3F=2E$, this equals $2\pi(V-E+F)$, as required. For a <nonorientable surface> apply the <orientable> version to its <orientation double cover>: both the curvature integral and <Euler characteristic> double. With boundary, the same summation retains the boundary <geodesic>-curvature integral and the exterior angles at boundary corners, giving the corresponding global boundary formula with right side $2\pi\chi(S)$.
Back to article page