# How to evaluate $\int_{0}^{\infty} x^4 e^{-x^2/{\beta}^2}dx$?

Can someone show me how to evaluate

$\int_{0}^{\infty} x^4 e^{-x^2/{\beta}^2}dx$?

I am working on verifying that a function is a pdf, and finding its expectation and variance. I want to be able to do it step-by-step, without just getting the answer from a CAS. Thanks in advance!

• When I get stuck on integrals I usually try plugging them into Wolfram Alpha to see if it helps. In your case: wolframalpha.com/input/?i=integral+x^4*e^%28-x^2%2Fbeta^2%29+dx They sometimes will show you how they solved the integral as well.
– user25658
Commented Sep 23, 2013 at 14:57
• Welcome to the site! This question does not appear to be about statistics within the scope defined in the help center, and should belong on math.stackexchange.com. Anyway, definite integral for your example can be coded as this. Commented Sep 23, 2013 at 15:14
• @Randel I agree that this question is not explicitly about statistics and would get several good answers quickly on the math site. However, it does point out a statistical connection and there certainly exist solutions that are motivated by statistical concepts and a few that even use statistical ideas. Thus I am not voting to migrate this one, in the expectation that our community will provide answers with more statistical interest than one might hope to see on a purely mathematical forum.
– whuber
Commented Sep 23, 2013 at 15:17
• Examples of what I mean by "motivated by statistical concepts" are (1) This integral is linearly related to the fourth moment of the Standard Normal distribution; (2) Interpreted as an unnormalized distribution for a random variable X, it exhibits $X^2$ as a Gamma variable.
– whuber
Commented Sep 23, 2013 at 15:41
• As an additional approach to those below, let me play the stupid statistician trick. Consider the substitution $y = x^2/\beta^2$; then play 'spot the scaled density', multiply and divide by the required scaling constant, and cross out the now correctly-scaled-density which integrates to 1, leaving a constant. Commented Sep 24, 2013 at 7:49

If you know that $$\int_{0}^{\infty} e^{-\alpha x^{2}} dx = \frac{1}{2}\sqrt{\frac{\pi}{\alpha}}$$ then by differentiating twice under the integral sign, you have:

$$\frac{\partial^{2}}{\partial \alpha^{2}} \int_{0}^{\infty} e^{-\alpha x^{2}} dx = \int_{0}^{\infty} x^{4} e^{-\alpha x^{2}} dx$$

Therefore, applying the differentiation to the result you already know:

$$\frac{\partial^{2}}{\partial \alpha^{2}} \int_{0}^{\infty} e^{-\alpha x^{2}} dx = \frac{\partial^{2}}{\partial \alpha^{2}} \frac{1}{2}\sqrt{\frac{\pi}{\alpha}} = \frac{3\sqrt{\pi}}{8\alpha^{5/2}}$$

In your problem, simply substitute $\alpha = 1/\beta^{2}$ and you have the result that you can verify in W|A:

$$\int_{0}^{\infty} x^{4} e^{-\alpha x^{2}} dx = \frac{3\sqrt{\pi}}{8\left(\frac{1}{\beta^{2}}\right)^{5/2}}$$

Given your recent update, let me add the following:

You should know that the expectation and variance are given by

$$E[X] = \int x f(x)dx$$

and $$Var(X) = \int (x-\mu)^2f(x)dx$$

I'm sure you can integrate by substitution the first one. The variance is a bit easier once you know how to apply the Gaussian integral above, since it involves a term $\int x^{2} f(x) dx$ and a constant $\mu$. In that case, of course, you only need to differentiate once.

• Man, if only I could upvote this twice!
– user30602
Commented Sep 23, 2013 at 15:42
• In R, you use (assuming beta=1) integrand<-function(x){(x^4)*(exp(-(x^2)/2))} and then integrate(integrand,lower=0,upper=Inf) with results= 3.759942 with absolute error < 7.2e-06 Commented Sep 23, 2013 at 20:35

For general use, and when not in need to show step-by-step calculations, note that your integral is a Mellin transform of $e^{-x^2/{\beta}^2}$. The following general relation holds:

$$\int_0^{\infty} x^{s-1}\exp\left\{-ax^h\right\}dx = h^{-1}a^{- s/h} \Gamma\left( s/h\right)\;, \qquad h>0, \;\text {Re}\,a>0,\;\text {Re}\,s>0$$

...where $\Gamma()$ is the Gamma function. This leads of course to the answer given by @Robert Smith, using the specific numerical values.

Finally , you cannot "verify" that it is a pdf - what you can do it to determine for what value of $\beta$ it becomes a proper pdf over the specific domain, i.e. that it integrates to unity.

• The Mellin transform can be understood from a statistical point of view as finding the normalization factor for a power transformation of a Gamma variate. If we don't put it into some such context, then your formula merely seems to replace one thing to prove by another. BTW, there is an issue of verifying this can be a PDF: it's usually understood that normalization by a constant is an option (the OP only refers to "a" function, not to "this" function), so the question amounts to showing that the integrand is nonnegative and the integral converges to some finite value.
– whuber
Commented Sep 23, 2013 at 19:54
• @whuber I posted the formula as a ready-made integral-calculating tool, nothing more, a work for which it is valid. No interpretational strings attached! Commented Sep 23, 2013 at 20:31