0

In a series expansion of given definite Integration $$\int^{1}_{0}e^{-x^2}dx$$

How many terms of this series are necessary to approximate this integral to within $0.01$

What i try:

$$\int^{1}_{0}\sum^{\infty}_{n=0}\frac{(-1)^nx^{2n}}{n!}dx$$

$$\sum^{\infty}_{n=0}\frac{(-1)^n}{n!}\int^{1}_{0}x^{2n}dx=\sum^{\infty}_{n=0}\frac{(-1)^n}{(2n+1)n!}$$

Could some help me How many terms are used to approximate this integral within $0.01$

Thanks

jacky
  • 5,194

2 Answers2

1

Well, as you showed the integral is equal to:

$$\int_0^1\exp\left(-x^2\right)\space\text{d}x=\sum_{\text{n}=0}^\infty\frac{\left(-1\right)^\text{n}}{\left(2\text{n}+1\right)\left(\text{n}!\right)}=\frac{\text{erf}\left(1\right)\sqrt{\pi}}{2}\approx0.746824132812427\tag1$$

Where $\text{erf}\left(x\right)$ is the error function.

So, you're trying to find:

$$\left|\int_0^1\exp\left(-x^2\right)\space\text{d}x-\sum_{\text{n}=0}^\infty\frac{\left(-1\right)^\text{n}}{\left(2\text{n}+1\right)\left(\text{n}!\right)}\right|<\frac{1}{100}\tag2$$

Jan Eerland
  • 28,671
1

For an alternating series where the terms decrease in absolute value, the remainder (i.e., the error between the partial sum and the infinite sum) is always bounded by the absolute value of the next term left out of the partial sum. See here for instance.

You have calculated that the integral is equal to the alternating series $\sum_{n=0}^\infty \frac{(-1)^n}{(2n+1)n!}$, and so using the above fact you know: \begin{align*} \left| \sum_{n=0}^\infty \frac{(-1)^n}{(2n+1)n!} - \sum_{n=0}^N \frac{(-1)^n}{(2n+1)n!}\right| &\leq \frac{1}{(2N+1)N!}\\ \left|\int_0^1 e^{-x^2} \ dx - \sum_{n=0}^N \frac{(-1)^n}{(2n+1)n!}\right| &\leq \frac{1}{(2N+1)N!}\\ \end{align*}

So you just need to find the smallest $N$ so that $\frac{1}{(2N+1)N!} \leq 0.01$.

kccu
  • 20,808
  • 1
  • 22
  • 41