Problem 4:

x={t,r,θ,ϕ};

(metric={{-(1-2*G*M/r+G*G*Q*Q/(r*r)),0,0,0},{0,1/(1-2*G*M/r+G*G*Q*Q/(r*r)),0,0},{0,0,r*r,0},{0,0,0,r*r*Sin[θ]^2} })//MatrixForm

(b)

Riemannlower[metric_,x_]:=
  Block[ {Dim, Riem, Riemannlower, a, b, i, k, j},
          Dim = Length[x];
          Riem = Riemann[metric,x];
          Riemannlower = Table[ Sum[metric[[b,a]]*Riem[[a,i,j,k]], {a,Dim}],
                         {b,Dim},{i,Dim}, {j,Dim} , {k,Dim}];
          Simplify[Riemannlower] ]

RLower=Riemannlower[metric,x];

inverseMetric=Inverse[metric];

RUpper=Dot[RLower,inverseMetric,inverseMetric,inverseMetric];

Summing[RUpper,RLower]:=
Block[{curvature,Summing,a,b,c,d},
curvature=Sum[RLower[[a,b,c,d]]*RUpper[[a,b,c,d]],{a,4},{b,4},{c,4},{d,4}];
Simplify[curvature]]

Summing[RUpper,RLower]

(c)

EinsteinTensor[metric,x]

(kmetric={{-(1-2*G*M*r/(r^2+(L^2/M^2)*Cos[θ]^2)),0,0,(-2*G*L*r*Sin[θ]^2)/(r^2+(L^2/M^2)*Cos[θ]^2)},{0,(r^2+(L^2/M^2)*Cos[θ]^2)/(r^2-2*G*M*r+L^2/M^2),0,0},{0,0,(r^2+(L^2/M^2)*Cos[θ]^2),0},{(-2*G*L*r*Sin[θ]^2)/(r^2+(L^2/M^2)*Cos[θ]^2),0,0,(Sin[θ]^2/(r^2+(L^2/M^2)*Cos[θ]*Cos[θ]))*((r^2+L^2/M^2)^2-(L^2/M^2)*(r^2-2*G*M*r+L^2/M^2)*(Sin[θ]^2))} })//MatrixForm

EinsteinTensor[kmetric,x]