I am trying to check the Gauss-Bonnet theorem which says $$\iint_{S} K(\vec{r}) d S=4 \pi(1-g),$$ where $g$ is the genus. For a torus, $g=1$.
I am given a hint that I can get $K$ from the shape operator $$A(\vec{X})=-\left(X^{1} \hat{N}_{1}+X^{2} \hat{N}_{2}\right)$$ $$K\left(\vec{r}\left(u_{1}, u_{2}\right)\right)=\operatorname{det}\left([A]_{B}^{B}\right)$$ while $B$ is the basis for a tangent plane.
I think my main problem is to derive the curvature for the torus.
The parameterization of the torus can be written as follows: $$T(\varphi, \theta) = ((R+r\cos(\theta))\cos(\varphi), (R+r\cos(\theta))\sin(\varphi), r\sin(\theta))$$
Now consider a parameterization $T:U\rightarrow M$ for a regular surface $M$.Denote by $n$ the unit normal to the surface. I was given the following defition for the matrix $B$ that defines the second fundamental form:
$$\mathcal{S}= \begin{pmatrix} T''_{\varphi \varphi}\cdot n & T''_{\varphi \theta}\cdot n \\ T''_{\theta \varphi}\cdot n & T''_{\theta \theta}\cdot n \\ \end{pmatrix} $$ Also, given the following definition that defines the (matix version of the) Riemannian metric: $$g= \begin{pmatrix} T'_\varphi\cdot T'_\varphi & T'_\varphi\cdot r'_\theta \\ r'_\theta \cdot r'_\varphi & r'_\theta\cdot r'_\theta \\ \end{pmatrix} $$
These should be straight forward for you to calculate given the parameterization above.
Edit
Let $K$ be the Gauss curvature. You would like to compute $\iint_{T} K \: dA$. Remember that
$$ dA = \sqrt{EG-F^2} d \varphi \: d \theta = (R+r\cos \theta)\: d\varphi \:d\theta $$
Since you have already shown $$K = \frac{r\cos \theta}{r(R+r\cos \theta)}$$,
$$\iint_{T} K dA = \int_{0}^{2\pi} \int_{0}^{2\pi} \frac{r\cos \theta}{r(R+r\cos \theta)} \cdot r (R+r\cos \theta) \:d \varphi \: d\theta=\iint_{T} r\cos \theta \:d \varphi d\theta $$
Hopefully you can take this forward.