# Moment of a probability distribution

1. Oct 27, 2004

### dbb04

when you calculate the Moment of the following equation

$$p(x)=\left\{\begin{array}{cc}2Axe^{-Ax^2},&\mbox{ if } x\geq 0\\0, & \mbox{ if } x<0\end{array}\right.$$

We get

$$Mn =2A \int_0^\infty x^{n+1}e^{-Ax^2}$$

solving it by parts I am getting

$$Mn=(n+1)\int_0^\infty x^{n-1}e^{-Ax^2}$$

but, apparently, the right solution is

$$Mn=n\int_0^\infty x^{n-1}e^{-Ax^2}$$

What am I doing wrong? What is the proper way to solve it? Could you please do it step by step?

Thanks

2. Oct 27, 2004

### Tide

It looks like you didn't differentate properly when you integrated by parts:

$$\frac {d x^n}{dx} = n x^{n-1}$$

3. Oct 28, 2004

### dbb04

sorry, still not following you.
If we integrate by parts we have

$$Mn =2A \int_0^\infty x^{n+1}e^{-Ax^2}$$

$$\int_0^\infty u\frac{dv}{dx} dx=uv-\int_0^\infty v\frac{du}{dx} dx$$

where

$$u=x^{n+1} \ \ \ \ \ \frac{du}{dx}=(n+1)x^n$$

and

$$\frac{dv}{dx}=e^{-Ax^2} \ \ \ \ \ v= -\frac{e^{-Ax^2}}{2xA}$$

so

$$Mn=2A \ \{-x^{n+1} \ \frac{e^{-Ax^2}}{2xA} \ \ |_0^\infty +\int_0^\infty \frac{e^{-Ax^2}}{2xA}(n+1)x^n dx \ \}$$

$$Mn=0 +(n+1)\int_0^\infty x^{n-1} \ e^{-Ax^2} dx$$

So, How you get rid of the (n+1) term.
Thanks

4. Oct 28, 2004

### Tide

This should get you where you want to go:

$$\int_0^{\infty}x^{n+1} e^{-Ax^2} dx = - \frac {1}{2A} \int_0^{\infty}x^n \frac {d}{dx}e^{-Ax^2}dx$$

5. Oct 29, 2004

Thanks Tide,