What is the Integral of $\ x^a e^{ax}$?

132 Views Asked by At

Suppose we have the Chi-Square Probability Distribution Function (https://en.wikipedia.org/wiki/Chi-squared_test):

$$f(x;k) = \frac{1}{2^{k/2}\Gamma(k/2)} x^{k/2-1} e^{-x/2}$$

I am interested in learning how I can integrate the above function by myself:

$$\int \frac{1}{2^{k/2}\Gamma(k/2)} x^{k/2-1} e^{-x/2} dx$$

To begin with, I can recognize that the first term in this integral is a constant with respect to $x$ . This means that I should be able to write this integral as:

$$\frac{1}{2^{k/2}\Gamma(k/2)} \int x^{k/2-1} e^{-x/2} dx$$

I think now I can write the remainder of this integral in generic where $a$ is some constant term and $x$ is the variable of interest:

$$\int x^a e^{ax} dx$$

I do not know how to integrate the above expression - I tried to search for references online that show how to integrate functions in the above form, but I could not find anything (closest I could was Integrate $e^{-ax}$ and $xe^{-ax}$?). And I am not sure how the information from this reference can be adapted to solve the integral I am working on.

My Question:

  • Can someone please show me how to integrate the above function?
  • And after successfully integrating this function - can we then show that entire Chi-Square Probability Distribution Function integrates to $1$ over $\infty, -\infty$ ?

Thanks!

References:

2

There are 2 best solutions below

0
On

If $k$ is an even integer, say, $k = 2m + 2 \geq 2$, then applying integration by parts $m$ times yields $$\int x^{\frac{k}{2} - 1} e^{-\frac{x}{2}} \,dx = -2 e^{-\frac{x}{2}} \cdot m! \sum_{j=0}^m \frac{1}{j!} (2 x)^j + C.$$ (Cf. OEIS A161381.) In this case, the normalization constant $\frac{1}{2^\frac{k}{2} \Gamma\left(\frac{k}{2}\right)}$ specializes to $\frac{1}{2^{k + 1} m!}$.

If $k$ is not an even integer, however, the antiderivative of the probability density function $$x^{\frac{k}{2} - 1} e^{-\frac{x}{2}}$$ of the chi-squared distribution does not have an antiderivative expressible in terms of elementary functions. The incomplete gamma function, $$\Gamma(x, s) := \int_s^\infty e^{-t} t^{x - 1} \,dt ,$$ which Claude Leibovici mentioned in the comments, is almost purpose-built for this sort of situation. Given the integral $$\int x^{a - 1} e^{-b x} \,dx, \qquad a > 0, \quad b > 0,$$ the substitution $t = b x$, $dt = b \,dx$ quickly yields the antiderivative $$-\frac{1}{b^a} \Gamma(a, b x) + C .$$

In particular, the integral over $[0, \infty)$ is $$\int_0^\infty x^{a - 1} e^{-b x} \,dx = \frac{\Gamma(a)}{b^a} ,$$ where $\Gamma(x) = \Gamma(x, 0) = \int_0^\infty e^{-t} t^{x - 1} \,dt$ is the usual gamma function.

For the chi-squared distribution with $k$ degrees of freedom, we have $a = \frac{k}{2}$, $b = \frac{1}{2}$, so the cumulative density function is $$\frac{1}{2^\frac{k}{2} \Gamma\left(\frac{k}{2}\right)} \int_0^s x^{\frac{k}{2} - 1} e^{-\frac{x}{2}} \,dx = 1 - \frac{\Gamma\left(\frac{k}{2}, \frac{s}{2}\right)}{\Gamma\left(\frac{k}{2}\right)},$$ and $$\frac{1}{2^\frac{k}{2} \Gamma\left(\frac{k}{2}\right)} \int_0^\infty x^{\frac{k}{2} - 1} e^{-\frac{x}{2}} \,dx = 1 ,$$ as expected.

If $k$ is an odd integer, we can express the antiderivative of the p.d.f. using elementary functions and the error function.

0
On

Incomplete Gamma Function

Letting $y=bx$ transforms the integral into $$ \begin{aligned} I & =\int\left(\frac{y}{b}\right)^{a-1} e^{-y} \frac{d y}{b} \\ & =\frac{1}{b^a} \int y^{a-1} e^{-y} d y \\ & =\frac{1}{b^a} \Gamma(a, y)\\&=\frac{1}{b^a} \Gamma(a, b x) \end{aligned} $$ where $\Gamma(k,z)$ is a incomplete gamma function.