Solution (source code)

= Solution

For a positively oriented local parametrization $X(u,v)$ with <first fundamental form>
$$
I=E\,du^2+2F\,du\,dv+G\,dv^2,
$$
the <area element of a surface> is
$$
dA=\sqrt{EG-F^2}\,du\wedge dv.
$$
Under an orientation-preserving coordinate change, the Jacobian from $du\wedge dv$ cancels the inverse Jacobian in the square root of the metric determinant. Hence these local expressions agree and define a global two-form.

The <Euler characteristic> may be defined from any finite triangulation by
$$
\chi(S)=V-E+F,
$$
or equivalently by the alternating sum of the dimensions of the rational <homology (mathematics)> groups. Subdivision leaves $V-E+F$ unchanged, and the homological formula shows that it is a topological invariant, so the definition does not depend on the triangulation.

Give the boundary its induced orientation and parametrize it by <arc length>. If $T$ is its unit tangent and $N$ is the chosen <unit normal> to the surface, its signed <geodesic curvature> is
$$
k_g=\langle D_sT,N\times T\rangle,
$$
where $D_s$ is the <surface covariant derivative>. The <Gauss-Bonnet theorem> for a compact oriented surface with smooth boundary and no corners is
$$
\int_S K\,dA+\int_{\partial S}k_g\,ds=2\pi\chi(S),
$$
where $K$ is the <Gaussian curvature>.