# Help? I cannot do the integration by parts correctly??

Can someone please show me how to integrate

$$\int_0^\infty\frac4{\pi b^2}x^2e^{-x^2/b^2}dx\;?$$

please show steps how to integrate this problem. This is what i have so far.

$$\frac4{\pi b^2}\int_0^\infty x^2 e^{-x^2/b^2}dx\;.$$

Then i take the property I^2 = $$\int_0^\infty\frac4{\pi b^2}x^2e^{-x^2/b^2}dx\;*\int_0^\infty\frac4{\pi b^2}y^2e^{-y^2/b^2}dx\;?$$

Then i substitue in x=rcos0 and y=rsin0 dxdy=rdrd0

Then I get: $$\int_0^{\pi/2}\int_0^\infty r^5\cos^2\theta\sin^2\theta e^{(-r^2)/b^2}drd\theta=\int_0^{\pi/2}\cos^2\theta\sin^2\theta\int_0^\infty r^5e^{(-r^2)/(b^2)}drd\theta\;.$$

Then I do $$\int_0^\infty r^5e^{(-r^2)/(b^2)}drd\theta\;.$$ using integration by parts $u=r^4$, $dv=re^{-r^2}dr$, so that $du=4r^3dr$ and $v=-\frac12e^{-r^2/b^2}$. That will leave you with something of the form $r^4(-\frac12e^{-r^2/b^2})(from 0 to infinity)-\int_0^\infty r^3e^{-r^2/b^2}dr$

Then took the limit of r from 0 to $infty$ of $r^4(-\frac12e^{-r^2/b^2})$ I got infinity. So now my problem looks like $\infty-\int_0^\infty r^3e^{-r^2/b^2}dr$

Then I did integration by parts on $\int_0^\infty r^3e^{-r^2/b^2}dr$. I let $w=r^2$, $dz=re^{-r^2/b^2}dr$, so that $dw=2rdr$ and $z=-\frac12e^{-r^2/b^2}$. Then i have $\infty-(wz-\int_0^\infty r^2e^{-r^2/b^2}dr)$.

Then I do integration by parts one more time. But when i find w and z and take the limit i get inifinity again, so i get something that looks like $\infty-(infty-\int_0^\infty r^2e^{-r^2/b^2}dr)$ . Can someone please tell me what I am doing wrong?

-
Hint: use u=x^2 substitution, then it should come out to look like the gamma distribution function. –  student101 Sep 30 '12 at 4:21
You seem to be under the impression that $r^4e^{-r^2}\to\infty$ as $r\to\infty$. You might want to reconsider. –  Gerry Myerson Sep 30 '12 at 4:26

\begin{align*}u=&x&u'=&1\\v'=&xe^{-x^2/b^2}&v=&-\frac{b^2}{2}e^{-x^2/b^2}\end{align*}\;\;\;\;\;\;\Longrightarrow

$$\Longrightarrow \int_0^\infty x^2e^{-x^2/b^2}dx=\left.-\frac{b^2x}{2}e^{-x^2/b^2}\right|_0^\infty+\frac{b^2}{2}\int^\infty_0e^{-x^2/b^2}dx=\frac{b^3}{2}\sqrt\frac{\pi}{2}$$

$$\frac{4}{\pi b^2}\frac{b^3}{2}\sqrt\frac{\pi}{2}=\sqrt\frac{2}{\pi}\,b$$
Of course, this takes $\int_0^{\infty}e^{-x^2/b^2}\,dx$ as known. Only OP knows whether that's legit. –  Gerry Myerson Sep 30 '12 at 4:33
@DonAntonio: This comes from my answer to this question, which did not take $\int_0^{\infty}e^{-x^2/b^2}\,dx$ and suggested the trig substitution. –  Brian M. Scott Sep 30 '12 at 6:55
There is an easier way than going through all the integration by parts. Note that $$\frac4{\pi b^2}x^2e^{-x^2/b^2} = - \frac{4}{\pi b^2} \frac{d}{d\lambda} e^{-\lambda x^2}$$ with $\lambda = b^{-2}$. Using this relation and exchanging differentiation and integration yields $$\int_0^\infty\!dx\,\frac4{\pi b^2}x^2e^{-x^2/b^2} =- \frac{4}{\pi b^2} \frac{d}{d\lambda} \int_0^\infty\!dx\,e^{-\lambda x^2} = - \frac{4}{\pi b^2}\frac{d}{d\lambda} \sqrt{\frac{\pi}{4\lambda}}$$ from which the final result can be obtained easily.