# Thread: an integration problem with exponantial

1. ## an integration problem with exponantial

I have encountered a problem with the following form:

$\displaystyle \int x e^{ax^2-bx}dx$

I can only find formulas for $\displaystyle \int x e^{ax^2}dx$ and $\displaystyle \int x e^{bx}dx$ and don't know how to make use of these two formulas.

Can someone help me on this? Thanks a lot!!

2. Originally Posted by billzhao
I have encountered a problem with the following form:

$\displaystyle \int x e^{ax^2-bx}dx$

I can only find formulas for $\displaystyle \int x e^{ax^2}dx$ and $\displaystyle \int x e^{bx}dx$ and don't know how to make use of these two formulas.

Can someone help me on this? Thanks a lot!!
Complete the square in the exponent to get

$\displaystyle \displaysytle a(x^2-\frac{b}{a}x+\frac{b^2}{4a^2})-\frac{b^2}{4a}=a(x-\frac{b}{a})^2-\frac{b^2}{4a}$

Now the integral looks like

$\displaystyle \displaystyle \int xe^{a(x-\frac{b}{2a})^2-\frac{b^2}{4a}}dx=e^{-\frac{b^2}{4a}}\int xe^{a(x-\frac{b}{2a})^2} dx$

From here just make a u sub for the exponent and then you will use both of your formula's for the integral

3. ## Thanks for the quick reply!! But...

Is there a closed form solution for the below integration?

$\displaystyle \int e^{ax^2}dx$

4. Yes, but you have to use the "special function" $\displaystyle erf(x)= \frac{2}{\sqrt{\pi}}\int_0^x e^{-t^2}dt$.

Let $\displaystyle iu= \sqrt{a}x$. Then $\displaystyle dx= \frac{i}{\sqrt{a}}du$, $\displaystyle e^{ax^2}= e^{-u^2}$ and the integral becomes $\displaystyle \frac{i}{\sqrt{a}}\int e^{-u^2}du= \frac{i\sqrt{\pi}}{2\sqrt{a}}erf(-i\sqrt{a}x)+ C$.

The fact that you have $\displaystyle x^2$ in the exponential rather than $\displaystyle -x^2$ complicates things and causes those "i" factors.