# Improper integrals over infinite ranges.

I'm trying to understand how to numerically integrate over infinite ranges using the composite trapezoidal rule, like in this book. Namely, I am having the problem with the series starting with $-\infty$ to $\infty$. How do I calculate the terms? It would be fantastic if you showed me an explicit example.

Thank you!

-
What don't you understand? I think this book describes it very explicitly, I don't know what else to say. Are you having troubles with the trapezoidal rule in finite ranges also? – Patrick Da Silva Dec 18 '11 at 23:12

Do you mean the section on "Ignoring the singularity"? For an integral $\int_{-\infty}^\infty f(x)\ dx$, with step size $h$ you approximate the integral over the interval $[i h, (i+1)h]$ by $\frac{h}{2} (f(ih) + f((i+1)h))$, obtaining the infinite sum $h \sum_{i=-\infty}^\infty f(ih)$. If $f(x)$ decreases fast enough as $x \to \pm \infty$, you just ignore all but finitely many terms of the series. For example, with $f(x) = e^{-x^2}$, if $x > 5$ you have $f(x) < e^{-5x}$ so the sum for $i > N \ge 5/h$ is bounded by $\sum_{i=N}^\infty h e^{-5i/h} = \frac{h}{1 -\exp(-5/h)} e^{-5N/h}$. For $N \approx 5/h$ this approximately $5 e^{-N^2}/N$.