Integral of the product $x^n e^x$ I would be very pleased if you could give me your opinion about this way of integrating the following expression. I think that it has no issues, but just wanted to confirm:
$$ \int x^n e^x dx $$
$$ e^x = u $$
$$ e^x dx = du $$
$$ \int x^n e^x dx = \int \ln(u)^n du = nu(\ln(u) - 1) + C $$
$$ \int x^n e^xdx = ne^x (x-1) + C $$
Many thanks!
 A: No, your argument is completely wrong, sorry. You are mistaking
$$
(\ln u)^n
$$
with
$$
\ln(u^n)
$$
which are very different.
By the way, if you try differentiating, you get
$$
D(ne^x(x-1))=ne^x(x-1)+ne^x=nxe^x
$$

Hint:
$$
\int x^ne^x\,dx=(x^n+p(x))e^x
$$
where $p(x)$ is a polynomial of degree at most $n-1$.
A: $$\int (\ln u)^n \, \mathrm{d}u \neq nu (\ln u - 1) + C$$
Indeed, the way to go about this is to use IBP and get a recurrence relation. 
A: Here is one way to proceed.  Note that
$$\begin{align}
\int x^ne^x\,dx&=\left.\left(\frac{d^n}{da^n}\int e^{ax}\,dx\right)\right|_{a=1}\\\\
&=\left.\left(\frac{d^n}{da^n}\frac{e^{ax}}{a}\right)\right|_{a=1}\\\\
&=\left.\left(\sum_{k=0}^n\binom{n}{k}\frac{d^k a^{-1}}{da^k}\frac{d^{n-k} e^{ax}}{da^{n-k}}\right)\right|_{a=1}\\\\
&=e^x\sum_{k=0}^n (-1)^k \left(\binom{n}{k}\,k!\right)x^{n-k}\\\\
&=e^x\left(x^n+\sum_{k=1}^n (-1)^n\left(n(n-1)(n-2)\cdots (n-k+1)\right)x^{n-k}\right)
\end{align}$$
which gives the explicit form of the polynomial, $p(x)$, as discussed in the post by egreg.
A: If you have an integral of the form $$\int f(x)g(x)dx$$ such that $\exists\ n \in \mathbb{N}$ for which $$\frac{d^nf(x)}{dx^n}=0$$ 
And the repeated integral of $g(x)$ is easy to compute (as is the case for exponentials), it is convenient to apply the Tabular Method for integration by parts and then proceed by induction.
A: Another variation is using the Differential operator $D_x$ and it's inverse $D_x^{-1}$ denoting indefinite integration.

The  following is valid
  \begin{align*}
D_x^{-1}\left(e^xf(x)\right)=e^x\frac{1}{1+D_x}f(x) \tag{1}
\end{align*}
We obtain with (1)
  \begin{align*}
\int e^x x^n\, dx&=\frac{1}{D_x}\left(e^x x^n\right)\\
&=e^x\frac{1}{1+D_x}x^n\\
&=e^x\sum_{k=0}^\infty(-1)^kD_x^k x^n\tag{2}\\
&=e^x\sum_{k=0}^n(-1)^k\frac{n!}{k!}x^{n-k}
\end{align*}

Comment


*

*In (2) we use the  geometric series expansion.

