Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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!

share|improve this question
    
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
add comment

1 Answer

up vote 1 down vote accepted

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$.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.