I'm trying to integrate the following function:
$$r_e=\int_0^z\frac{dz}{\sqrt{\Omega_m(1+z)^3+\Omega_\Lambda}}$$
where $\Omega_\Lambda=1-\Omega_M$ and both $\Omega_\Lambda$ and $\Omega_M$ are real and positive.
Doing the definite integral using Integrate
doesn't produce a result even after a few hours of running. I found that just doing the indefinite integral and then putting in the limits later produces a result. Why is this?
Additionally, the result is unexpected and discontinuous for different values of $z$ depending on the value of $\Omega_M$. Any suggestions on the best strategy for integrating this?
FunH[omM_,omL_,z_]:=1/((omM(1+z)^3+omL)^(1./2.))
F[omM_,z_]:=Evaluate[Block[{omL=1-omM},Integrate[FunH[omM,omL,z],z]]]
Table[(1+z)^(-1)*(F[omM,z]-F[omM,0]),{omM,0.000001,1,0.1},{z,0.000001,3,0.001}]
I had to copy the code from another machine so I might have missed a bracket somewhere.
EDIT: If anyone is interested, there is a publicly available paper dealing with a transformation of this integral to make the solution easier.
Essentially one can transform the above integral using a few simple substitutions into something which is proportionate to the difference between two separate integrals of the form: $$\int\frac{du}{\sqrt{u^4+u}}$$ This can be easily integrated by Mathematica.