Is there an easy way to compute $\int_{-\infty}^\infty\exp(-x^2+2x)\mathrm{d}x$ without using a computer package?
How to evalutate this exponential integral
-
0I judt ran into this. Found a solution in larsons problem solving through problems. Problem 1 ,4 ,4. He squares entire integral. https://www.google.com/url?sa=t&source=web&rct=j&url=https://math.la.asu.edu/~ifulman/spring13/mat194/problem-solving.pdf&ved=2ahUKEwjop5ueza_cAhUJjFQKHVjmDwcQFjAAegQIABAB&usg=AOvVaw3ojecQy5DfCOW9Us_cozGx – 2018-07-21
2 Answers
In general $ \begin{align} \int_{x=0}^\infty e^{-(ax^2+bx)}\,dx&=\int_{x=0}^\infty \exp\left(-a\left(\left(x+\frac{b}{2a}\right)^2-\frac{b^2}{4a^2}\right)\right)\,dx\\ &=\exp\left(\frac{b^2}{4a}\right)\int_{x=0}^\infty \exp\left(-a\left(x+\frac{b}{2a}\right)^2\right)\,dx\\ \end{align} $ Let $u=x+\frac{b}{2a}\;\rightarrow\;du=dx$, then $ \begin{align} \int_{x=0}^\infty e^{-(ax^2+bx)}\,dx&=\exp\left(\frac{b^2}{4a}\right)\int_{x=0}^\infty \exp\left(-a\left(x+\frac{b}{2a}\right)^2\right)\,dx\\ &=\exp\left(\frac{b^2}{4a}\right)\int_{u=0}^\infty e^{-au^2}\,du.\\ \end{align} $ The last form integral is Gaussian integral that equals to $\frac{1}{2}\sqrt{\frac{\pi}{a}}$. Hence $ \int_{x=0}^\infty e^{-(ax^2+bx)}\,dx=\frac{1}{2}\sqrt{\frac{\pi}{a}}\exp\left(\frac{b^2}{4a}\right). $ In your case, $ \begin{align} \int_{-\infty}^\infty e^{-x^2+2x}\,dx&=2\int_0^\infty e^{-(x^2-2x)}\,dx\\ &=2\cdot\frac{1}{2}\sqrt{\frac{\pi}{1}}\exp\left(\frac{(-2)^2}{4\cdot1}\right)\\ &=e\sqrt{\pi}. \end{align} $
$\text{# }\mathbb{Q.E.D.}\text{ #}$
-
0I don't understand why the lower limit $x = 0$ does not change to $u = \frac{b}{2a}$ up on the change of variables. Indeed wolfram alpha shows your answer is not correct, likely due to this limit change? – 2017-11-21
This is a Gaussian integral. In general you can use the formula $\int_{-\infty}^{\infty} \exp(-x^2+bx+c)\mathrm{d}x=\sqrt{\pi}~\exp(b^2/4+c)$. This formula, as suggested by Thomas, can be derived by completing the square in the exponent, and using $\int_{-\infty}^{\infty} \exp(-x^2)\mathrm{d}x=\sqrt{\pi}$.