# Geodesics given a metric

Could anyone remind me how find the null geodesic of a spacetime with metric $$ds^2=f(x)dt^2+dx^2$$?

What is the "parameter"?

Thank you.

Or in general just any geodesic?

-
Have a read of this. – Edward Hughes Feb 21 '13 at 13:35
Are you speaking about The Roberstson Walker spacetimes? If it is so you can find a good reference in the book of Barret O'Neill 'Semiriemannian geometry' – user55449 Feb 23 '13 at 11:00

Null geodesics: take the time $t$ as parameter, and observe that the null-geodesic $x(t)$ must satisfy $x'(t)^2=-f(x(t))$. Of course, $f$ must be negative in the region where you look for a null-geodesic, otherwise there isn't one. The two values of square root correspond to different orientations of the same null-geodesic. Pick one and try to solve the nonlinear ODE of first order $x'(t)=\sqrt{-f(x(t))}$. Depending on $f$, it may be easy or hopeless.
Finding geodesics is a very different matter, because the relevant ODE is of the 2nd order instead of 1st. The wiki page to which Edward Hughes linked gives this equation, but one shouldn't expect an explicit solution unless $f$ is very special.