To first order, the radial and transverse comoving separations are
where
The local spatial geometry is that of Euclidean space, so the Pythagorean theorem gives
Consequently the requested function is