Solution (source code)

= Solution

The generating circle has $f'^2+g'^2=1$, and its revolution is a <torus>. From part (a), $K=\cos u/(2+\cos u)$ and the <area element of a surface> is $dA=f\,du\,dv=(2+\cos u)\,du\,dv$. Therefore
$$
\boxed{\int_S K\,dA=\int_0^{2\pi}\int_0^{2\pi}\cos u\,dv\,du=0.}
$$
The positive <Gaussian curvature> on the outer side exactly cancels the negative curvature on the inner side. Equivalently, the <Gauss-Bonnet theorem> gives $\int_S K\,dA=2\pi\chi(T^2)=0$ because the <Euler characteristic> of the torus is zero.