# Why can $\int_{x=0}^{\infty} x\,\mathrm{e}^{-\alpha x^2}\mathrm {d}x$ not be evaluated by parts to obtain $\frac{1}{2\alpha}$?

Can $$\int_{x=0}^{\infty} x\mathrm{e}^{-\alpha x^2}\,\mathrm {d}x$$ be evaluated by parts to show that $$\int_{x=0}^{\infty} x\mathrm{e}^{-\alpha x^2}\,\mathrm {d}x= \frac{1}{2\alpha}$$

I know that this can be done without parts by means of the substitution $$-\alpha x^2=u \Rightarrow -2\alpha x\, \mathrm {d}x=\mathrm {d}u$$, then $$x\mathrm dx=\frac {-1}{2\alpha}\mathrm du$$; such that

$$\displaystyle\int_{x=0}^{\infty} xe^{-\alpha x^2}\,dx=\frac {-1}{2\alpha}\displaystyle\int_{x=0}^{\infty} e^u \mathrm du= \left [ \frac {-1}{2\alpha}\displaystyle e^{-\alpha x^2} \right]_{x=0}^{\infty}=\frac{1}{2\alpha}$$

However; Can it be done like this?

$$\color{blue}{I}$$ $$=\displaystyle\int_{x=0}^{\infty} xe^{-\alpha x^2}\,dx= x\int_{x=0}^{\infty}e^{-\alpha x^2} - \int_{x=0}^{\infty}\left(\int_{x=0}^{\infty}e^{-\alpha x^2}\mathrm dx\right)\mathrm{d}x$$

Now $$\int_{x=0}^{\infty}e^{-\alpha x^2}\mathrm dx= \frac{1}{2}\left(\frac{\pi}{\alpha}\right)^\frac{1}{2}\tag{1}$$

Now by insertion of $$(1)$$ into $$\color{blue}{I}$$ yields,

$$\color{blue}{I}=\displaystyle\int_{x=0}^{\infty} xe^{-\alpha x^2}\,\mathrm{d}x=\underbrace{ \left [ x\frac{1}{2}\left(\frac{\pi}{\alpha}\right)^\frac{1}{2} \right ]_{x=0}^{\infty} - \int_{x=0}^{\infty} \frac{1}{2}\left(\frac{\pi}{\alpha}\right)^\frac{1}{2} \mathrm {d}x}_{\large\text{\color{red}{\mathrm{Undefined}}}}\ne \frac{1}{2\alpha}$$ which is clearly a contradiction.

I realize that this may be blatantly obvious to many of you why this will never work, but it is not clear to me.

What I can't understand is that if asked to evaluate say $$\int x\sin x\,\mathrm{d}x$$ by parts I would do the following: $$\int x\sin x\,\mathrm dx= x\int \sin x\,\mathrm dx-\int\left(\int \sin x\,\mathrm dx\right)\mathrm{d}x= \sin x -x\cos x$$ + C. But the method does not work for $$\int_{x=0}^{\infty} x\mathrm{e}^{-\alpha x^2}\,\mathrm dx$$ by parts as shown above. Why is this?

Could someone please explain to me why I cannot perform this integral by parts to get the answer $$\dfrac{1}{2\alpha}$$?

• $\infty - \infty \neq 0$, it's undefined – jameselmore Aug 6 '15 at 16:53
• @jameselmore Thanks changed it now – BLAZE Aug 6 '15 at 16:54
• Your integration by parts is not right. You need an antiderivative for $e^{-\alpha x^2}$. Your supplied $\int_0^{\infty} e^{-\alpha x^2}$ is not an antiderivative. – Jason Knapp Aug 6 '15 at 16:55
• @JasonKnapp Thanks for your response, can you explain in more detail please as I still don't understand sorry – BLAZE Aug 6 '15 at 16:57
• ∞−∞ isn't undefined so much as it is indeterminate (though you could say it is undefined in that it is not well defined but I digress). Essentially ∞−∞ could be anything depending on the specific expressions involved. I could create a problem where something that "looks like ∞−∞" but equals 2 or -e or anything I want if I get creative enough. – nurdyguy Aug 6 '15 at 17:02

One typical way to write integration by parts is to identify your original integral as $\int u \, dv$ and then we can use the identity $$\int u \, dv = uv - \int v \, du$$ Where we form $du$ from $u$ by differentiating $u$ with respect to the independent variable, and we form $v$ from $dv$ by antidifferentiating.

In your case, if I am taking you rightly you have $u = x$ and $dv = e^{-\alpha x^2} dx$. To proceed you need to find $v$, which would be an antiderivative of $e^{-\alpha x^2}$. You won't be able to find a closed form for this, but you can at least write $v(x) = \int_0^x e^{-\alpha t^2} \, dt$, thanks to the Fundamental Theorem of Calculus.

This would change your proposed integration by parts result. You would end up with an antiderivative for your original integrand of: $$x \int_0^x e^{-\alpha t^2} \, dt - \int \int_0^x e^{-\alpha t^2} \,dt\, dx$$

Now, when you are attempting to do a definite integral by parts, I typically prefer to first compute an antiderivative (indefinite integral) by parts and then simply use FTC. So to adapt your example, if I wished to know $\int_0^{\pi} x \sin x \, dx$, I might first use integration by parts as you did to find an antiderivative and then I would have $$\int_0^{\pi} x \sin x \, dx = \left.\sin x - x \cos x\right|_0^{\pi} = 0 - (-\pi) - (0 - 0)$$ But, you can do (proper) definite integrals by parts just by using the same endpoints on the resulting integral, and evaluating the "uv" part across those endpoints. Your integral is improper though, so this introduces an extra step: $$\int_0^{\infty} x e^{-\alpha x^2} \, dx = \lim_{b \to \infty} \int_0^bx e^{-\alpha x^2} \, dx$$ Applying the above and abusing notation, $$\int_0^bx e^{-\alpha x^2} \, dx = \left.\left( x \int e^{-\alpha x^2} \, dx \right)\right|_0^b - \int_0^b \left(\int e^{-\alpha x^2} \, dx \right) \, dx$$

If we go on to use $F(x) = \int_0^x e^{-\alpha t^2} \, dt$ as our antiderivative, this would yield $$\int_0^bx e^{-\alpha x^2} \, dx = \left. x F(x) \right|_0^b - \int_0^b F(x) \, dx$$

But unfortunately this does not lead anywhere helpful. The first term becomes $bF(b) - 0 = bF(b)$. As you have observed, as $b \to \infty$ $F(b) \to \frac{1}{2}\left(\frac{\pi}{\alpha}\right)^{\frac{1}{2}}$, but since there is a factor of $b$ the first term simply goes to $\infty$. The second term I think is a bit difficult to analyze. Maybe there is a clever way to address it but I don't know it.

I think you are going to be unsatisfied with the ultimate answer here because where this is going is this: you found by a simpler method that this integral has a finite value. You used integration by parts (made a mistake) but arrived at an expression of the type $\infty - \infty$. That is actually where this method would lead regardless of the mistake. The final answer is that this is not a contradiction with your original answer. Limits of the type $\infty - \infty$ are indeterminate, which means it could be anything! It could be infinite, or finite. Further analysis is required to find the answer. As it happens, you had already done the further analysis and found the answer was $\frac{1}{2\alpha}$.

• Well done. You might mention that $\int_0^x e^{-at^2}dt =\sqrt{\frac{\pi}{4a}}\text{erf}\left(\sqrt{a}\,x\right)$ in terms of the well-known error function. – Mark Viola Aug 6 '15 at 17:17
• @JasonKnapp Okay, now we're getting somewhere and yes $u = x$ and $dv = e^{-\alpha x^2} dx$ in my case, when I use by parts I use 1st times integral of second - integral(integral of second times differential of first) where first is $x$ and second is $e^{-\alpha x^2}$ – BLAZE Aug 6 '15 at 18:00
• @JasonKnapp What I can't understand is that if asked to evaluate say $\int x\sin x$ by parts I would do the following: $\int x\sin x\mathrm dx= x\int \sin x\mathrm dx-\int\int \sin x\mathrm dx= \sin x -x\cos x$ + C. But the method does not work for $\int_{x=0}^{\infty} x\mathrm{e}^{-\alpha x^2}\mathrm dx$ by parts as shown above. Why is this? – BLAZE Aug 6 '15 at 18:53
• @BLAZE I'm sorry because this is hard to talk about in writing. You have to be very careful with your language because when you say "integral" it matters if you mean indefinite (family of antiderivatives) or definite (representing a real number). This can create mistakes here. When in your first comment you say "integral of second," keep in mind that is an antiderivative! To adapt that to your second example, $dv = \sin x \, dx$ so $v = -\cos x$ because $-\cos$ is an antiderivative of $\sin x$. What is your antiderivative of $e^{-\alpha x^2}$? – Jason Knapp Aug 6 '15 at 18:56
• @BLAZE No, but it is a bit unfriendly in that it doesn't have a "closed form." That is why I chose to write it in my answer as $\int_0^{x} e^{-\alpha t^2} \, dt$. Dr. MV also helpfully observed that this is related to the "error function" which has a decent wikipedia article. But a mistake you had made was in essentially writing that the antiderivative was $\int_0^{\infty} e^{-\alpha^2 x} \, dx$. – Jason Knapp Aug 6 '15 at 19:14

Let $u = a \, x^{2}$ then $du = 2 a \, x \, dx$. In the integral presented the differential unit is part of the integrand. With this in mind then \begin{align} I &= \int_{0}^{\infty} x \, e^{-a \, x^{2}} \, dx = \frac{1}{2a} \, \int_{0}^{\infty} e^{- u} \, du = \frac{1}{2a}. \end{align}

Now, if integration by parts is considered then the following is obtained. \begin{align} I &= \left[ \frac{x^{2}}{2} \, e^{-a x^{2}} \right]_{0}^{\infty} + a \, \int_{0}^{\infty} x^{3} \, e^{-a x^{2}} \, dx = a \, \int_{0}^{\infty} x^{3} \, e^{-a x^{2}} \, dx \\ &= \frac{a^{2}}{2} \, \int_{0}^{\infty} x^{5} \, e^{-a x^{2}} \, dx \\ &= \cdots. \end{align} One can define the integral as $I_{1}$ and from integration by parts show that $$I_{1} = \frac{a^{2n-1}}{(2n-1)!} \, I_{2n+1}$$ where $$I_{m} = \int_{0}^{\infty} x^{m} \, e^{-a x^{2}} \, dx.$$

In the general sense integration by parts makes integrals, of the type which can be easily calculated, more complicated, but can often be used to develop a series expansion for approximations. To demonstrate this consider the same integral with a different lower limit. \begin{align} J_{b}(a) &= \int_{b}^{\infty} x \, e^{- a x^{2}} \, dx \\ &= \left[ \frac{x^{2}}{2} \, e^{- a x^{2}} \right]_{b}^{\infty} + a \, \int_{b}^{\infty} x^{3} \, e^{- a x^{2}} \, dx \\ &= - \frac{b^{2}}{2} \, e^{-a b^{2}} - \frac{a \, b^{4}}{4} \, e^{-a b^{2}} - \frac{a^{2} \, b^{6}}{12} \, e^{-a b^{2}} - \cdots. \end{align} This presents the integral as a power series in $b$.

• Hey! Hope all is well. a +1 here! ... but please explain the last statement regarding the development of a series expansion for approximations. That is not obvious to me as to where you're going with that. – Mark Viola Aug 6 '15 at 17:12
• @Dr.MV This is a classic case of thinking one thing and typing another. – Leucippus Aug 6 '15 at 18:44
• That is better! Good work ... small $b$ approx – Mark Viola Aug 6 '15 at 18:59

You can integrate by parts, but it will probably lead to a more difficult integral. For example, \begin{align} \int_0^\infty xe^{-ax^2}\,\mathrm{d}x &=\frac12\int_0^\infty\overbrace{\ e^{-ax^2}\ }^{\large u}\,\overbrace{\ \ \mathrm{d}x^2\ \ \vphantom{e^{-ax^2}}}^{\large\mathrm{d}v}\\ &=\frac12\left[x^2e^{-ax^2}\right]_0^\infty-\frac12\int_0^\infty\overbrace{\ \ \ x^2\ \ \ \vphantom{\mathrm{d}e^{-ax^2}}}^{\large v}\,\overbrace{\mathrm{d}e^{-ax^2}}^{\large\mathrm{d}u}\\[9pt] &=a\int_0^\infty x^3e^{-ax^2}\,\mathrm{d}x \end{align}

• thanks for your reply, the question I'm asking here is why we need an antiderivative to evaluate $\int_{x=0}^{\infty} x\mathrm{e}^{-\alpha x^2}\mathrm dx$ to obtain $\frac{1}{2\alpha}$ by parts instead of integrating by parts with a definite integral? Any ideas? – BLAZE Aug 6 '15 at 19:34
• I am not quite sure what you are asking. The way that I would approach this integral is by substitution with $u=x^2$. Then the integral would become $$\frac12\int_0^\infty e^{-au}\,\mathrm{d}u=\frac1{2a}$$ – robjohn Aug 6 '15 at 19:50
• In your question, you have the formula $$x\int_0^\infty e^{-ax^2} - \int_0^\infty\int_0^\infty e^{-ax^2}\,\mathrm{d}x$$ What does that mean? The integrals have one more integration sign than $\mathrm{d}$-something, and there is a free $x$ to the left of the first integral. You can't use a definite integral like a variable since a definite integral is just a constant. – robjohn Aug 6 '15 at 20:20
• The formula $\displaystyle\int u\frac{dv}{dx}dx= u\int dv -\int dv \frac{du}{dx}dx$ is exactly equivalent to $\displaystyle\int u \frac{dv}{dx}dx= u\int \frac{dv}{dx}dx - \int \int\ (\frac{dv}{dx}\frac{du}{dx} dx)$ if asked to evaluate say $\int x\sin x$ by parts I would do the following: $\int x\sin x\mathrm dx= x\int \sin x\mathrm dx-\int\int \sin x\mathrm dx= \sin x -x\cos x$ + C. But the method does not work for $\int_{x=0}^{\infty} x\mathrm{e}^{-\alpha x^2}\mathrm dx$ by parts, do you have any idea why this is? Thanks again. – BLAZE Aug 6 '15 at 21:12
• @BLAZE: with indefinite integrals, yes. Not with definite integrals. However, there is still a $\mathrm{d}$-something missing in your double integrals in the comment, too. – robjohn Aug 6 '15 at 21:14

If you want to integrate by parts like (1) suggests, you must differentiate $x$ and integrate $e^{-\alpha x^2}$. The first task is clear, the second is impossible in terms of elementary functions. So what is your mistake? Well, it seems to me that you wrongly believe that a primitive of $e^{-\alpha x^2}$ is $\int_0^\infty e^{-\alpha x^2} \, dx$. This cannot be true, since $\int_0^\infty e^{-\alpha x^2} \, dx$ is a real number, and the derivative of a given real number is always zero!

• Thanks for your answer, what do you mean by "primitive of $e^{-\alpha x^2}"$? – BLAZE Aug 6 '15 at 17:49
• Antiderivative. – Robert Israel Aug 6 '15 at 20:00