Weird computation error when using fnInt (numerical integral) on TI-84 Plus

3.6k Views Asked by At

Today in Calculus class I was bored so I decided to try and approximate $\pi$ by evaluating $ \left( \displaystyle \int_{-a}^a e^{-x^2} dx \right)^2$ on my calculator for larger and larger values of $a$.

However, in doing so, I noticed something peculiar. When I plugged in $a = 100$ it gave me a value of approximately $\pi$, as expected. However, when I plugged in $a = 1000$ I got an answer of about $2.7 \times 10^{-7}$. In fact, I was able to narrow it down to figure out that $a = 892.26$ and below (with reasonable assumption) gave me a correct value while $a = 892.27$ and above (with reasonable assumption) gave me some very small value like I found with $a = 1000$

What's going on here?

edit: I realize that this is a problem with the calculator's integration method. I am aware that larger values of $a$ should converge closer to $\pi$.

2

There are 2 best solutions below

0
On

We know that $$\lim_{a\to\infty}\left(\int^a_{-a}e^{-x^2}dx\right)^2=\lim_{a\to\infty}\dfrac{1}{4}\pi\left(\operatorname{erf}(a)^2+\operatorname{erf}(-a)^2-2\operatorname{erf}(a)\operatorname{erf}(-a)\right)=\\ \dfrac{\pi}{4}(1+1-(-2))=\pi$$ Hence, I am led to believe that this is a bug in the calculator itself, since the value should be getting closer to $\pi$.

2
On

First, it doesn't recognize your input as the error function, but just as a function to be integrated numerically. When it does so, probably what is happening is that the calculator starts by evaluating the integrand at a series of points between the upper and lower limits of integration, using something like the trapezoid rule to approximate the integral. Then it cuts the interval in half and computes it again. If they agree (closely enough) it believes it has converged and reports the result. If they disagree, it keeps working on smaller and smaller pieces (maybe changing the spacing to put lots of points where the function is changing rapidly) until it converges. When the interval becomes long enough, the spacing between the points gets wide enough that it misses the hump around $x=0$ completely, which is why it reports such a small number. You might find that if you set $a$ even larger, it returns exactly zero because the value of the integrand is so small at all the points it samples.