What is the most efficient method to evaluate this indefinite integral?

Solution 1:

Notice that $\int e^{tx}dx=\frac{e^{tx}}{t}+C$. By differentiating in $t$ $5$-times and evaluating at $t=1$ we get:

$\int x^{5}e^{x}dx=x^{5}e^{x}-5x^{4}e^{x}+20x^{3}e^{x}-60x^{2}e^{x}+120xe^{x}-120e^{x}$

Solution 2:

There is a very efficient operator approach.

Let $D$ be the differentiation operator, and $1/D$ its inverse (indefinite integration). Using the rule (see appendix) that $${1\over D}e^{ax}f(x)=e^{ax}{1\over D+a}f(x)$$ we get $$\begin{align}\int x^5 e^x\,\mathrm{d}x={1\over D}x^5e^x&=e^x\frac{1}{1+D}x^5 \\&=e^x\left(1-D+D^2-\cdots\right)x^5 \\ &=e^x\left(x^5-5x^4+20x^3-60x^2+120x-120\right)\end{align}$$


Appendix: Proof of Rule

First, we note that $$D\,e^{ax}f(x)=ae^{ax}f(x)+e^{ax}f'(x)=e^{ax}(D+a)f(x).$$ Therefore $$D\left[e^{ax}{1\over D+a}f(x)\right]=e^{ax}(D+a)\frac{1}{D+a}f(x)=e^{ax}f(x)=D\left[{1\over D}e^{ax}f(x)\right]$$

and the rule is "basically" proven :) ... There are still some points to clarify (justifying the treatment of $D$ as an operator, the use of the operator "power series", constants of integration, etc.) but that is the essence of the method.

Solution 3:

The following is a close relative of integration by parts. Let us guess that the answer is $x^5e^x$. Differentiate to see whether we got lucky. We get $x^5e^x+5x^4e^x$. Too bad!

But maybe we can fix things by subtracting $5x^4e^x$, so our next guess is $x^5e^x -5x^4e^x$. Differentiate. We get $x^5e^x -20x^3e^x$. Maybe we can fix things by adding $20x^3e^x$. So our next guess is $x^5e^x-5x^4e^x +20x^3e^x$. Continue. It is soon over.

Remark: The general idea works nicely for $\sin(5x)e^{-3x}$, a standard integration by parts problem that causes me a great deal of trouble because of all the minus signs. But if we make a suitable guess, we can quickly arrive at the answer.

Solution 4:

You might guess that the antiderivative has the form

$$ (a_5 x^5 + a_4 x^4 + a_3 x^3 + a_2 x^2 + a_1 x + a_0)e^x + C, $$

then differentiate this to get

$$ \Bigl(a_5 x^5 + (5a_5 + a_4) x^4 + (4a_4 + a_3) x^3 + (3a_3 + a_2) x^2 + (2a_2 + a_1) x + a_1 + a_0\Big)e^x. $$

Setting the polynomial factor equal to $x^5$ renders the system of linear equations

$$ \begin{align} a_5 &= 1, \\ na_n + a_{n-1} &= 0, \quad n = 1,2,3,4,5, \end{align} $$

which can be solved iteratively for the coefficients $a_n$ to find that

$$ a_5 = 1, \quad a_4 = -5, \quad a_3 = 20, \quad a_2 = -60, \quad a_1 = 120, \quad a_0 = -120. $$

In general you can use this method to show that the antiderivative of $x^n e^x$ is

$$ e^x \sum_{k=0}^{n} a_k x^k + C, $$

where

$$ a_k = (-1)^{n-k}\frac{n!}{k!}. $$

Solution 5:

Another approach that gets all the integrals $\int x^n e^x\; dx$ at once is generating functions. Let $F_n(x) = \int x^n e^x\; dx$ (I won't worry about constants of integration). The exponential generating function of this sequence is $$ g(t,x) = \sum_{n=0}^\infty \dfrac{F_n(x)}{n!} t^n $$ Note that $g(t,0) = 1$. Interchange sum and integral (we assume we can do this):

$$g(t,x) = \int \sum_{n=0}^\infty \dfrac{x^n}{n!} t^n e^x \; dx = \int e^{xt + x}\; dx = \dfrac{e^{tx+x}}{t+1}$$ Now $$\dfrac{1}{t+1} e^{tx+x}= e^x \sum_{j=0}^\infty (-1)^j t^j\sum_{k=0}^\infty \dfrac{(t x)^k}{k!}$$ so by equating the coefficients of $t^n$ on both sides we get $$ \dfrac{F_n(x)}{n!} = e^x \sum_{k=0}^n (-1)^{n-k} \dfrac{x^k}{k!}$$