Solution (source code)

= Solution

Write $R=a+b\cos u>0$. The tangent vectors are
$$
\sigma_u=(-b\sin u\cos v,-b\sin u\sin v,b\cos u),\qquad \sigma_v=(-R\sin v,R\cos v,0).
$$
Their squared lengths and inner product give the <first fundamental form>
$$
I=b^2\,du^2+R^2\,dv^2.
$$
The unit normal determined by this ordered parametrization is
$$
\nu=\frac{\sigma_u\times\sigma_v}{|\sigma_u\times\sigma_v|}=-(\cos u\cos v,\cos u\sin v,\sin u).
$$
Taking inner products of $\nu$ with $\sigma_{uu}$, $\sigma_{uv}$ and $\sigma_{vv}$ yields $e=b$, $f=0$, $g=R\cos u$. Consequently the <second fundamental form of a ring torus> is
$$
\boxed{II=b\,du^2+(a+b\cos u)\cos u\,dv^2.}
$$
This normal points into the tube. Choosing the outward unit normal reverses both coefficients and gives $-II$; the choice must therefore accompany an answer for the <second fundamental form>.

The <Gaussian curvature> is unchanged by that reversal:
$$
\boxed{K=\frac{eg-f^2}{EG-F^2}=\frac{\cos u}{b(a+b\cos u)}.}
$$
Since the denominator is positive, $K>0$ on the outside of the <torus>, where $\cos u>0$, and $K<0$ on its inner side, where $\cos u<0$. It vanishes on the two circles $u=\pi/2,3\pi/2$. This is the <Gaussian curvature of a ring torus>.