transformation of integral from 0 to infinity to 0 to 1
How do I transform the integral $$\int_0^\infty e^{-x^2} dx$$ from 0 to $\infty$ to o to 1 and. I have to devise a monte carlo algorithm to solve this further, so any advise would be of great help
\begin{align} \int_0^{\infty} e^{-x^2}dx & = \int_0^{1} e^{-x^2}dx + \underbrace{\int_1^{\infty} e^{-x^2}dx}_{x \mapsto 1/x} = \int_0^1 e^{-x^2}dx + \int_1^0 e^{-1/x^2} \left(\dfrac{-dx}{x^2} \right)\\ &=\int_0^1 \left(e^{-x^2} + \dfrac{e^{-1/x^2}}{x^2}\right)dx \end{align}
Pick your favorite invertible, increasing function $f : (0,1) \to (0,+\infty)$. Make a change of variable $x = f(y)$.
Or, pick your favorite invertible, increasing function $g : (0,+\infty) \to (0,1)$. Make a change of variable $y = g(x)$.