# Thread: Techniques of integration (5)

1. ## Techniques of integration (5)

$\int \left(x \ln x - \frac{(n-1)!}{x^n} \right)e^x \ dx = ?$

2. Originally Posted by NonCommAlg
$\int \left(x \ln x - \frac{(n-1)!}{x^n} \right)e^x \ dx = ?$
I bet there is a better way , but I thought this was fun.

First lets break this up a bit

$
\int x\ln(x)e^xdx-(n-1)!\int x^{-n}e^xdx
$

Lets focus on the 2nd integral to start

$(n-1)!\int x^{-n}e^xdx$

so if we integrate by parts with $u=e^x \implies du =e^xdx$ and $dv=x^{-n} \implies v=-\frac{1}{n-1}x^{-n+1}$

$(n-1)!\int x^{-n}e^xdx=(n-1)!\left(-\frac{1}{n-1}x^{-n+1}e^x+\frac{1}{n-1}\int x^{-n+1}e^xdx \right)=$
$-(n-2)!x^{-n+1}e^{x}+(n-2)!\int x^{-n+1}e^x$

If we integrate by parts again we get

$-(n-2)!x^{-n+1}e^{x}-(n-3)!x^{-n+2}e^{x}+(n+3)!\int x^{-n+2}e^x$

Doing this n-1 times we get

$(n-1)!\int x^{-n}e^xdx=-e^{x}\sum_{i=1}^{n-1}[n-(1+i)]!x^{-n+i}+\int \frac{1}{x}e^{x}dx$

Now lets look at the last bit

$\int \frac{1}{x}e^{x}dx$ if we integrate this by parts we get

$\int \frac{1}{x}e^{x}dx=e^{x}\ln(x)-\int e^{x}\ln(x)dx$

Now lets integrate the last integral by parts again with

$u=e^{x} \implies du=e^{x},dv=\ln(x ) \implies v=x\ln(x)-x$

$\int \frac{1}{x}e^{x}dx=e^{x}\ln(x)-[x\ln(x)-x]e^{x}+\int [x\ln(x)-x]e^xdx$

$\int \frac{1}{x}e^{x}dx=e^{x}\ln(x)-[x\ln(x)-x]e^{x}+\int x\ln(x)e^{x}dx-\int xe^xdx$

So finally we get

$(n-1)!\int x^{-n}e^xdx=-e^{x}\sum_{i=1}^{n-1}[n-(1+i)]!x^{-n+i}+e^{x}\ln(x)-[x\ln(x)-x]e^{x}+$
$\int x\ln(x)e^{x}dx-\int xe^xdx$

Now subbing this back into the very first line we get

$e^{x}\sum_{i=1}^{n-1}[n-(1+i)]!x^{-n+i}+e^{x}\ln(x)+[x\ln(x)-x]e^{x}+\int xe^xdx$

evaluateing the last integral and simplifying gives

$e^{x}\sum_{i=1}^{n-1}[n-(1+i)]!x^{-n+i}+e^{x}\ln(x)+xe^{x}\ln(x)-e^x$

3. Hello,

Here is what I tried...

$I_n(x)=\int\left(x\ln(x)-\frac{(n-1)!}{x^n}\right)e^x ~dx$

By differentiating this (under the integral sign), we can get :
$I_n'(x)=I_n(x)+\int\left(1+\ln(x)+\frac{n!}{x^{n+1 }}\right)e^x~dx$

$I_n'(x)=I_n(x)-I_{n+1}(x)+\int\left(1+\ln(x)+x\ln(x)\right)e^x~dx$

But the latter is exactly $x\ln(x)e^x+C$

And we also have $I_n'(x)=\left(x\ln(x)-\frac{(n-1)!}{x^n}\right)e^x$

So finally :
$I_{n+1}(x)-I_n(x)=\frac{(n-1)!}{x^n}\cdot e^x+C$

And :
$I_n(x)=e^x \sum_{k=2}^n \frac{(k-2)!}{x^{k-1}}+I_2+D$

That's where I've gotten to. I didn't have much time this morning. And since I'm not at home, I don't have a paper in front of me and cannot continue immediately... I think the problem will be to compute $I_2$... The sum is just the (n-1) (or (n-2)) th derivative of x/(x-1)=1+1/(x-1), which can easily be found.

I'll think about it later. See ya

4. Originally Posted by Moo
Hello,

Here is what I tried...

$I_n(x)=\int\left(x\ln(x)-\frac{(n-1)!}{x^n}\right)e^x ~dx$

By differentiating this (under the integral sign), we can get :
$I_n'(x)=I_n(x)+\int\left(1+\ln(x)+\frac{n!}{x^{n+1 }}\right)e^x~dx$
here Moo actually used by parts: $x \ln x - \frac{(n-1)!}{x^n} = u, \ e^x dx = dv$ and the fact that $uv=I_n'(x).$

$I_n'(x)=I_n(x)-I_{n+1}(x)+\int\left(1+\ln(x)+x\ln(x)\right)e^x~dx$

But the latter is exactly $x\ln(x)e^x+C$

And we also have $I_n'(x)=\left(x\ln(x)-\frac{(n-1)!}{x^n}\right)e^x$

So finally :
$I_{n+1}(x)-I_n(x)=\frac{(n-1)!}{x^n}\cdot e^x+C$

And :
$I_n(x)=e^x \sum_{k=2}^n \frac{(k-2)!}{x^{k-1}}+I_2+D$

That's where I've gotten to. I didn't have much time this morning. And since I'm not at home, I don't have a paper in front of me and cannot continue immediately... I think the problem will be to compute $I_2$... The sum is just the (n-1) (or (n-2)) th derivative of x/(x-1)=1+1/(x-1), which can easily be found.

I'll think about it later. See ya
this is a nice approach. you probably don't need to think about finding $I_2$ because $\emptyset$'s solution, which is exactly how i created the problem, has already answered your question.