Distance between two galaxies of different redshift Let $Q_1$ and $Q_2$ two different objects in the Universe (we can think to two galaxies or quasars), that we observe from the Earth at different angular position $(\alpha_1,\delta_1)$, $(\alpha_2,\delta_2)$ and at different redshift $z_1$,$z_2$.
I know how to find the distances of the two objects from the Earth at the present epoch ( the comoving distance):
$$
d_C(Q_i)=\dfrac{c}{H_0}\int_0^{z_i}\dfrac {dz}{E(z)}
$$
Now I want to find the comoving distance (at epoch $z=0$) between the two objects. 
My first idea is to use the classical formulas for the transformation of spherical to cartesian coordinates and find the cartesian coordinates of the two objects, than calculate the Pythagorean distance. But this can work only in a flat space, so it seems not useful in general.
My final goal is to find the distances between the two objects at any epoch and the relative redshift  of one of them observed by the other. 
Searching on the books that I have and on Internet I don't find a general solution of this problem. 
Someone know the solution or has some reference?
 A: You are correct that the flat equations will fail you when $\Omega_k \neq 0$. What you need is the correct version of the law of cosines for the geometry in question. Assuming that maximizing numerical accuracy when object separations are small is important, then you'll want the law of haversines for $\Omega_k < 0$ and the hyperbolic law of haversines for $\Omega_k > 0$. Thus the comoving distance between source at comoving distance $D_A$ and one at $D_B$ with angular separation on the sky $\theta$ are separated by comoving distance:
$$D_{AB} = \left\{\begin{array}{lc}
\left(\frac{2D_H}{\sqrt{\Omega_k}}\right)\operatorname{asinh}\sqrt{\sinh^2\frac{(D_A-D_B)\sqrt{\Omega_k}}{2D_H} + \sinh\frac{D_A\sqrt{\Omega_k}}{D_H} \sinh\frac{D_B\sqrt{\Omega_k}}{D_H} \sin^2 \frac{\theta}{2}} & \Omega_k > 0 \\
\sqrt{(D_A-D_B)^2 + 4D_A D_B \sin^2 \frac{\theta}{2}} & \Omega_k = 0 \\
\left(\frac{2D_H}{\sqrt{|\Omega_k|}}\right)\operatorname{asin}\sqrt{\sin^2\frac{(D_A-D_B)\sqrt{|\Omega_k|}}{2D_H} + \sin\frac{D_A\sqrt{|\Omega_k|}}{D_H} \sin\frac{D_B\sqrt{|\Omega_k|}}{D_H} \sin^2 \frac{\theta}{2}} & \Omega_k < 0.
\end{array}\right.$$
If you plug in $D_A = D_B$ then do a Taylor expansion in small $\theta$, the linear term will reproduce Hogg 1999 Equation 16, as required.
Translating this comoving distance into a physical distance at any redshift is a simple matter of applying the right scale factor.
A: Like Jimself, I know I've seen this somewhere (and will try to dig it up), but in the meantime I'll give you the answer off the top of my head. Can't guarantee this is entirely correct until I do dig some things up, but some parts are true (confident in the flat Universe part!).
As long as you're interested in our Universe, your idea will actually work, since our Universe is flat (or close enough to flat, anyway).
Furthermore, for objects with zero peculiar velocity, the comoving distance is constant with redshift, so if you find the comoving distance at $z=0$, this is also the comoving distance at any $z$! If the peculiar velocities are small compared to the comoving velocities, you can safely ignore the peculiar velocities. This will in practice be true for any sufficiently high redshift objects. An object at 100 Mpc has a recession velocity of 7000 km/s, which will be substantially higher than any peculiar velocities for things like galaxies and quasars.
In a curved Universe things will be a bit trickier, but not too bad. I think you can still find the cartesian coordinates of the two objects in the same way, but instead of the Pythagorean distance you'll need to solve for the geodesic connecting those two points and find its length.
