\documentclass{article}

%% Created with wxMaxima 13.04.2

\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage[utf8]{inputenc}
\usepackage[english,russian]{babel}
\usepackage{graphicx}
\usepackage{color}
\usepackage{amsmath}

\definecolor{labelcolor}{RGB}{100,0,0}

\begin{document}

\pagebreak{}
{\Huge {\sc Пример использования пакета wxMaxima
 для иллюстрации вывода метрик
 Шварцшильда и Рейсcнера-Нордстрёма}}
\setcounter{section}{0}
\setcounter{subsection}{0}
\setcounter{figure}{0}



\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i1)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
kill(all);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o0) }
done
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i1)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
load(ctensor);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o1) }
C:/PROGRA~1/MAXIMA~1.0/share/maxima/5.30.0/share/tensor/ctensor.mac
\end{math}
%%%%%%%%%%%%%%%

можно воспользоваться функцией csetup

\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i2)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
csetup();
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
Enter the dimension of the coordinate system:4;Do you wish to change the coordinate names?y;Enter a list containing the names of the coordinates in order[t,r,theta,phi];Do you want to1. Enter a new metric?2. Enter a metric from a file?3. Approximate a metric with a Taylor series?1;Is the matrix  1. Diagonal  2. Symmetric  3. Antisymmetric  4. GeneralAnswer 1, 2, 3 or 4 : 1;Row 1 Column 1: B;Row 2 Column 2: -A;Row 3 Column 3: -r^2;Row 4 Column 4: -r^2*sin(theta)^2;Matrix entered.Enter functional dependencies with DEPENDS or 'N' if nonedepends([A,B],[r]);Do you wish to see the metric?y;\begin{pmatrix}B & 0 & 0 & 0\cr 0 & -A & 0 & 0\cr 0 & 0 & -{r}^{2} & 0\cr 0 & 0 & 0 & -{r}^{2}\,{\mathrm{sin}\left( \theta\right) }^{2}\end{pmatrix}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o2) }
done
\end{math}
%%%%%%%%%%%%%%%

но лучше эти команды ввести вручную:

\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i3)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
kill(all);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o0) }
done
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i1)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
load(ctensor);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o1) }
C:/PROGRA~1/MAXIMA~1.0/share/maxima/5.30.0/share/tensor/ctensor.mac
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i2)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
ct_coords:[t,r,theta,phi];
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o2) }
[t,r,\theta,\phi]
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i3)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
depends([A,B],[r]);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o3) }
[\mathrm{A}\left( r\right) ,\mathrm{B}\left( r\right) ]
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i4)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
lg:matrix([B,0,0,0],[0,-A,0,0],[0,0,-r^2,0],[0,0,0,-r^2*sin(theta)^2]);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o4) }
\begin{pmatrix}B & 0 & 0 & 0\cr 0 & -A & 0 & 0\cr 0 & 0 & -{r}^{2} & 0\cr 0 & 0 & 0 & -{r}^{2}\,{\mathrm{sin}\left( \theta\right) }^{2}\end{pmatrix}
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i5)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
cmetric(true);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
Do you wish to see the metric inverse?y;
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t5) }
\begin{pmatrix}\frac{1}{B} & 0 & 0 & 0\cr 0 & -\frac{1}{A} & 0 & 0\cr 0 & 0 & -\frac{1}{{r}^{2}} & 0\cr 0 & 0 & 0 & -\frac{1}{{r}^{2}\,{\mathrm{sin}\left( \theta\right) }^{2}}\end{pmatrix}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o5) }
done
\end{math}
%%%%%%%%%%%%%%%

Символы Кристоффеля:

\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i6)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
christof(mcs);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t6) }
{mcs}_{1,1,2}=\frac{\frac{d}{d\,r}\,B}{2\,A}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t7) }
{mcs}_{1,2,1}=\frac{\frac{d}{d\,r}\,B}{2\,B}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t8) }
{mcs}_{2,2,2}=\frac{\frac{d}{d\,r}\,A}{2\,A}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t9) }
{mcs}_{2,3,3}=\frac{1}{r}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t10) }
{mcs}_{2,4,4}=\frac{1}{r}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t11) }
{mcs}_{3,3,2}=-\frac{r}{A}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t12) }
{mcs}_{3,4,4}=\frac{\mathrm{cos}\left( \theta\right) }{\mathrm{sin}\left( \theta\right) }
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t13) }
{mcs}_{4,4,2}=-\frac{r\,{\mathrm{sin}\left( \theta\right) }^{2}}{A}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t14) }
{mcs}_{4,4,3}=-\mathrm{cos}\left( \theta\right) \,\mathrm{sin}\left( \theta\right)
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o14) }
done
\end{math}
%%%%%%%%%%%%%%%

Ковариантные компоненты тензора Риччи:

\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i15)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
ricci(true);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t15) }
{ric}_{1,1}=\frac{\frac{{d}^{2}}{d\,{r}^{2}}\,B}{2\,A}-\frac{{\left( \frac{d}{d\,r}\,B\right) }^{2}}{4\,A\,B}-\frac{\left( \frac{d}{d\,r}\,A\right) \,\left( \frac{d}{d\,r}\,B\right) }{4\,{A}^{2}}+\frac{\frac{d}{d\,r}\,B}{r\,A}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t16) }
{ric}_{2,2}=-\frac{\frac{{d}^{2}}{d\,{r}^{2}}\,B}{2\,B}+\frac{{\left( \frac{d}{d\,r}\,B\right) }^{2}}{4\,{B}^{2}}+\frac{\left( \frac{d}{d\,r}\,A\right) \,\left( \frac{d}{d\,r}\,B\right) }{4\,A\,B}+\frac{\frac{d}{d\,r}\,A}{r\,A}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t17) }
{ric}_{3,3}=-\frac{r\,\left( \frac{d}{d\,r}\,B\right) }{2\,A\,B}+\frac{r\,\left( \frac{d}{d\,r}\,A\right) }{2\,{A}^{2}}-\frac{1}{A}+1
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t18) }
{ric}_{4,4}=-\frac{r\,{\mathrm{sin}\left( \theta\right) }^{2}\,\left( \frac{d}{d\,r}\,B\right) }{2\,A\,B}+\frac{r\,{\mathrm{sin}\left( \theta\right) }^{2}\,\left( \frac{d}{d\,r}\,A\right) }{2\,{A}^{2}}-\frac{{\mathrm{sin}\left( \theta\right) }^{2}}{A}+{\mathrm{sin}\left( \theta\right) }^{2}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o18) }
done
\end{math}
%%%%%%%%%%%%%%%

Смешанные компоненты тензора Риччи:

\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i19)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
uricci(true);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t19) }
{uric}_{1,1}=\frac{2\,r\,A\,B\,\left( \frac{{d}^{2}}{d\,{r}^{2}}\,B\right) -r\,A\,{\left( \frac{d}{d\,r}\,B\right) }^{2}+\left( 4\,A-r\,\left( \frac{d}{d\,r}\,A\right) \right) \,B\,\left( \frac{d}{d\,r}\,B\right) }{4\,r\,{A}^{2}\,{B}^{2}}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t20) }
{uric}_{2,2}=\frac{2\,r\,A\,B\,\left( \frac{{d}^{2}}{d\,{r}^{2}}\,B\right) -r\,A\,{\left( \frac{d}{d\,r}\,B\right) }^{2}-r\,\left( \frac{d}{d\,r}\,A\right) \,B\,\left( \frac{d}{d\,r}\,B\right) -4\,\left( \frac{d}{d\,r}\,A\right) \,{B}^{2}}{4\,r\,{A}^{2}\,{B}^{2}}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t21) }
{uric}_{3,3}=\frac{r\,A\,\left( \frac{d}{d\,r}\,B\right) +\left( -r\,\left( \frac{d}{d\,r}\,A\right) -2\,{A}^{2}+2\,A\right) \,B}{2\,{r}^{2}\,{A}^{2}\,B}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t22) }
{uric}_{4,4}=\frac{r\,A\,\left( \frac{d}{d\,r}\,B\right) +\left( -r\,\left( \frac{d}{d\,r}\,A\right) -2\,{A}^{2}+2\,A\right) \,B}{2\,{r}^{2}\,{A}^{2}\,B}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o22) }
done
\end{math}
%%%%%%%%%%%%%%%

Ковариантные компоненты тензора Эйнштейна:

\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i23)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
leinstein(true);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t23) }
{lein}_{1,1}=\frac{\left( r\,\left( \frac{d}{d\,r}\,A\right) +{A}^{2}-A\right) \,B}{{r}^{2}\,{A}^{2}}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t24) }
{lein}_{2,2}=\frac{r\,\left( \frac{d}{d\,r}\,B\right) +\left( 1-A\right) \,B}{{r}^{2}\,B}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t25) }
{lein}_{3,3}=\frac{r\,\left( 2\,r\,A\,B\,\left( \frac{{d}^{2}}{d\,{r}^{2}}\,B\right) -r\,A\,{\left( \frac{d}{d\,r}\,B\right) }^{2}+\left( 2\,A-r\,\left( \frac{d}{d\,r}\,A\right) \right) \,B\,\left( \frac{d}{d\,r}\,B\right) -2\,\left( \frac{d}{d\,r}\,A\right) \,{B}^{2}\right) }{4\,{A}^{2}\,{B}^{2}}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t26) }
{lein}_{4,4}=\frac{r\,{\mathrm{sin}\left( \theta\right) }^{2}\,\left( 2\,r\,A\,B\,\left( \frac{{d}^{2}}{d\,{r}^{2}}\,B\right) -r\,A\,{\left( \frac{d}{d\,r}\,B\right) }^{2}+\left( 2\,A-r\,\left( \frac{d}{d\,r}\,A\right) \right) \,B\,\left( \frac{d}{d\,r}\,B\right) -2\,\left( \frac{d}{d\,r}\,A\right) \,{B}^{2}\right) }{4\,{A}^{2}\,{B}^{2}}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o26) }
done
\end{math}
%%%%%%%%%%%%%%%

Смешанные компоненты тензора Эйнштейна:

\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i27)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
einstein(true);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t27) }
{ein}_{1,1}=\frac{r\,\left( \frac{d}{d\,r}\,A\right) +{A}^{2}-A}{{r}^{2}\,{A}^{2}}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t28) }
{ein}_{2,2}=-\frac{r\,\left( \frac{d}{d\,r}\,B\right) +\left( 1-A\right) \,B}{{r}^{2}\,A\,B}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t29) }
{ein}_{3,3}=-\frac{2\,r\,A\,B\,\left( \frac{{d}^{2}}{d\,{r}^{2}}\,B\right) -r\,A\,{\left( \frac{d}{d\,r}\,B\right) }^{2}+\left( 2\,A-r\,\left( \frac{d}{d\,r}\,A\right) \right) \,B\,\left( \frac{d}{d\,r}\,B\right) -2\,\left( \frac{d}{d\,r}\,A\right) \,{B}^{2}}{4\,r\,{A}^{2}\,{B}^{2}}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t30) }
{ein}_{4,4}=-\frac{2\,r\,A\,B\,\left( \frac{{d}^{2}}{d\,{r}^{2}}\,B\right) -r\,A\,{\left( \frac{d}{d\,r}\,B\right) }^{2}+\left( 2\,A-r\,\left( \frac{d}{d\,r}\,A\right) \right) \,B\,\left( \frac{d}{d\,r}\,B\right) -2\,\left( \frac{d}{d\,r}\,A\right) \,{B}^{2}}{4\,r\,{A}^{2}\,{B}^{2}}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o30) }
done
\end{math}
%%%%%%%%%%%%%%%

Статичное сферически-симметричное решение уравнения Эйнштейна без заряда

\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i31)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
ode2(ev(lein[1,1],theta=%pi/2),A,r);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o31) }
\mathrm{log}\left( A\right) -\mathrm{log}\left( A-1\right) =\mathrm{log}\left( r\right) +\%c
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i32)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
logcontract(%);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o32) }
\mathrm{log}\left( \frac{A}{A-1}\right) =\mathrm{log}\left( r\right) +\%c
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i33)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
solve(%,A);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o33) }
[A=\frac{{e}^{\%c}\,r}{{e}^{\%c}\,r-1}]
\end{math}
%%%%%%%%%%%%%%%

(будем пользоваться граничными условиями для определения констант,
при этом для удобства вычислений G=c=1)

\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i34)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
%,%c=-log(2*M);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o34) }
[A=\frac{r}{2\,\left( \frac{r}{2\,M}-1\right) \,M}]
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i35)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
A:%[1],%c=-log(2*M);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o35) }
A=\frac{r}{2\,\left( \frac{r}{2\,M}-1\right) \,M}
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i36)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
ode2(ev(lein[2,2],A),B,r);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o36) }
B=\%c\,{e}^{-2\,\left( \frac{\mathrm{log}\left( r\right) }{2\,M}-\frac{\mathrm{log}\left( r-2\,M\right) }{2\,M}\right) \,M}
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i37)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
logcontract(%);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o37) }
B=-\frac{\%c\,\left( 2\,M-r\right) }{r}
\end{math}
%%%%%%%%%%%%%%%

(Используем граничные условия AB=1, откуда найдём константу \%с. Затем полученное значение
подставим в правую часть уравнения выше, чтобы получить функцию В)

\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i38)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
B:ev(%,%c=rhs(solve(rhs(%)*rhs(A)=1,%c)[1]));
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o38) }
B=-\frac{2\,M-r}{r}
\end{math}
%%%%%%%%%%%%%%%

Проверим, удовлетворяют ли полученные функции А и В 3ему уравнению:

\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i39)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
factor(ev(ev(lein[3,3],A,B),diff));
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o39) }
0
\end{math}
%%%%%%%%%%%%%%%

Таким образом, метрический тензор Шварцшильда (1916)):

\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i40)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
lg:ev(lg,A,B);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o40) }
\begin{pmatrix}-\frac{2\,M-r}{r} & 0 & 0 & 0\cr 0 & -\frac{r}{2\,\left( \frac{r}{2\,M}-1\right) \,M} & 0 & 0\cr 0 & 0 & -{r}^{2} & 0\cr 0 & 0 & 0 & -{r}^{2}\,{\mathrm{sin}\left( \theta\right) }^{2}\end{pmatrix}
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i41)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
ug:invert(lg);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o41) }
\begin{pmatrix}-\frac{r}{2\,M-r} & 0 & 0 & 0\cr 0 & -\frac{2\,\left( \frac{r}{2\,M}-1\right) \,M}{r} & 0 & 0\cr 0 & 0 & -\frac{1}{{r}^{2}} & 0\cr 0 & 0 & 0 & -\frac{1}{{r}^{2}\,{\mathrm{sin}\left( \theta\right) }^{2}}\end{pmatrix}
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i42)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
wxplot3d([r*cos(th),r*sin(th),1-ev(ug[1,1],M:2)],[r,5,50],[th,-%pi,%pi]);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%t42) }
% \includegraphics[width=9cm]{Пример_img/Пример_1.png}
\includegraphics[width=9cm]{schwMaximaDerive_1.png}
\end{math}

\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o42) }
\end{math}
%%%%%%%%%%%%%%%

Выведем теперь метрику с учётом заряда. Будем считать,
 что тензор энергии-импульса уже известен
 (см. С.И. Глазырин, "Вывод метрики Керра-Ньюмана")

\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i1)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
kill(all);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o0) }
done
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i1)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
load(ctensor);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o1) }
C:/PROGRA~1/MAXIMA~1.0/share/maxima/5.30.0/share/tensor/ctensor.mac
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i2)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
ct_coords:[t,r,theta,phi];
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o2) }
[t,r,\theta,\phi]
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i3)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
depends([A,B],[r]);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o3) }
[\mathrm{A}\left( r\right) ,\mathrm{B}\left( r\right) ]
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i4)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
lg:matrix([B,0,0,0],[0,-A,0,0],[0,0,-r^2,0],[0,0,0,-r^2*sin(theta)^2]);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o4) }
\begin{pmatrix}B & 0 & 0 & 0\cr 0 & -A & 0 & 0\cr 0 & 0 & -{r}^{2} & 0\cr 0 & 0 & 0 & -{r}^{2}\,{\mathrm{sin}\left( \theta\right) }^{2}\end{pmatrix}
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i5)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
cmetric();
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o5) }
done
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i6)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
christof(false);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o6) }
done
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i7)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
uricci(false);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o7) }
done
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i8)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
einstein(false);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o8) }
done
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i9)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
solve(ode2(ein[1,1]=q^2/r^4,A,r),A);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o9) }
[A=\frac{{r}^{2}}{{r}^{2}-\%c\,r+{q}^{2}}]
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i10)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
%,%c=2*M;
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o10) }
[A=\frac{{r}^{2}}{-2\,r\,M+{r}^{2}+{q}^{2}}]
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i11)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
A:%[1],%c=2*M;
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o11) }
A=\frac{{r}^{2}}{-2\,r\,M+{r}^{2}+{q}^{2}}
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i12)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
solve(ode2(ev(ein[2,2],A)=q^2/r^4,B,r),B);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o12) }
[B=-\frac{2\,\%c\,r\,M-\%c\,{r}^{2}-\%c\,{q}^{2}}{{r}^{2}}]
\end{math}
%%%%%%%%%%%%%%%

(опять же из граничных условий)

\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i13)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
%,%c=1;
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o13) }
[B=-\frac{2\,r\,M-{r}^{2}-{q}^{2}}{{r}^{2}}]
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i14)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
B:%[1],%c=1;
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o14) }
B=-\frac{2\,r\,M-{r}^{2}-{q}^{2}}{{r}^{2}}
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i15)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
expand(B);
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o15) }
B=-\frac{2\,M}{r}+\frac{{q}^{2}}{{r}^{2}}+1
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i16)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
factor(ev(ev(ein[3,3]+q^2/r^4,A,B),diff));
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o16) }
0
\end{math}
%%%%%%%%%%%%%%%

Метрика Рейсснера (1916)-Нордстрёма (1918):

\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i17)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
lg:expand(ev(lg,A,B));
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o17) }
\begin{pmatrix}-\frac{2\,M}{r}+\frac{{q}^{2}}{{r}^{2}}+1 & 0 & 0 & 0\cr 0 & -\frac{{r}^{2}}{-2\,r\,M+{r}^{2}+{q}^{2}} & 0 & 0\cr 0 & 0 & -{r}^{2} & 0\cr 0 & 0 & 0 & -{r}^{2}\,{\mathrm{sin}\left( \theta\right) }^{2}\end{pmatrix}
\end{math}
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{8ex}{\color{red}\bf
\begin{verbatim}
(%i18)
\end{verbatim}}
\end{minipage}
\begin{minipage}[t]{\textwidth}{\color{blue}
\begin{verbatim}
ug:expand(invert(lg));
\end{verbatim}}
\end{minipage}
%%% OUTPUT:
\begin{math}\displaystyle
\parbox{8ex}{\color{labelcolor}(\%o18) }
\begin{pmatrix}\frac{1}{-\frac{2\,M}{r}+\frac{{q}^{2}}{{r}^{2}}+1} & 0 & 0 & 0\cr 0 & \frac{2\,M}{r}-\frac{{q}^{2}}{{r}^{2}}-1 & 0 & 0\cr 0 & 0 & -\frac{1}{{r}^{2}} & 0\cr 0 & 0 & 0 & -\frac{1}{{r}^{2}\,{\mathrm{sin}\left( \theta\right) }^{2}}\end{pmatrix}
\end{math}
%%%%%%%%%%%%%%%

\end{document}
