Scalar curvature calculating problem I have a problem understanding calculating Ricci and scalar curvature.
By definition: for every $p \in M$ and $x,y \in T_pM$ with respect to any orthonormal basis {$e_1..e_n$} Ricci curvature is
$$Ric(x,y)=\sum_{j=1}^{n} g(R(e_j,x)y,e_j)$$
And scalar curvature is
$$\tau(p)=\sum_{j=1}^{n} Ric(e_j,e_j)$$
For example, Riemannian metric $g$ on torus is given with $ds^2=dx^2+(3+\cos(x))^2dy^2$.
After calculating Christoffel symbols I have: $\Gamma_{12}^{2}=- \frac{\sin(x)}{3+\cos(x)}$, $\Gamma_{22}^{1}=\sin(x)(3+\cos(x))$ and others are zero.
Calculating gives: $$R(e_1,e_1)=g(\frac{\cos(x)}{3+\cos(x)}e_1,e_1)$$
$$R(e_2,e_2)=g(\cos(x)(3+\cos(x))e_2,e_2)$$ and for orthonormal basis $g(e_j,e_j)=1$ so
$$\tau(p)=R(e_1,e_1)+R(e_2,e_2)=\frac{\cos(x)}{3+\cos(x)}+\cos(x)(3+\cos(x))$$ and this have be twice as Gaussian curvature, but it isn't. It looks like term $\cos(x)(3+\cos(x))$ should be multipled with $g^{22}$ but why?
 A: Your Ricci tensor is correctly computed. However, you've computed your scalar curvature wrongly since your definition of scalar curvature lacks the inverse of the metric (note that the basis that you are trying to compute your scalar curvature on is not orthonormal but just orthogonal). More accurately, in matrix format, the scalar curvature is
$$S = \mathrm{tr}\left(\mathbf{I}^{-1}\,\mathrm{Ricci}\right).$$
which each of the above matrices is computed as follows
$$\mathrm{Ricci} = \left[ \begin {array}{cc} {\frac {\cos \left( x \right) }{3+
\cos \left( x \right) }}&0\\ 0& \left( 3+\cos
 \left(x \right)  \right) \cos \left( x \right) 
\end {array} \right],\quad\quad
\mathbf{I}^{-1} = \left[ \begin {array}{cc} 1&0\\ 0& \left( 3+\cos
 \left( x \right)  \right) ^{-2}\end {array} \right]
$$
Now, calculating their multiplication according to the first formula gives
$${\frac {2\cos \left( x \right) }{3+\cos \left( x \right) }}$$
which is exactly two times the Gaussian curvature ${\frac {\cos \left( x \right) }{3+\cos \left( x \right) }}$.
