25

The integral I am trying to compute is this:

$$\int x^{4}e^{-x}dx$$

I got the right answer but I had to integrate by parts multiple times. Only thing is it took a long time to do the computations. I was wondering whether there are any more efficient ways of computing this integral or is integration by parts the only way to do this question?

Edit: This question is similar to the question linked but slightly different because in the other question they are asking for any method to integrate the function which included integration by parts. In this question I acknowledge that integration by parts is a method that can be used to evaluate the integral but am looking for the most efficient way. This question has also generated different responses than the question linked such as the tabular method.

Mike Pierce
  • 18,938
user262291
  • 1,459
  • 1
    Would need limits for this if you intend a numerical answer. Not meant to be a trivial statement since if the upper limit is infinity then more computation needed. – jim Apr 10 '16 at 18:50
  • @mikevandernaald Gamma function has a limits , there is no limits – openspace Apr 10 '16 at 18:51
  • 1
    I think that the simplest way to compute it is integrating by parts. – Crostul Apr 10 '16 at 18:52
  • In the original question I was attempted the limits of integration were from 0 to 1 – user262291 Apr 10 '16 at 18:52
  • Why does it take a long time to do by parts? Surely you can write it straight down? $-x^4-4x^3-12x^2-24x-24$ – almagest Apr 10 '16 at 18:52
  • If there are limits of integration, put them in your post. Sometimes they totally change the problem. – Alex M. Apr 10 '16 at 18:53
  • I'm actually doing practice problems for a mutlivarble exam and being able to find the fastest way of doing something would be of great benefit. – user262291 Apr 10 '16 at 18:53
  • 3
    Use the tabular method http://pages.pacificcoast.net/~cazelais/187/tabular.pdf –  Apr 10 '16 at 18:57
  • @AhmedHussein I haven't seen this method before do you mind explaining it? – user262291 Apr 10 '16 at 18:58
  • Set up a reduction formula.. – Edward Evans Apr 10 '16 at 18:59
  • @user262291 it is just integration by parts but makes the integral very easy to compute. It can be easily understood through the examples given there. –  Apr 10 '16 at 19:00
  • it seems you can't compute $\int x^n e^{-x} dx$ without solving a (lower triangular) system of $n$ linear equations with $n$ unknowns – reuns Apr 10 '16 at 19:44
  • 1
    @J.M.: How is this a duplicate? The other questions for any way to do the integration, while this one acknowledges integration by parts but asks for an easier way. – Rory Daulton Apr 11 '16 at 19:32

3 Answers3

34

While it still entails integration by parts, there exists a "quick" method of doing the integration by parts called the Tabular Method. Basically, you start with a table that has $3$ columns. One with alternating signs, one with a $u$ and one with $dv$. In the column for $u$, you should put the term that will eventually go to zero after multiple differentiations. In the last column is $dv$ which you will integrate multiple times. You'll want to pick something you can still integrate multiple times for $dv$. So in $\displaystyle \int x^4e^{-x}\,dx$, we can create the following table: $$\begin{matrix} & u & dv \\ + &x^4 & e^{-x} \\ - & 4x^3 & -e^{-x} \\ + & 12 x^2 & e^{-x} \\ - & 24x & -e^{-x} \\ + & 24 & e^{-x} \\ - & 0 & -e^{-x}.\end{matrix}$$ we now have all the parts to compute our solution. You start at the very first $+$, and multiply the corresponding $u$ term with the $dv$ term on the very next line. Continue this process until you get to the end of the $dv$ column. So our solution is $$\int x^4e^{-x}\,dx = -x^4e^{-x} -4x^3e^{-x} -12x^2e^{-x}-24xe^{-x}-24e^{-x} + C$$

Decaf-Math
  • 4,522
18

Usually this kind of integrals can be handled by making

\begin{align*} \int x^4e^{-x}\,\mathrm dx&=-x^4e^{-x} + (Ax^3+Bx^2+Cx+E)e^{-x} \end{align*} Where $A,\;B,\;C$, and $E$ are constants which satisfies $$x^4e^{-x}+(-4-A)x^3e^{-x}+(3A-B)x^2e^{-x}+(2B-C)xe^{-x}+(C-E)e^{-x}=x^4e^{-x}$$ So \begin{align*} -4-A&=0\\ 3A-B&=0\\ 2B-C&=0\\ C-E&=0 \end{align*} Then $A=-4$, $\;B=3A=-12$, $\;C=2B=-24$ and $E=C=-24$, then \begin{align*} \int x^4e^{-x}\,\mathrm dx&=-(x^4+4x^3+12x^2+24x+24)e^{-x}+K \end{align*} where $K$ is a constant.


Also, here is a more general problem related.

13

Here is a nice little trick to integrate it without using partial integration. $$ \int x^4 e^{-x} \,\mathrm dx = \left. \frac{\mathrm d^4}{\mathrm d \alpha^4}\int e^{-\alpha x} \,\mathrm dx \right|_{\alpha=1} = \left.- \frac{\mathrm d^4}{\mathrm d \alpha^4} \frac{1}{\alpha} e^{-\alpha x}\right|_{\alpha=1} $$ The idea is to introduca a variable $\alpha$ in the exponent and write the $x^4$ term as the fourth derivative with respect to $\alpha$. This is especially helpful when you want to calculate the definite integral $\int_0^\infty$ because in this case the differentiation greatly simplifies. $$ \int\limits_0^\infty x^n e^{-x} \,\mathrm dx = (-1)^n \left. \frac{\mathrm d^n}{\mathrm d \alpha^n} \frac{1}{\alpha} \right|_{\alpha=1} = n!\stackrel{n=4}{=} 24 $$

Jannick
  • 193
  • 1
    This is sometimes called the Feynman's trick. An interesting list of integrals that can be solved in this way can be found in an answer to https://math.stackexchange.com/q/2987994 – Jean Marie Dec 22 '19 at 10:00