# How do we calculate this exponential integral if we change limit from $\infty$ to $x_1$

We know the solutions of this integral (Bronstein-Semendijajev mathematics manual [page474]):

\begin{align} \int\limits_{0}^{\infty}x^n \cdot e^{-ax^2}dx = \frac{1\cdot3\dots(2k-1)\,\,\sqrt{\pi}}{2^{k+1}a^{k+1/2}}\longleftarrow\substack{\text{$n$ is the exponent over $x$}\\\text{while $k=n/2$}} \end{align}

But how do I calculate the integral if I change the upper limit from $\infty$ to $x_1$ which is constant - for example how do I calculate this integral:

\begin{align} \int\limits_{0}^{x_1}x^2 \cdot e^{-ax^2}dx \end{align}

-
One does not simply change the limit from ∞ to x_1 – N3buchadnezzar Aug 12 '13 at 13:48
I din't change it. I have to solve the later integral which has $x_1$ for limit. But i found the first integral in the mathematics manual. – 71GA Aug 12 '13 at 14:01

Let

$$I(a) = \int_0^{x_1} dx \, e^{-a x^2} = \frac12 \sqrt{\frac{\pi}{a}} \text{erf}(\sqrt{a} x_1)$$

Then the integral in question is $-\partial I/\partial a$, which is

$$\frac14 \sqrt{\frac{\pi}{a^3}} \text{erf}(\sqrt{a} x_1) - e^{-a x_1^2} \frac{x_1}{2 a}$$

This may be used for even $n$, using successively higher derivatives with respect to $a$. For odd $n$, you may rather use derivatives with respect to $a$ of the integral

$$\int_0^{x_1} dx \, x \, e^{-a x^2} = \frac12 \frac{1-e^{-a x_1^2}}{a}$$

-
Thank you. Is the error function really necessary :/ ??? – 71GA Aug 12 '13 at 14:20
@71GA: as far as I know, yes, no way around it I am afraid. – Ron Gordon Aug 12 '13 at 14:20
Does this mean this can only be solved using numerical methods? – 71GA Aug 12 '13 at 14:25
@71GA: The error function is used so often that every math package has it built in. Simple routines exist that compute its value to as many decimal places as you like with a few simple operations. So, do you need numerical integration? Heaven's no! It's like having a Bessel function - actually, even easier. – Ron Gordon Aug 12 '13 at 14:50
Well my calculator lacks it :) – 71GA Aug 12 '13 at 15:02

$\int_0^{x_1}x^2e^{-ax^2}~dx$

$=\int_0^{x_1}x^2\sum\limits_{n=0}^\infty\dfrac{(-1)^na^nx^{2n}}{n!}dx$

$=\int_0^{x_1}\sum\limits_{n=0}^\infty\dfrac{(-1)^na^nx^{2n+2}}{n!}dx$

$=\left[\sum\limits_{n=0}^\infty\dfrac{(-1)^na^nx^{2n+3}}{n!(2n+3)}\right]_0^{x_1}$

$=\sum\limits_{n=0}^\infty\dfrac{(-1)^na^n{x_1}^{2n+3}}{n!(2n+3)}$

-