TITLE: The Geodesics of a Sphere.
QUESTION [7 upvotes]: I need to find the geodesics of a sphere. Then in polar coordinates
$$x=a \sin\theta \cos\phi \\y=a \sin\theta \sin\phi\\  
z=a\cos\theta$$  
Then $ds^2=dx^2+dy^2+dz^2$.
Can someone please tell me how is $ds^2=a^2(d\theta^2+\sin^2\theta \, d\phi ^2)$ obtained. I don't know much about spherical coordinates.

REPLY [4 votes]: Well from
$\begin{eqnarray}
x &=& r \sin(\theta) \cos(\phi)\\
y &=& r \sin(\theta) \sin(\phi)\\
z &=& r \cos(\theta)\\
\end{eqnarray}$
follows
$\begin{eqnarray}
dx &=& \sin(\theta) \cos(\phi) dr + r \cos(\theta) \cos(\phi) d\theta - r \sin(\theta) \sin(\phi) d\phi\\
dy &=& \sin(\theta) \sin(\phi) dr + r \cos(\theta) \sin(\phi) d\theta + r \sin(\theta) \cos(\phi) d\phi\\
dz &=& \cos(\theta) dr - r \sin(\theta) d\theta\\
\end{eqnarray}$
and for the surface we have $dr=0$, thus
$\begin{eqnarray}
dx &=& r \cos(\theta) \cos(\phi) d\theta - r \sin(\theta) \sin(\phi) d\phi\\
dy &=& r \cos(\theta) \sin(\phi) d\theta + r \sin(\theta) \cos(\phi) d\phi\\
dz &=& r \sin(\theta) d\theta\\
\end{eqnarray}$
Then we find that
$\begin{eqnarray}
dx^2 + dy^2 + dz^2 &=& \Big( r \cos(\theta) \cos(\phi) d\theta - r \sin(\theta) \sin(\phi) d\phi \Big)^2\\
&& + \Big( r \cos(\theta) \sin(\phi) d\theta + r \sin(\theta) \cos(\phi) d\phi \Big)^2\\
&& + \Big( r \sin(\theta) d\theta \Big)^2\\
&=& r^2 \Big( \cos^2(\theta) \cos^2(\phi) d\theta^2 - 2 \cos(\theta) \cos(\phi) \sin(\theta) \sin(\phi) d\theta d\phi\\
&&\hspace{2em} + \sin^2(\theta) \sin^2(\phi) d\phi^2\\
&& + \cos^2(\theta) \sin^2(\phi) d\theta^2 - 2 \cos(\theta) \sin(\phi) \sin(\theta) \cos(\phi) d\theta d\phi\\
&&\hspace{2em} + \sin^2(\theta) \cos^2(\phi) d\phi^2\\
&& + \sin^2(\theta) d\theta^2
\Big)
\end{eqnarray}$
$\begin{eqnarray}
dx^2 + dy^2 + dz^2 &=& r^2 \Big( d\theta^2 + \sin^2(\theta) d\phi^2 \Big)
\end{eqnarray}$