Integrating Gaussian functions with erf

1. Oct 19, 2008

bigevil

1. The problem statement, all variables and given/known data

I'm doing a problem on Gaussian functions (there are other constants to make it interesting, but I've removed them here):

1. $$\int_{0}^{x} e^{-x^2} dx$$
2. $$\int_{0}^{x} x e^{-x^2} dx$$
3. $$\int_{0}^{x} x^2 e^{-x^2} dx$$

We know that

$$erf(z) = \frac{2}{\sqrt{\pi}} \int_{0}^{x} e^{-x^2} dx$$

I can use the error function to solve 1. For 2, I integrate by parts:

$$\int_{0}^{x} x e^{-x^2} dx = \big[ \frac{\sqrt{\pi}}{2} x.erf(x) \big]_0^{x} - \int_{0}^{x} e^{-x^2} dx =\frac{\sqrt{\pi}}{2} x . erf(x) - \frac{\sqrt{\pi}}{2} . erf(x)$$

Now I want to integrate part 3, and an obvious route to go is integration by parts, but is there a simpler way? Surely I'm not going to do IBP if I was given an integral of an even higher power? I'm doing a question in a (physics) textbook with all the constants and that to make it interesting, but it really boils down to this. My book gives a one line working, which is as follows:

$$\int_{0}^{32} x^2 e^{-x^{2}/4} = - \frac{64}{256} + 2 \sqrt{\pi} erf[16]$$

2. Relevant equations

Is there a simple, obvious way to do this integral without IBP? I do know that

$$\int_{-\infty}^{\infty} x^{2n} e^{-x^2} dz = \sqrt{\pi} \frac{1.3.5...(2n-1)}{2^n}$$

3. The attempt at a solution

Well, I tried doing the integration by parts, which was fine, but seeing as my book provides a one-line working for this integral, I figure it should be even easier than that.
1. The problem statement, all variables and given/known data

2. Relevant equations

3. The attempt at a solution

Last edited: Oct 20, 2008
2. Oct 19, 2008

bigevil

Hey, what happened to my Tex??

Test:
$$\leftrightarrow\rightarrow\rightharpoonup\rightharpoondown$$