Schwarzschild solution using isotropic spherical coordinates

Defining coordinates, the metric, connection, Ricci and Einstein tensors

(* we define our coordinates *)
X={t,r,θ,ϕ};

(* metric components *)
g={{-Exp[A[r]],0,0,0},{0,Exp[B[r]],0,0},{0,0,Exp[B[r]]r^2,0},{0,0,0,Exp[B[r]]r^2 Sin[θ]^2}};

(* inverse metric *)
gup=Simplify[Inverse[g]];

(* here we display the metric and inverse metric in matrix form *)
MatrixForm[g]
MatrixForm[gup]

(* Christoffel symbol Γ_mn^c, the first two indices are the lower one, the final index is the upper index. Ricci tensor is defined with two lower indices *)
Chr=Table[Sum[1/2*gup[[c,d]](D[g[[d,m]],X[[n]]]+D[g[[n,d]],X[[m]]]-D[g[[m,n]],X[[d]]]),{d,1,4}],{m,1,4},{n,1,4},{c,1,4}];
(* Riemann tensor R_adf^b *)
Riemann=Table[
D[Chr[[a,f,b]],X[[d]]]-
D[Chr[[d,f,b]],X[[a]]]+
Sum[Chr[[d,s,b]]*Chr[[a,f,s]],{s,1,4}]-
Sum[Chr[[a,s,b]]*Chr[[d,f,s]],{s,1,4}],{a,1,4},{d,1,4},{f,1,4},{b,1,4}];
Ricci=Table[Sum[Riemann[[aa,bb,cc,bb]],{bb,1,4}],{aa,1,4},{cc,1,4}];

(* Here we finally define the Ricci scalar and the Einstein tensor *)
Ricciscalar=Sum[gup[[q,b]]Ricci[[q,b]],{q,1,4},{b,1,4}];
G=Simplify[Table[Ricci[[m,n]]-1/2*g[[m,n]]*Ricciscalar,{m,1,4},{n,1,4}]];

The Einstein field equations

(* We compute the entire set of Einstein field equations, these are 10 equations in total, however, only two equations are independent in this case *)
Clear[r]
G/.x^2+y^2+z^2->r^2//PowerExpand//FullSimplify

(* We select two components of the Einstein tensor to solve the field equations and slightly modify the equations for easier subsequent use *)
eqn1=G[[1,1]]r/(E^(A[r]-B[r]));
eqn2=G[[2,2]]r;

(* the first field equation only depends on B and hence we solve this *)
DSolve[eqn1==0,B[r],r,GeneratedParameters->CC]/.CC[2]->Log[CC[2]]
(* we replace the default constant of integration by something more suitable *)

B[r_]:=-4 (Log[r]-Log[1-4 r CC[1]])+Log[CC[2]]

(* we can now add up the first and second equation *)
DSolve[eqn2==0,A[r],r,GeneratedParameters->DD]

The isotropic Schwarzschild solution

(* we now use the found solution and look at the resulting metric *)
A[r_]:=DD[1]+16 CC[1] (-((Log[1-4 r CC[1]])/(8 CC[1]))+((Log[1+4 r CC[1]])/(8 CC[1])));

gisocomputed=Simplify[g]/.DD[1]->0/.CC[1]->-1/M/2/.CC[2]->(M/2)^4//Simplify

(* this is the form of our computed metric g in isotropic coordinates, however, it is not clear whether or not this matches equation (3.22) which we will now check *)

(* this is the result (3.22) from the book, in spherical coordinates *)
giso={{-(1-M/2/r)^2/(1+M/2/r)^2,0,0,0},{0,(1+M/2/r)^4,0,0},{0,0,(1+M/2/r)^4 r^2 ,0},{0,0,0,(1+M/2/r)^4 r^2 Sin[θ]^2}};

gisocomputed==giso//Simplify