# Approximating Integral via Power Series

1. Nov 22, 2015

### Amrator

1. The problem statement, all variables and given/known data
Approximate the integral to 3 decimal place accuracy via power series.

$\int_0^{1/2} x^2 e^{-x^2}\, dx$

2. Relevant equations

3. The attempt at a solution
$x^2 e^{-x^2} = x^2 \sum_{n=0}^\infty \frac {(-x)^{2n}}{n!} = \sum_{n=0}^\infty \frac {x^{2n+2}}{n!}$ ⇒ $\int_0^{1/2} \sum_{n=0}^\infty \frac {x^{2n+2}}{n!}\, dx = \left. \sum_{n=0}^\infty \frac {x^{2n+3}}{(2n+3)n!} \right|_0^{1/2}$

Could I use the ratio test to approximate the error or do I have to use the alternating series test? I don't really see how I could use the alternating series test from here.

2. Nov 22, 2015

### vela

Staff Emeritus
You messed up the algebra, which is why you don't end up with an alternating series.

3. Nov 22, 2015

### Amrator

I'll go over it again.

4. Nov 22, 2015

### Amrator

I don't see any algebraic mistakes. $(-x)^{2n} = ((-x)^{2})^n = (x^2)^n = x^{2n}$
$x^2x^{2n} = x^{2n+2}$

Edit: Nevermind. I see the algebraic mistake.

5. Nov 22, 2015

### geoffrey159

How do you justify the inversion of $\int$ and $\sum$?

6. Nov 22, 2015

### Amrator

What do you mean by inversion?

7. Nov 22, 2015

### geoffrey159

You exchanged $\int$ and $\sum$ in your first post, didn't you ? What is your justification for this ?

8. Nov 22, 2015

### Amrator

$e^x = \sum_{n=0}^\infty \frac {x^n}{n!}$
Let $x = -x^2$
Multiply the series by $x^2$, and simply integrate.

9. Nov 22, 2015

### geoffrey159

There is nothing simple about that, you have to prove it

10. Nov 22, 2015

### Amrator

You want me to prove the term by term integration theorem?

11. Nov 22, 2015

### geoffrey159

It's enough if you show that you have all the hypothesis that lead to your conclusion

12. Nov 22, 2015

### pasmith

Power series can always be integrated term-by-term within their radius of convergence because convergence of power series is uniform.

(Also the question itself appears to assume that one can do that, so the OP doesn't need to justify it as part of the answer.)

13. Nov 22, 2015

### geoffrey159

I agree, but it must be said somewhere, or proved

14. Nov 22, 2015

### Amrator

I'm in calculus 2, not analysis.

15. Nov 22, 2015

### Staff: Mentor

I agree with what pasmith said -- the OP doesn't need to justify interchanging the summation and integration operations.

16. Nov 22, 2015

### geoffrey159

Ok, it's fine for me :-)

@pasmith, convergence of the power serie is uniform on a compact set within the radius of convergence.