Calculation of co-moving coordinate separation for a moving object in a time-varying spacetime metric My calculus has 30+ years of rust on it and I am stuck on the integration of the interval in General Relativity...
I wish to calculate the spatial coordinate at time t of an object moving with peculiar velocity v (i.e. not with the flow) in a spacetime that is expanding/contracting between temporal and spatial limits.
For simplicity and definiteness, consider a spacetime with only one spatial dimension, and metric components g00 = -1, g11 = f(t) (smooth, continuous) & all other components zero.
Example: at t=0 a spaceship travelling at v=c/2 in the x direction sets off from x = 0; at t=0 the region between x=1 and x = 2 begins expanding (f(t)>1). Where is the spaceship (what is its co-moving coordinate) at e.g. t = 3?
The general equation is (up to sign, Einstein summation convention on repeated tensor indices) 
s = $\int $ $\sqrt{g_{\mu\nu}dx^\mu dx^\nu}$, which in this case becomes simply
s = $\int $ $\sqrt{-dt^2 + f(t)dx^2}$
I would be very grateful if someone would be kind enough show the steps to turn this into an equation for x(t).
 A: Speaking as an amateur relativist, this is a hard problem. The trouble is that you need to calculate the trajectory of your spaceship i.e. $(t(\tau), x(\tau), y(\tau), z(\tau))$ for some convenient affine parameter $\tau$ (for massive objects we generally use the proper time as the parameter).
To calculate the trajectory of the spaceship you need to solve the geodesic equation:
$$ {d^2 x^\mu \over d\tau^2} + \Gamma^\mu_{\alpha\beta} {dx^\alpha \over d\tau} {dx^\beta \over d\tau} = 0 $$
where the $\Gamma^\mu_{\alpha\beta}$ are the Christoffel symbols for your metric. You can calculate the symbols by hand (tedious!) or just Google them. This paper lists the Christoffel symbols for a metric like yours on page 11. Actually it goes through an example of calculating a geodesic in the FLRW spacetime, so you'd probably find it a valuable read.
Assuming a sensible choice of axes, so the spaceships motion is along the $x$ axis, you get two simultaneous second order differential equations in $t$ and $x$. Feed in appropriate initial conditions and solve the equations to get the trajectory. From there it's easy because the length of the curve is just $c\tau$.
A: [This is my attempt to join the dots... corrections and clarifications welcome.]
Phoenix87's "one small step" (comment on original question) was a bit more than that for me, so here is a fuller treatment that bridges the gaps and embodies John Rennie's answer.
We have the equation for the spacetime interval
$$
S=\int \sqrt{g_{\mu\nu}dx^\mu dx^\nu}\tag{1}
$$
We also know that the action is given by 
$$
S=\int L\,dt\tag{2}
$$
where $L$ is the Lagrangian
Since we have two equations in s*, we can equate them to get
$$
\int\sqrt{g_{\mu\nu}dx^\mu dx^\nu}=\int L\,dt\tag{3}
$$
Formally, this is of course nonsense, but from the Mathworld entry on the Euler-Lagrange Differential Equation we note the real reason, implied by Phoenix87, which is that in all generality, if J is defined as follows (and overdot = time derivative)
$$
J=\int f(t,y,\dot{y})\,dt\tag{4}
$$
Then $J$ has a stationary value if the Euler-Lagrange equation below is satisfied
$$
\frac{\partial f}{\partial y}-\frac{d}{dt}\frac{\partial f}{\partial\dot y}=0\tag{5}
$$
Now the equation for the separation is not initially in the right form; what we need to do is turn it into an integral that has the correct form for a Lagrangian. We therefore make the separation integral with respect to $d\tau$ and absorb the $d\tau$ inside the square root. (Generally following the formulation of Introduction to Tensor Calculus for General Relativity by Edmund Bertschinger, MIT 2000).
Parameterising the path as $x^\mu(\tau)$
$$
S[x(\tau)]=\int\sqrt{g_{\mu\nu}(x)\frac{dx^\mu}{d\tau}\frac{dx^\nu}{d\tau}}d\tau \equiv\int L\left(x,\frac{dx}{d\tau}\right)d\tau\tag{6}
$$
and (5) becomes
$$
\frac{d}{d\tau}\left[\frac{\partial L}{\partial \left(dx^\mu/d\tau\right)}\right]-\frac{\partial L}{\partial x^\mu}=0\tag{7}
$$
From which one eventually obtains the geodesic equation...
$$
\frac{d^2x^\mu}{d\tau^2}+\Gamma^\mu_{\alpha\beta}\frac{dx^\alpha}{d\tau}\frac{dx^\beta}{d\tau}=0\tag{8}
$$
If and when I do the algebra I may extend this answer with the full working to get (8).
Note that the Mathematica package "christoffel.nb" takes the tedium out of calculating the Christoffel symbols, but note that the coordinate numbering convention, and thus the ordering of metric components to be entered, is non-standard and setup should therefore be carefully attended to.
* feel free to involve the entropy too, if you feel so inclined. 
