# How to compute curvature tensors for general n-dimensions?

I keep coming across calculations like this,

Consider a metric on an $n+2$ dimensional manifold given as,

$ds^2 = 2dudr + 2L(u,r)du^2 -r^2d\Omega_n^2$

Then apparently once can write down the Ricci and Einstein and other tensors as a function of n.

Like for the above the Einstein tensor apparently has the following non-zero components,

$G_{01} = \frac{n}{r}L_r+\frac{n(n-1)(2L-1)}{2r^2}$

$G_{22} = (n-1)[(2L-1)(\frac{2-n}{2})-2rL_r]-r^2L_{rr}$

$G_{00} = -\frac{nL_u}{r} + \frac{2nLL_r}{r} + \frac{n(n-1)L(2L-1)}{r^2}$

and $G^2_2 = G^3_3 = ... = G^{n+1}_{n+1}$

(where the subscripts of L denote partial derivatives with respect to those variables)

For a fixed given n I can imagine doing the calculation either by hand or some software but I would like to know who these expressions are derived for a general n.

-

Your given metric is in the form of a warped product, for which there are some well established methods of computing the curvature of the total space in terms of the curvature of the warp factors. See, for example, Barrett O'Neill's Semi-Riemannian Geometry, Chapter 7. For the first factor (given by $u$ and $r$), it being two dimensional, you can just use the standard results for surfaces on its intrinsic curvature.