Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Project: BHLectures
Views: 85
Kernel: SageMath 9.5.beta5

Solving Einstein equation to get Kottler solution

This Jupyter/SageMath notebook is relative to the lectures Geometry and physics of black holes. It involves computations based on differential geometry tools developed through the SageManifolds project.

version()
'SageMath version 9.5.beta5, Release Date: 2021-10-28'

First we set up the notebook to display mathematical objects using LaTeX formatting:

%display latex

Spacetime

We declare the spacetime manifold MM:

M = Manifold(4, 'M') print(M)
4-dimensional differentiable manifold M

We declare the chart of spherical coordinates (t,r,θ,ϕ)(t,r,\theta,\phi):

X.<t,r,th,ph> = M.chart(r't r:(0,+oo) th:(0,pi):\theta ph:(0,2*pi):\phi') X
(M,(t,r,θ,ϕ))\renewcommand{\Bold}[1]{\mathbf{#1}}\left(M,(t, r, {\theta}, {\phi})\right)

The static and spherically symmetric metric ansatz, with the unknown functions A(r)A(r) and B(r)B(r):

g = M.lorentzian_metric('g') A = function('A') B = function('B') g[0,0] = -A(r) g[1,1] = B(r) g[2,2] = r^2 g[3,3] = (r*sin(th))^2 g.display()
g=A(r)dtdt+B(r)drdr+r2dθdθ+r2sin(θ)2dϕdϕ\renewcommand{\Bold}[1]{\mathbf{#1}}g = -A\left(r\right) \mathrm{d} t\otimes \mathrm{d} t + B\left(r\right) \mathrm{d} r\otimes \mathrm{d} r + r^{2} \mathrm{d} {\theta}\otimes \mathrm{d} {\theta} + r^{2} \sin\left({\theta}\right)^{2} \mathrm{d} {\phi}\otimes \mathrm{d} {\phi}

The Christoffel symbols of gg, with respect to the default chart:

g.christoffel_symbols_display()
Γttrttr=Ar2A(r)Γrttrtt=Ar2B(r)Γrrrrrr=Br2B(r)Γrθθrθθ=rB(r)Γrϕϕrϕϕ=rsin(θ)2B(r)Γθrθθrθ=1rΓθϕϕθϕϕ=cos(θ)sin(θ)Γϕrϕϕrϕ=1rΓϕθϕϕθϕ=cos(θ)sin(θ)\renewcommand{\Bold}[1]{\mathbf{#1}}\begin{array}{lcl} \Gamma_{ \phantom{\, t} \, t \, r }^{ \, t \phantom{\, t} \phantom{\, r} } & = & \frac{\frac{\partial\,A}{\partial r}}{2 \, A\left(r\right)} \\ \Gamma_{ \phantom{\, r} \, t \, t }^{ \, r \phantom{\, t} \phantom{\, t} } & = & \frac{\frac{\partial\,A}{\partial r}}{2 \, B\left(r\right)} \\ \Gamma_{ \phantom{\, r} \, r \, r }^{ \, r \phantom{\, r} \phantom{\, r} } & = & \frac{\frac{\partial\,B}{\partial r}}{2 \, B\left(r\right)} \\ \Gamma_{ \phantom{\, r} \, {\theta} \, {\theta} }^{ \, r \phantom{\, {\theta}} \phantom{\, {\theta}} } & = & -\frac{r}{B\left(r\right)} \\ \Gamma_{ \phantom{\, r} \, {\phi} \, {\phi} }^{ \, r \phantom{\, {\phi}} \phantom{\, {\phi}} } & = & -\frac{r \sin\left({\theta}\right)^{2}}{B\left(r\right)} \\ \Gamma_{ \phantom{\, {\theta}} \, r \, {\theta} }^{ \, {\theta} \phantom{\, r} \phantom{\, {\theta}} } & = & \frac{1}{r} \\ \Gamma_{ \phantom{\, {\theta}} \, {\phi} \, {\phi} }^{ \, {\theta} \phantom{\, {\phi}} \phantom{\, {\phi}} } & = & -\cos\left({\theta}\right) \sin\left({\theta}\right) \\ \Gamma_{ \phantom{\, {\phi}} \, r \, {\phi} }^{ \, {\phi} \phantom{\, r} \phantom{\, {\phi}} } & = & \frac{1}{r} \\ \Gamma_{ \phantom{\, {\phi}} \, {\theta} \, {\phi} }^{ \, {\phi} \phantom{\, {\theta}} \phantom{\, {\phi}} } & = & \frac{\cos\left({\theta}\right)}{\sin\left({\theta}\right)} \end{array}

Einstein equation

The cosmological constant:

Lamb = var('Lamb', latex_name=r'\Lambda') Lamb
Λ\renewcommand{\Bold}[1]{\mathbf{#1}}{\Lambda}

The Einstein equation:

EE = g.ricci() - 1/2*g.ricci_scalar()*g + Lamb*g EE.set_name('E') print(EE)
Field of symmetric bilinear forms E on the 4-dimensional differentiable manifold M
EE.display_comp()
Etttt=(Λr21)A(r)B(r)2rA(r)Br+A(r)B(r)r2B(r)2Errrr=(Λr21)A(r)B(r)+rAr+A(r)r2A(r)Eθθθθ=4Λr2A(r)2B(r)2r2B(r)(Ar)2+2r2A(r)B(r)2Ar2+2rA(r)B(r)Ar(r2A(r)Ar+2rA(r)2)Br4A(r)2B(r)2Eϕϕϕϕ=(4Λr2A(r)2B(r)2r2B(r)(Ar)2+2r2A(r)B(r)2Ar2+2rA(r)B(r)Ar(r2A(r)Ar+2rA(r)2)Br)sin(θ)24A(r)2B(r)2\renewcommand{\Bold}[1]{\mathbf{#1}}\begin{array}{lcl} E_{ \, t \, t }^{ \phantom{\, t}\phantom{\, t} } & = & -\frac{{\left({\Lambda} r^{2} - 1\right)} A\left(r\right) B\left(r\right)^{2} - r A\left(r\right) \frac{\partial\,B}{\partial r} + A\left(r\right) B\left(r\right)}{r^{2} B\left(r\right)^{2}} \\ E_{ \, r \, r }^{ \phantom{\, r}\phantom{\, r} } & = & \frac{{\left({\Lambda} r^{2} - 1\right)} A\left(r\right) B\left(r\right) + r \frac{\partial\,A}{\partial r} + A\left(r\right)}{r^{2} A\left(r\right)} \\ E_{ \, {\theta} \, {\theta} }^{ \phantom{\, {\theta}}\phantom{\, {\theta}} } & = & \frac{4 \, {\Lambda} r^{2} A\left(r\right)^{2} B\left(r\right)^{2} - r^{2} B\left(r\right) \left(\frac{\partial\,A}{\partial r}\right)^{2} + 2 \, r^{2} A\left(r\right) B\left(r\right) \frac{\partial^2\,A}{\partial r ^ 2} + 2 \, r A\left(r\right) B\left(r\right) \frac{\partial\,A}{\partial r} - {\left(r^{2} A\left(r\right) \frac{\partial\,A}{\partial r} + 2 \, r A\left(r\right)^{2}\right)} \frac{\partial\,B}{\partial r}}{4 \, A\left(r\right)^{2} B\left(r\right)^{2}} \\ E_{ \, {\phi} \, {\phi} }^{ \phantom{\, {\phi}}\phantom{\, {\phi}} } & = & \frac{{\left(4 \, {\Lambda} r^{2} A\left(r\right)^{2} B\left(r\right)^{2} - r^{2} B\left(r\right) \left(\frac{\partial\,A}{\partial r}\right)^{2} + 2 \, r^{2} A\left(r\right) B\left(r\right) \frac{\partial^2\,A}{\partial r ^ 2} + 2 \, r A\left(r\right) B\left(r\right) \frac{\partial\,A}{\partial r} - {\left(r^{2} A\left(r\right) \frac{\partial\,A}{\partial r} + 2 \, r A\left(r\right)^{2}\right)} \frac{\partial\,B}{\partial r}\right)} \sin\left({\theta}\right)^{2}}{4 \, A\left(r\right)^{2} B\left(r\right)^{2}} \end{array}

Simplifying and rearranging the equations

eq0 = EE[0,0]*r^2*B(r)^2/A(r); eq0
(Λr21)A(r)B(r)2rA(r)Br+A(r)B(r)A(r)\renewcommand{\Bold}[1]{\mathbf{#1}}-\frac{{\left({\Lambda} r^{2} - 1\right)} A\left(r\right) B\left(r\right)^{2} - r A\left(r\right) \frac{\partial\,B}{\partial r} + A\left(r\right) B\left(r\right)}{A\left(r\right)}
eq1 = EE[1,1]*r^2*A(r); eq1
(Λr21)A(r)B(r)+rAr+A(r)\renewcommand{\Bold}[1]{\mathbf{#1}}{\left({\Lambda} r^{2} - 1\right)} A\left(r\right) B\left(r\right) + r \frac{\partial\,A}{\partial r} + A\left(r\right)
eq2 = EE[2,2]*4*A(r)^2*B(r)^2; eq2
4Λr2A(r)2B(r)2r2B(r)(Ar)2+2r2A(r)B(r)2Ar2+2rA(r)B(r)Ar(r2A(r)Ar+2rA(r)2)Br\renewcommand{\Bold}[1]{\mathbf{#1}}4 \, {\Lambda} r^{2} A\left(r\right)^{2} B\left(r\right)^{2} - r^{2} B\left(r\right) \left(\frac{\partial\,A}{\partial r}\right)^{2} + 2 \, r^{2} A\left(r\right) B\left(r\right) \frac{\partial^2\,A}{\partial r ^ 2} + 2 \, r A\left(r\right) B\left(r\right) \frac{\partial\,A}{\partial r} - {\left(r^{2} A\left(r\right) \frac{\partial\,A}{\partial r} + 2 \, r A\left(r\right)^{2}\right)} \frac{\partial\,B}{\partial r}
eq3 = EE[3,3]*4*A(r)^2*B(r)^2/sin(th)^2; eq3
4Λr2A(r)2B(r)2r2B(r)(Ar)2+2r2A(r)B(r)2Ar2+2rA(r)B(r)Ar(r2A(r)Ar+2rA(r)2)Br\renewcommand{\Bold}[1]{\mathbf{#1}}4 \, {\Lambda} r^{2} A\left(r\right)^{2} B\left(r\right)^{2} - r^{2} B\left(r\right) \left(\frac{\partial\,A}{\partial r}\right)^{2} + 2 \, r^{2} A\left(r\right) B\left(r\right) \frac{\partial^2\,A}{\partial r ^ 2} + 2 \, r A\left(r\right) B\left(r\right) \frac{\partial\,A}{\partial r} - {\left(r^{2} A\left(r\right) \frac{\partial\,A}{\partial r} + 2 \, r A\left(r\right)^{2}\right)} \frac{\partial\,B}{\partial r}
eq3 == eq2
True\renewcommand{\Bold}[1]{\mathbf{#1}}\mathrm{True}

Solving Einstein equation

The following combination of eq0 and eq1 is particularly simple:

eq4 = (eq0*A(r) + eq1*B(r))/r; eq4
rB(r)Ar+rA(r)Brr\renewcommand{\Bold}[1]{\mathbf{#1}}\frac{r B\left(r\right) \frac{\partial\,A}{\partial r} + r A\left(r\right) \frac{\partial\,B}{\partial r}}{r}

The solution is A(r)B(r)=CA(r)B(r)=C, where CC is a constant:

s = desolve(eq4.expr() == 0, B(r), ivar=r) s
CA(r)\renewcommand{\Bold}[1]{\mathbf{#1}}\frac{C}{A\left(r\right)}

Let us rename the constant to α\alpha:

var('alpha', latex_name=r'\alpha') B_sol(r) = s.subs(_C=alpha); B_sol
r  αA(r)\renewcommand{\Bold}[1]{\mathbf{#1}}r \ {\mapsto}\ \frac{{\alpha}}{A\left(r\right)}

We replace B(r)B(r) by the above value in the remaining equations:

eq5 = X.function(eq1.expr().substitute_function(B, B_sol)); eq5
(Λr21)α+rAr+A(r)\renewcommand{\Bold}[1]{\mathbf{#1}}{\left({\Lambda} r^{2} - 1\right)} {\alpha} + r \frac{\partial\,A}{\partial r} + A\left(r\right)
eq6 = X.function(eq2.expr().substitute_function(B, B_sol)); eq6
4Λα2r2αr2(Ar)2A(r)+2αr22Ar2+2αrAr+(r2A(r)Ar+2rA(r)2)αArA(r)2\renewcommand{\Bold}[1]{\mathbf{#1}}4 \, {\Lambda} {\alpha}^{2} r^{2} - \frac{{\alpha} r^{2} \left(\frac{\partial\,A}{\partial r}\right)^{2}}{A\left(r\right)} + 2 \, {\alpha} r^{2} \frac{\partial^2\,A}{\partial r ^ 2} + 2 \, {\alpha} r \frac{\partial\,A}{\partial r} + \frac{{\left(r^{2} A\left(r\right) \frac{\partial\,A}{\partial r} + 2 \, r A\left(r\right)^{2}\right)} {\alpha} \frac{\partial\,A}{\partial r}}{A\left(r\right)^{2}}

Let us solve eq5 for A(r)A(r). Note that we are using eq5.expr() to get a symbolic expression, as expected by the function desolve, while eq5 is a coordinate function.

s = desolve(eq5.expr() == 0, A(r), ivar=r) s.expand()
13Λαr2+α+Cr\renewcommand{\Bold}[1]{\mathbf{#1}}-\frac{1}{3} \, {\Lambda} {\alpha} r^{2} + {\alpha} + \frac{C}{r}

We rename the constant CC to 2m-2m and set the value of constant α\alpha to 11:

var('m') A_sol(r) = s.subs(_C=-2*m, alpha=1).expand() A_sol
r  13Λr22mr+1\renewcommand{\Bold}[1]{\mathbf{#1}}r \ {\mapsto}\ -\frac{1}{3} \, {\Lambda} r^{2} - \frac{2 \, m}{r} + 1

Let us check that eq6 is fulfilled by the found value of A(r)A(r):

eq6.expr().substitute_function(A, A_sol).subs(alpha=1).simplify_full()
0\renewcommand{\Bold}[1]{\mathbf{#1}}0

Final expression of the metric

We have got the Kottler metric:

g[0,0] = -A_sol(r) g[1,1] = 1/A_sol(r) g.display()
g=(13Λr2+2mr1)dtdt+(3Λr2+6mr3)drdr+r2dθdθ+r2sin(θ)2dϕdϕ\renewcommand{\Bold}[1]{\mathbf{#1}}g = \left( \frac{1}{3} \, {\Lambda} r^{2} + \frac{2 \, m}{r} - 1 \right) \mathrm{d} t\otimes \mathrm{d} t + \left( -\frac{3}{{\Lambda} r^{2} + \frac{6 \, m}{r} - 3} \right) \mathrm{d} r\otimes \mathrm{d} r + r^{2} \mathrm{d} {\theta}\otimes \mathrm{d} {\theta} + r^{2} \sin\left({\theta}\right)^{2} \mathrm{d} {\phi}\otimes \mathrm{d} {\phi}

which reduces to Schwarzschild metric as soon as the cosmological constant vanishes.

g.christoffel_symbols_display()
Γttrttr=Λr33mΛr4+6mr3r2Γrttrtt=Λ2r6+3Λmr33Λr418m2+9mr9r3Γrrrrrr=Λr33mΛr4+6mr3r2Γrθθrθθ=13Λr3+2mrΓrϕϕrϕϕ=13(Λr3+6m3r)sin(θ)2Γθrθθrθ=1rΓθϕϕθϕϕ=cos(θ)sin(θ)Γϕrϕϕrϕ=1rΓϕθϕϕθϕ=cos(θ)sin(θ)\renewcommand{\Bold}[1]{\mathbf{#1}}\begin{array}{lcl} \Gamma_{ \phantom{\, t} \, t \, r }^{ \, t \phantom{\, t} \phantom{\, r} } & = & \frac{{\Lambda} r^{3} - 3 \, m}{{\Lambda} r^{4} + 6 \, m r - 3 \, r^{2}} \\ \Gamma_{ \phantom{\, r} \, t \, t }^{ \, r \phantom{\, t} \phantom{\, t} } & = & \frac{{\Lambda}^{2} r^{6} + 3 \, {\Lambda} m r^{3} - 3 \, {\Lambda} r^{4} - 18 \, m^{2} + 9 \, m r}{9 \, r^{3}} \\ \Gamma_{ \phantom{\, r} \, r \, r }^{ \, r \phantom{\, r} \phantom{\, r} } & = & -\frac{{\Lambda} r^{3} - 3 \, m}{{\Lambda} r^{4} + 6 \, m r - 3 \, r^{2}} \\ \Gamma_{ \phantom{\, r} \, {\theta} \, {\theta} }^{ \, r \phantom{\, {\theta}} \phantom{\, {\theta}} } & = & \frac{1}{3} \, {\Lambda} r^{3} + 2 \, m - r \\ \Gamma_{ \phantom{\, r} \, {\phi} \, {\phi} }^{ \, r \phantom{\, {\phi}} \phantom{\, {\phi}} } & = & \frac{1}{3} \, {\left({\Lambda} r^{3} + 6 \, m - 3 \, r\right)} \sin\left({\theta}\right)^{2} \\ \Gamma_{ \phantom{\, {\theta}} \, r \, {\theta} }^{ \, {\theta} \phantom{\, r} \phantom{\, {\theta}} } & = & \frac{1}{r} \\ \Gamma_{ \phantom{\, {\theta}} \, {\phi} \, {\phi} }^{ \, {\theta} \phantom{\, {\phi}} \phantom{\, {\phi}} } & = & -\cos\left({\theta}\right) \sin\left({\theta}\right) \\ \Gamma_{ \phantom{\, {\phi}} \, r \, {\phi} }^{ \, {\phi} \phantom{\, r} \phantom{\, {\phi}} } & = & \frac{1}{r} \\ \Gamma_{ \phantom{\, {\phi}} \, {\theta} \, {\phi} }^{ \, {\phi} \phantom{\, {\theta}} \phantom{\, {\phi}} } & = & \frac{\cos\left({\theta}\right)}{\sin\left({\theta}\right)} \end{array}

Let us check that the vacuum Einstein equation is satisfied by the above metric:

EE = g.ricci() - 1/2*g.ricci_scalar()*g + Lamb*g EE.set_name('E') EE.display()
E=0\renewcommand{\Bold}[1]{\mathbf{#1}}E = 0

The Ricci scalar is constant for this solution:

g.ricci_scalar().display()
r(g):MR(t,r,θ,ϕ)4Λ\renewcommand{\Bold}[1]{\mathbf{#1}}\begin{array}{llcl} \mathrm{r}\left(g\right):& M & \longrightarrow & \mathbb{R} \\ & \left(t, r, {\theta}, {\phi}\right) & \longmapsto & 4 \, {\Lambda} \end{array}

The Ricci tensor is proportional to the metric tensor:

g.ricci().display()
Ric(g)=(Λ2r3+6Λm3Λr3r)dtdt+(3ΛrΛr3+6m3r)drdr+Λr2dθdθ+Λr2sin(θ)2dϕdϕ\renewcommand{\Bold}[1]{\mathbf{#1}}\mathrm{Ric}\left(g\right) = \left( \frac{{\Lambda}^{2} r^{3} + 6 \, {\Lambda} m - 3 \, {\Lambda} r}{3 \, r} \right) \mathrm{d} t\otimes \mathrm{d} t + \left( -\frac{3 \, {\Lambda} r}{{\Lambda} r^{3} + 6 \, m - 3 \, r} \right) \mathrm{d} r\otimes \mathrm{d} r + {\Lambda} r^{2} \mathrm{d} {\theta}\otimes \mathrm{d} {\theta} + {\Lambda} r^{2} \sin\left({\theta}\right)^{2} \mathrm{d} {\phi}\otimes \mathrm{d} {\phi}
g.ricci() == Lamb * g
True\renewcommand{\Bold}[1]{\mathbf{#1}}\mathrm{True}