Q)Is there any shortcut method to evaluate $$\int (xe^{x})^{n}dx,$$ where $n$ is a positive integer?
Ans) My approach:
Let $$I=\int (xe^{x})^{n}dx$$ Now let's solve by cases.
Case-1) When $n=1$, then we can write $$I=\int xe^{x}dx.$$ Now we have to integrate by applying Integration By Parts.
Therefore, $$I=x\int e^{x}dx-\int \frac{d}{dx}(x)\int e^{x}dx$$ $$\implies I= e^{x}(x-1)+C.$$
Case-2) When $n=2$, then we can write $$I=\int x^{2}e^{2x}dx.$$ Now again we have to integrate by applying Integration By Parts.
$$I=\int x^{2}e^{2x}dx$$ $$\implies I=x^{2}\int e^{2x}dx-\int\frac{d}{dx}(x^{2})\int e^{2x}dx$$ $$\implies I=\frac{x^{2}}{2}e^{2x}-\int xe^{2x}dx$$
Now after this step we have to integrate $$\int xe^{2x}dx$$ by applying Integration By Parts.
My doubt:
It will be very difficult to integrate $$\int (xe^{x})^{n} dx$$ by applying Integration By Parts for $n\geq 4$. The calculation will go on becoming lengthy. I want to know whether there is any shortcut method for this Integral ? Please help me out with this Integral.
$$I_n:=\int (x)^n e^{xn }dx $$ Let $xn =t $, $dx =\frac{dt}{n}$
$$I_n=\frac{1}{n^{n+1}}\int (t)^n e^{t }dx $$
Note that $\int e^t t dt = te^t -e^t = \sum\limits_{k=0}^{1}(-1)^{k} e^t t^ {1-k} P(1,k) $ such that $P(n,k )= \frac{n!}{k!}$
Assume that $I_{n-1} =\frac{1}{n^{n+1}}\sum\limits_{k=0}^{n-1}(-1)^{k} e^t t^ {n-1-k} P(n-1,k) $ $$I_{n}= \frac{1}{n^{n+1}} \bigg(e^t t^n - n\int t^{n-1}e^t dt \bigg)+C= \frac{1}{n^{n+1}}\bigg(e^t t^n-n\sum\limits_{k=0}^{n-1}(-1)^{k} e^t t^ {n-1-k} P(n-1,k)\bigg)$$ $$ =\frac{1}{n^{n+1}}\sum\limits_{k=0}^{n}(-1)^{k} e^t t^ {n-k} P(n,k) $$
Bu induction $I_{n}=\frac{1}{n^{n+1}}\sum\limits_{k=0}^{n}(-1)^{k} e^t t^ {n-k} P(n,k) $ for all $n$
$I_{n}= \frac{1}{n^{n+1}}\sum\limits_{k=0}^{n}(-1)^{k} e^t t^ {n-k} P(n,k) =\frac{1}{n^{n+1}}\sum\limits_{k=0}^{n}(-1)^{k} e^{ nx}{(nx)}^ {n-k} P(n,k)$