I am working from Sean Carroll's Spacetime and Geometry : An Introduction to General Relativity and have got to the geodesic equation. I wanted to test it on the surface of a sphere where I know that great circles are geodesics and is about the simplest non-trivial case I can think of.
Carroll derives the geodesic equation:
\begin{align}
\frac{d^2x^\sigma}{d\lambda^2}+\Gamma_{\mu\nu}^\sigma\frac{dx^\mu}{d\lambda}\frac{dx^\nu}{d\lambda}=0&\phantom {10000}(1)\nonumber
\end{align}##\Gamma_{\mu\nu}^\sigma## is the Christoffel symbol (torsion-free and metric compatible)
\begin{align}
\Gamma_{\mu\nu}^\sigma=\frac{1}{2}g^{\sigma\rho}\left(\partial_\mu g_{\nu\rho}+\partial_\nu g_{\rho\mu}-\partial_\rho g_{\mu\nu}\right)&\phantom {10000}(2)\nonumber
\end{align}In this case the indices are 0,1 and ##x^0=\phi## the colatitude (angle from north pole), ##\ x^1=\theta## , longitude. The metric and inverse metric are
\begin{align}
g_{\mu\nu}=\left(\begin{matrix}1&0\\0&\sin^2{\phi}\\\end{matrix}\right)\ \ ,\ \ g^{\mu\nu}=\left(\begin{matrix}1&0\\0&\sin^{-2}{\phi}\\\end{matrix}\right)&\phantom {10000}(3)\nonumber
\end{align}Those should give me equations for ## \phi,\theta## parameterized by ## \lambda##.
I now expand the second term in (1) for ## \sigma=1## and using the fact that ## \Gamma## is torsion-free (##\Gamma_{\mu\nu}^\sigma=\Gamma_{\nu\mu}^\sigma##).
\begin{align}
\Gamma_{\mu\nu}^1\frac{dx^\mu}{d\lambda}\frac{dx^\nu}{d\lambda}&=\Gamma_{00}^1\frac{dx^0}{d\lambda}\frac{dx^0}{d\lambda}+2\Gamma_{10}^1\frac{dx^1}{d\lambda}\frac{dx^0}{d\lambda}+\Gamma_{11}^1\frac{dx^1}{d\lambda}\frac{dx^1}{d\lambda}&\phantom {10000}(4)\nonumber\\
&=\Gamma_{00}^1\left(\frac{d\phi}{d\lambda}\right)^2+2\Gamma_{10}^1\frac{d\phi}{d\lambda}\frac{d\theta}{d\lambda}+\Gamma_{11}^1\left(\frac{d\theta}{d\lambda}\right)^2&\phantom {10000}(5)\nonumber
\end{align}using the metric and (2) and taking each ## \Gamma## in turn, many terms vanish because the metric components are constant or 0
\begin{align}
\Gamma_{00}^1&=\frac{1}{2}g^{1\rho}\left(\partial_0g_{0\rho}+\partial_0g_{\rho0}-\partial_\rho g_{00}\right)=g^{1\rho}\partial_0g_{0\rho}&\phantom {10000}(6)\nonumber\\
&=g^{10}\partial_0g_{00}+g^{11}\partial_0g_{01}=0&\phantom {10000}(7)\nonumber\\
2\Gamma_{10}^1&=g^{1\rho}\left(\partial_1g_{0\rho}+\partial_0g_{\rho1}-\partial_\rho g_{10}\right)=g^{1\rho}\partial_1g_{0\rho}+g^{1\rho}\partial_0g_{\rho1}&\phantom {10000}(8)\nonumber\\
&=g^{10}\partial_1g_{00}+g^{11}\partial_1g_{01}+g^{10}\partial_0g_{01}+g^{11}\partial_0g_{11}&\phantom {10000}(9)\nonumber\\
&=\frac{1}{\sin^2{\phi}}\frac{\partial}{\partial\phi}\left(\sin^2{\phi}\right)=\frac{2\sin{\phi}\cos{\phi}}{\sin^2{\phi}}=2\cot{\phi}&\phantom {10000}(10)\nonumber\\
\Gamma_{11}^1&=\frac{1}{2}g^{1\rho}\left(\partial_1g_{1\rho}+\partial_1g_{\rho1}-\partial_\rho g_{11}\right)=g^{1\rho}\partial_1g_{\rho1}-\frac{1}{2}g^{1\rho}\partial_\rho g_{11}&\phantom {10000}(11)\nonumber\\
&=g^{10}\partial_1g_{01}+g^{11}\partial_1g_{11}-\frac{1}{2}g^{10}\partial_0g_{11}-\frac{1}{2}g^{11}\partial_1g_{11}&\phantom {10000}(12)\nonumber\\
&=\frac{1}{2}\frac{1}{\sin^2{\phi}}\frac{\partial}{\partial\theta}\left(\sin^2{\phi}\right)=0&\phantom {10000}(13)\nonumber
\end{align}Putting the expressions for ## \Gamma## back into (5) we get
\begin{align}
\Gamma_{\mu\nu}^1\frac{dx^\mu}{d\lambda}\frac{dx^\nu}{d\lambda}&=2\cot{\phi}\frac{d\phi}{d\lambda}\frac{d\theta}{d\lambda}&\phantom {10000}(14)\nonumber
\end{align}Putting that back into (1) we have
\begin{align}
\frac{d^2\theta}{d\lambda^2}+2\cot{\phi}\frac{d\phi}{d\lambda}\frac{d\theta}{d\lambda}=0&\phantom {10000}(15)\nonumber
\end{align}I can use the same method to get a solution for ## \sigma=0##, but that's not relevant yet. Put together they show that lines of longitude are always geodesics as is the equator. So far so good… but
A great circle equation (which we know is a geodesic) can be written as
\begin{align}
\theta=\lambda\ \ ,\ \ \phi=\tan^{-1}{\left(\frac{C}{A\cos{\lambda}+B\sin{\lambda}}\right)}&\phantom {10000}(16)\nonumber
\end{align}where ## A,B,C## are constants depending on the start and end points. I calculated this and checked it against the slightly ambiguous Wolfram maths article at http://mathworld.wolfram.com/GreatCircle.html.
From (16) clearly
\begin{align}
\frac{d^2\theta}{d\lambda^2}=0&\phantom {10000}(17)\nonumber
\end{align}so the other term in (15) should always be zero. It is
\begin{align}
2\cot{\phi}\frac{d\phi}{d\lambda}\frac{d\theta}{d\lambda}=-2\frac{\left(B\cos{\lambda}-A\sin{\lambda}\right)\left(A\cos{\lambda}+B\sin{\lambda}\right)}{C^2+\left(A\cos{\lambda}+B\sin{\lambda}\right)^2}&\phantom {10000}(18)\nonumber
\end{align}which is not always zero! So something is wrong.
It's either
(15) which I have calculated in another way to check it or
(16) which I have also plotted and gives good results or
my differentiation of ##\frac{d\phi}{d\lambda}## which I checked with Symbolab: https://www.symbolab.com/solver/ordinary-differential-equation-calculator/?or=dym&query=%5Cfrac%7Bd%7D%7Bdx%7D(%5Carctan(%5Cfrac%7BC%7D%7BD%5Ccos(x)%2BB%5Csin(x)%7D))
Help! What has gone wrong?
On Physics Forums at https://www.physicsforums.com/threads/question-about-geodesic-on-sphere.975370/
Carroll derives the geodesic equation:
\begin{align}
\frac{d^2x^\sigma}{d\lambda^2}+\Gamma_{\mu\nu}^\sigma\frac{dx^\mu}{d\lambda}\frac{dx^\nu}{d\lambda}=0&\phantom {10000}(1)\nonumber
\end{align}##\Gamma_{\mu\nu}^\sigma## is the Christoffel symbol (torsion-free and metric compatible)
\begin{align}
\Gamma_{\mu\nu}^\sigma=\frac{1}{2}g^{\sigma\rho}\left(\partial_\mu g_{\nu\rho}+\partial_\nu g_{\rho\mu}-\partial_\rho g_{\mu\nu}\right)&\phantom {10000}(2)\nonumber
\end{align}In this case the indices are 0,1 and ##x^0=\phi## the colatitude (angle from north pole), ##\ x^1=\theta## , longitude. The metric and inverse metric are
\begin{align}
g_{\mu\nu}=\left(\begin{matrix}1&0\\0&\sin^2{\phi}\\\end{matrix}\right)\ \ ,\ \ g^{\mu\nu}=\left(\begin{matrix}1&0\\0&\sin^{-2}{\phi}\\\end{matrix}\right)&\phantom {10000}(3)\nonumber
\end{align}Those should give me equations for ## \phi,\theta## parameterized by ## \lambda##.
I now expand the second term in (1) for ## \sigma=1## and using the fact that ## \Gamma## is torsion-free (##\Gamma_{\mu\nu}^\sigma=\Gamma_{\nu\mu}^\sigma##).
\begin{align}
\Gamma_{\mu\nu}^1\frac{dx^\mu}{d\lambda}\frac{dx^\nu}{d\lambda}&=\Gamma_{00}^1\frac{dx^0}{d\lambda}\frac{dx^0}{d\lambda}+2\Gamma_{10}^1\frac{dx^1}{d\lambda}\frac{dx^0}{d\lambda}+\Gamma_{11}^1\frac{dx^1}{d\lambda}\frac{dx^1}{d\lambda}&\phantom {10000}(4)\nonumber\\
&=\Gamma_{00}^1\left(\frac{d\phi}{d\lambda}\right)^2+2\Gamma_{10}^1\frac{d\phi}{d\lambda}\frac{d\theta}{d\lambda}+\Gamma_{11}^1\left(\frac{d\theta}{d\lambda}\right)^2&\phantom {10000}(5)\nonumber
\end{align}using the metric and (2) and taking each ## \Gamma## in turn, many terms vanish because the metric components are constant or 0
\begin{align}
\Gamma_{00}^1&=\frac{1}{2}g^{1\rho}\left(\partial_0g_{0\rho}+\partial_0g_{\rho0}-\partial_\rho g_{00}\right)=g^{1\rho}\partial_0g_{0\rho}&\phantom {10000}(6)\nonumber\\
&=g^{10}\partial_0g_{00}+g^{11}\partial_0g_{01}=0&\phantom {10000}(7)\nonumber\\
2\Gamma_{10}^1&=g^{1\rho}\left(\partial_1g_{0\rho}+\partial_0g_{\rho1}-\partial_\rho g_{10}\right)=g^{1\rho}\partial_1g_{0\rho}+g^{1\rho}\partial_0g_{\rho1}&\phantom {10000}(8)\nonumber\\
&=g^{10}\partial_1g_{00}+g^{11}\partial_1g_{01}+g^{10}\partial_0g_{01}+g^{11}\partial_0g_{11}&\phantom {10000}(9)\nonumber\\
&=\frac{1}{\sin^2{\phi}}\frac{\partial}{\partial\phi}\left(\sin^2{\phi}\right)=\frac{2\sin{\phi}\cos{\phi}}{\sin^2{\phi}}=2\cot{\phi}&\phantom {10000}(10)\nonumber\\
\Gamma_{11}^1&=\frac{1}{2}g^{1\rho}\left(\partial_1g_{1\rho}+\partial_1g_{\rho1}-\partial_\rho g_{11}\right)=g^{1\rho}\partial_1g_{\rho1}-\frac{1}{2}g^{1\rho}\partial_\rho g_{11}&\phantom {10000}(11)\nonumber\\
&=g^{10}\partial_1g_{01}+g^{11}\partial_1g_{11}-\frac{1}{2}g^{10}\partial_0g_{11}-\frac{1}{2}g^{11}\partial_1g_{11}&\phantom {10000}(12)\nonumber\\
&=\frac{1}{2}\frac{1}{\sin^2{\phi}}\frac{\partial}{\partial\theta}\left(\sin^2{\phi}\right)=0&\phantom {10000}(13)\nonumber
\end{align}Putting the expressions for ## \Gamma## back into (5) we get
\begin{align}
\Gamma_{\mu\nu}^1\frac{dx^\mu}{d\lambda}\frac{dx^\nu}{d\lambda}&=2\cot{\phi}\frac{d\phi}{d\lambda}\frac{d\theta}{d\lambda}&\phantom {10000}(14)\nonumber
\end{align}Putting that back into (1) we have
\begin{align}
\frac{d^2\theta}{d\lambda^2}+2\cot{\phi}\frac{d\phi}{d\lambda}\frac{d\theta}{d\lambda}=0&\phantom {10000}(15)\nonumber
\end{align}I can use the same method to get a solution for ## \sigma=0##, but that's not relevant yet. Put together they show that lines of longitude are always geodesics as is the equator. So far so good… but
A great circle equation (which we know is a geodesic) can be written as
\begin{align}
\theta=\lambda\ \ ,\ \ \phi=\tan^{-1}{\left(\frac{C}{A\cos{\lambda}+B\sin{\lambda}}\right)}&\phantom {10000}(16)\nonumber
\end{align}where ## A,B,C## are constants depending on the start and end points. I calculated this and checked it against the slightly ambiguous Wolfram maths article at http://mathworld.wolfram.com/GreatCircle.html.
From (16) clearly
\begin{align}
\frac{d^2\theta}{d\lambda^2}=0&\phantom {10000}(17)\nonumber
\end{align}so the other term in (15) should always be zero. It is
\begin{align}
2\cot{\phi}\frac{d\phi}{d\lambda}\frac{d\theta}{d\lambda}=-2\frac{\left(B\cos{\lambda}-A\sin{\lambda}\right)\left(A\cos{\lambda}+B\sin{\lambda}\right)}{C^2+\left(A\cos{\lambda}+B\sin{\lambda}\right)^2}&\phantom {10000}(18)\nonumber
\end{align}which is not always zero! So something is wrong.
It's either
(15) which I have calculated in another way to check it or
(16) which I have also plotted and gives good results or
my differentiation of ##\frac{d\phi}{d\lambda}## which I checked with Symbolab: https://www.symbolab.com/solver/ordinary-differential-equation-calculator/?or=dym&query=%5Cfrac%7Bd%7D%7Bdx%7D(%5Carctan(%5Cfrac%7BC%7D%7BD%5Ccos(x)%2BB%5Csin(x)%7D))
Help! What has gone wrong?
On Physics Forums at https://www.physicsforums.com/threads/question-about-geodesic-on-sphere.975370/