# Finding the result of a definite integral when its limit is changed and integrand is not symmetrical

So from wikipedia (https://en.wikipedia.org/wiki/List_of_integrals_of_exponential_functions#Integrals_involving_only_exponential_functions), the an $$x^2$$ integral with a function of exponential raised to the power of a quadratic is given by:

$$\int_{-\infty}^{\infty} x^2 e^{-ax^2 +bx} dx= \frac{\sqrt{\pi}(2a+b^2)}{4a^{5/2}}e^{\frac{b^2}{4a}} \\\text{where } (Re(a)>0)$$

Now that the physics-related integral that I'd like to solve has the same form but different limits, i.e.

$$\int_{0}^{\infty} x^2 e^{-ax^2 +bx} dx$$ and I couldn't find the evaluated expression of it online. Since the integrand in question, when plotted, is not symmetrical on the y-axis. Which means to solve the integral that I want it won't be just as trivial as computing the integral from $$-\infty$$ to $$\infty$$ and divide the answer by 2. Given that my constants $$a$$ and $$b$$ in this case has the form $$a = \frac{1}{4(\sigma / a_0)^2}$$ and $$b = - \left(\frac{1}{n} + \frac{2t}{k(1-t)}\right)$$ where both expressions are real numbers and $$n$$ has to be a positive integer, how can one in this case change the result of the first integral to solve my second?

Addendum: Alternately if I was to complete the square of my integral I'd have it in the form of $$A\int_{0}^{\infty} x^2 e^{-(x + c)^2} dx$$ where $$A$$ is some real number constant. However for an integral of this form I haven't been able to find a standard solution for it either.

TL;DR: I'm a physicist not a mathematician, therefore I need help on solving an integral.

## 1 Answer

Substitute $$x=y+\frac{b}{2a}$$, then it reduces to integrals of the type $$\int_{-b/(2a)}^\infty y^k e^{-ay^2}dy, \qquad k=0,1,2.$$ The one with $$k=1$$ can be computed by substitution. The one with $$k=0$$ involves the error function $$\mathrm{erf}$$, the one with $$k=2$$ can be reduced to it.

End result: $$\begin{split} \int_0^\infty x^2 e^{-ax^2+bx}dx &= \int_{-b/(2a)}^\infty \left(y+\frac{b}{2a}\right)^2e^{-ay^2+\frac{b^2}{4a}}dy \\ &= e^{\frac{b^2}{4a}} \int_{-b/(2a)}^\infty \left(y+\frac{b}{2a}\right)^2e^{-ay^2}dy \\ &= \dots \\ &= \frac{\sqrt{\pi } \left(2 a+b^2\right) e^{\frac{b^2}{4 a}} \left(\mathrm{erf}\!\left(\frac{b}{2 \sqrt{a}}\right)+1\right)+2 \sqrt{a} b}{8 a^{5/2}} \end{split}$$

• Can I ask how you have arrived to this result?Can I find it online anywhere? Commented Oct 31, 2018 at 22:53
• You can obtain the result easily by asking WolframAlpha: wolframalpha.com/input/… Commented Oct 31, 2018 at 23:02
• But I suggest you try the steps. In the second line of my computation you can expand $(y+b/(2a))^2$ and then you work out the 3 integrals separately. Yeah I know, it's painful... But you are a physicist :P Commented Oct 31, 2018 at 23:04
• Your substitution actually leads to $\int_{-b/(2a)}^\infty \left(y+\frac{b}{2a}\right)^2e^{-ay^2+\frac{by}{2}+\frac{b^2}{4a}}dy$. So I actually don't see how it becomes easier to solve apart from the fact that WolframAlpha just spits out an answer. Commented Nov 1, 2018 at 7:29
• No, the original exponent $-ax^2+bx$ becomes just $-ay^2+b^2/(4a)$, and the second term can be brought outside of the integral. Commented Nov 1, 2018 at 11:54