# Integration by parts and polar coordinates

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\;.$$

I know i need to use integration by parts. let $u = x$ and $dv = xe^{-x^2/b^2}$, then $du=dx$ and $v=\int xe^{-x^2/b^2}dx$. But this is where i get stuck.

I know i will need to somehow get $\int xe^{-x^2/b^2}dx$ by itself to use polar coordinates but not sure how to get it by itself and then put everything back together. I appreciate any help!!!

-

These types of integrals are widely used in statistics, and one of the most practical approaches to tackle them is to exploit the gamma function. Recalling the definition of the gamma function

$$\Gamma(s) = \int_{0}^{\infty} t^{s-1} {\rm e}^{-t}dt\,.$$

Making the change of variables $y=\frac{x^2}{b^2}$ casts the integral to the gamma function

$$\int_0^\infty\frac4{\pi b^2}x^2e^{-x^2/b^2}dx\;= \frac{2b}{\pi}\int _{0}^{\infty }\sqrt {y}\,{{\rm e}^{-y}}{dy} = \frac{2b}{\pi} \Gamma(\frac{3}{2}) = \frac{b}{\pi}\Gamma(\frac{1}{2})= \frac{b}{\sqrt{\pi}}\,.$$

-
I need to show that this integral is a pdf. how do i do that? –  user43126 Sep 30 '12 at 17:28
@user43126:I assume you know the definition of pdf. Just apply it on the function f(x). –  Mhenni Benghorbal Oct 1 '12 at 4:05
@user43126:if you integrate your function from $-\infty$ to $\infty$ you do not get 1. –  Mhenni Benghorbal Oct 1 '12 at 4:17

This one requires a trick. Let $I$ be the value of the integral. Then

\begin{align*} I^2&=\left(\int_0^\infty\frac4{\pi b^2}x^2e^{-x^2/b^2}dx\right)\left(\int_0^\infty\frac4{\pi b^2}y^2e^{-y^2/b^2}dy\right)\\\\ &=\frac{16}{\pi^2b^4}\int_0^\infty\int_0^\infty x^2y^2e^{-(x^2+y^2)/b^2}dydx\;. \end{align*}

Now convert to polar coordinates: $x=r\cos\theta$, $y=r\sin\theta$, etc. You’re integrating over the first quadrant, so you want your double integral in polar coordinates to have $0\le\theta\le\frac{\pi}2$ and $0\le r<\infty$. When you’ve completed the integration, you’ll have $I^2$, from which you can easily get $I$.

Added: Ignoring the various constants, you have essentially something like $$\int_0^{\pi/2}\int_0^\infty r^5\cos^2\theta\sin^2\theta e^{-r^2}drd\theta=\int_0^{\pi/2}\cos^2\theta\sin^2\theta\int_0^\infty r^5e^{-r^2}drd\theta\;.$$

The inner integral (with respect to $r$) can be done by repeated integration by parts; for the first one let $u=r^4$, $dv=re^{-r^2}dr$, so that $du=4r^3dr$ and $v=-\frac12e^{-r^2}$. That will leave you with something of the form $\int_0^\infty r^3e^{-r^2}dr$ to deal with. Repeat the process, and you’ll have something of the form $\int_0^\infty re^{-r^2}dr$, which you can integrate outright.

At that point you’ll be integrating some multiple of $\cos^2\theta\sin^2\theta$. One way is to use the double angle formula for the sine to rewrite this as $\frac12\sin^22\theta$, then use the half-angle formula to rewrite $\sin^22\theta$ as $\frac12(1-\cos 4\theta)$, which you can integrate.

-
is there any way to do this without the I^2? –  user43126 Sep 30 '12 at 1:47
@user43126: Not to my knowledge, other than getting it from another integral whose evaluation uses the same trick, like josh314’s. –  Brian M. Scott Sep 30 '12 at 1:50
so i did this and substituted but i am still stuck where i was earlier. I got IntIntr^5cos^20sin^20drd0 what do i do from here. sorry i have looked this up but can't figure it out and haven't had calculus in over ten years –  user43126 Sep 30 '12 at 2:15
@user43126: It was too much for a comment, so I added it to the answer. –  Brian M. Scott Sep 30 '12 at 2:28
Brian, when I got to the part that you said i could integrate right out. i used the part i knew that Josh wrote earlier. But when I finished the integration by parts when i started substituting back in i got something with a bunch of infinities that all but one canceled out. I will add this in above –  user43126 Sep 30 '12 at 3:35

I actually would use a different trick. I'm assuming that you know that $$\int^\infty_0 dx~e^{-a x^2} = {1\over2} \sqrt{\pi\over a}~.$$ The derivative of the right-hand side with respect to $a$ is a trivial calculation and the derivative of the left-hand side is proportional to the integral you want to solve for (after setting $a=b^{-2}$).

-
yes this is what i am wanting to use. Do i need to do substitution to get from where i stopped to what you wrote? –  user43126 Sep 30 '12 at 1:50
No substitution is necessary. After taking the derivative w.r.t. $a$, the integral is almost exactly the integral that you want, up to a constant. The answer is just the derivative of the right-hand side by $a$, multiplied by the appropriate constant. You don't really need to do any integration technique at all, just start with the well-known integral that I listed above. –  josh314 Sep 30 '12 at 1:55
Full disclosure: as Brian M. Scott said above, if this is some assignment where you need to show all the steps, then computing the integral that I use as a starting point requires a similar trick to the one in his answer. –  josh314 Sep 30 '12 at 2:02
ok. i am trying to use Brian's then. hmmm do you have a video you know that shows this anywhere? been trying to find one but no luck. thank you for all your help –  user43126 Sep 30 '12 at 2:16
You may want to use a combination of our approaches. Using the trick Brian advocated is easier if done with the simple exponential integral in my response than with the full-fledged integral that you are trying to solve. Once you verify the equation that I wrote, you can follow the procedure I listed to get the answer to your integral. –  josh314 Sep 30 '12 at 2:23