You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The improper integral is addressed by using a variable substitution proffered in Mark Newman's Computational Physics textbook:
\begin{align}
z &= {x-a \over 1+x-a}, \\
\int_{a}^{\infty} f(x) \dd x &= \int_{0}^{1} {1\over (1-z)^{2}} \, f\left({z \over 1-z} + a\right) \dd z.
\end{align}
However, the integrand is undefined at $z = 1$ so we introducing a fudge factor $\epsilon = 10^{-14}$ to the integration limits. The desired accuracy is achieved by implementing Simpson's integration with $N$ points, comparing it to the same integration with $2N$ points, and continuing in that fashion until the difference is less than $10^{-5}$.