Change of variables

Change of variables is an extremely powerful method for performing integrals not only analytically but also numerically. A change of variables can considerably improve the accuracy of regular-interval techniques for functions with rapid variations in particular regions of the integration domain and can allow one to perform integrals which would otherwise be impossible, such as for functions with integrable singularities or integrals over infinite domains.

Change of variables begins with the familiar analytic formula,

\begin{displaymath}
\int_0^1 f(r(x)) \frac{dr(x)}{dx} \, dx = \int_{a=r(0)}^{b=r(1)}
f(r)\,dr,
\end{displaymath} (17)

where $r(x)$ is any function which maps the unit interval $x \in
[0,1]$ to the interval $r \in [a,b]$. The most trivial example of such a map is the linear map

\begin{eqnarray*}
r(x) & = & a+(b-a) x \\
\frac{dr(x)}{dx} & = & b-a
\end{eqnarray*}


which transforms integration over any interval to integration over the unit interval. Figure 4(a) illustrates such a map along with the distribution of resulting sample points $r(x_i)$.

Figure 4: Mapping of regular sampling of unit interval under change of variables: (a) linear map, (b) map to semi-infinite interval, (c) map to semi-infinite interval with concentration of points at origin.
\scalebox{0.75}{\includegraphics{ab.eps}} \scalebox{0.75}{\includegraphics{0inf.eps}} \scalebox{0.75}{\includegraphics{00inf.eps}}

Maps which transform integration over an infinite interval to integration over a finite interval represent a far more important example. The map

$\displaystyle r(x)$ $\textstyle =$ $\displaystyle \frac{1}{1-x}-1=\frac{x}{1-x}$ (18)
$\displaystyle \frac{dr(x)}{dx}$ $\textstyle =$ $\displaystyle \frac{1}{(1-x)^2},$  

for instance, makes possible the evaluation of integrals over the interval $[0,\infty]$ with the techniques discussed above. As $x
\rightarrow 0$, $r(x) \rightarrow x$, and this map spaces the sample points $r(x_i)$ regularly near the origin. However, As $x \rightarrow
1^{-}$, however, the sample points eventually tend toward infinity. (See Figure 4(b).) Under this map, the integral

\begin{displaymath}
\int_0^\infty f(r) \, dr = \int_0^\infty \frac{1}{1+r^2} \, dr = \frac{\pi}{2},
\end{displaymath}

becomes

\begin{displaymath}
\int_0^1 \frac{1}{1+\left(\frac{x}{1-x}\right)^2} \frac{1}{(1-x)^2} \,
dx = \int_0^1 \frac{1}{(1-x)^2+x^2}\,dx,
\end{displaymath}

which Figure 5 illustrates to be much more manageable. In practice, such changes of variables require care to ensure that the proper limiting values for $f(r(x)) (dr/dx)$ are used at the endpoints where the change of variables factor $dr/dx=1/(1-x)^2$ becomes singular.

Figure: Integrand of $\int_0^\infty \frac{1}{1+r^2}\,dr$: (a) direct integration, (b) under change of variables in Eq. (21).
\scalebox{0.5}{\includegraphics{pi2a.eps}} \scalebox{0.5}{\includegraphics{pi2b.eps}}

Finally, as an example of a problem with an integrable singularity consider the integral

\begin{displaymath}
\int_0^\infty \frac{e^{-r}}{\sqrt{r}} = \sqrt{\pi}.
\end{displaymath}

As $r \rightarrow 0$, the integrand approaches $1/\sqrt{r}$ and diverges toward infinity. (See Figure 6(a).) Heuristically, the solution is to concentrate sample points $r(x_i)$ near the singularity at the origin. A map which both extends the range of integration to infinity and concentrates points near the origin is
$\displaystyle r(x)$ $\textstyle =$ $\displaystyle \frac{1}{1-x}-1-x = \frac{x^2}{1-x}$ (19)
$\displaystyle \frac{dr(x)}{dx}$ $\textstyle =$ $\displaystyle \frac{1}{(1-x)^2}-1,$  

(See Figure 4(c).) Figure 6(b) shows that the resulting integrand $f(r(x)) (dr(x)/dx)$ is now well behaved and quite suited to regular interval techniques.

Figure: Integrand of $\int_0^\infty \frac{e^{-r}}{\sqrt{r}}\,dr$: (a) direct integration, (b) under change of variables in Eq. (22).
\scalebox{0.5}{\includegraphics{sqrtpi2a.eps}} \scalebox{0.5}{\includegraphics{sqrtpi2b.eps}}

Tomas Arias 2004-01-26