# $\frac{1}{x^2} \int xe^x dx$ without using integration by parts

On a test i just had, i needed to solve a differential equation which lead me to having to find the result of

$$\frac{1}{x^2}\int xe^x dx$$

I then attempted to do this integral without integration by parts, (i did this because i forgot about integration by parts, yes i know you can scold me later if you wish) this is my work

$$x e^x = \sum_{k=0}^{\infty}\frac{x^{k+1}}{k!} \therefore$$

$$\frac{1}{x^2}\int xe^x dx = \frac{1}{x^2}\sum_{k=0}^{\infty}\frac{x^{k+2}}{(k+2) k!}$$

I know the answer is $e^x(\frac{1}{x}-\frac{1}{x^2})$ but how do i go about finding this result from the summation? Edit:

I tried to manipulate in this way

$$\frac{1}{x^2}+\frac{1}{x^2}\sum_{k=0}^{\infty}\frac{x^k (k-1)}{k!}$$ But this seems even worse.

• Shouldn't the $\frac{1}{x^2}$ be on the inside of the integral? Nov 25, 2014 at 23:40
• Regarding forgetting integration by parts, it's an immediate consequence of the product rule: $(fg)'=f'g+fg'\implies \int (fg)'-\int fg'=\int f'g\implies \int f'g=fg-\int fg'$. Nov 25, 2014 at 23:42
• @GitGud yes im aware haha it just didn't come across my mind Nov 25, 2014 at 23:43
• @Eric See how much unnecessary grief you caused yourself by not being able to rederive it from the chain rule? These simple calculational tools are so important to be as natural as breathing-otherwise,you have to do crazy things like this. BTW,yes,it IS worse what you ended up with and that's what you get for trying to do something this insane on an exam! Nov 25, 2014 at 23:49
• @graydad i suppose you would get the same result, but i don't believe this works all the time. Nov 25, 2014 at 23:50

We have $$\int_0^t e^{\lambda x}dx = \dfrac{e^{\lambda t}-1}{\lambda}$$ Differentiating with respect to $\lambda$, we obtain $$\int_0^t xe^{\lambda x}dx = \dfrac{\lambda t e^{\lambda t} - e^{\lambda t }+1}{\lambda^2}$$ Set $\lambda = 1$, to obtain $$\int_0^t xe^{x}dx = t e^{t} - e^{t }+1$$
EDIT To complete your approach, note that $$\sum_{k=0}^{\infty} \dfrac{x^k(k-1)}{k!} = \sum_{k=0}^{\infty} \dfrac{kx^k}{k!} - \sum_{k=0}^{\infty} \dfrac{x^k}{k!} = \sum_{k=0}^{\infty} \dfrac{x^{k+1}}{k!} - \sum_{k=0}^{\infty} \dfrac{x^k}{k!} = xe^x-e^x$$ which is same as the previous method, except for a constant addition and now finish it off.
Leave out $1/x^2$, to be reinserted later: \begin{align} \int xe^x\,dx &=\sum_{k=0}^{\infty}\frac{x^{k+2}}{(k+2) k!}\\ &=\sum_{k=0}^{\infty}\frac{(k+1)x^{k+2}}{(k+2)!}\\ &=\sum_{k=2}^{\infty}\frac{(k-1)x^k}{k!}\\ &=\sum_{k=2}^{\infty}\frac{kx^k}{k!}-\sum_{k=2}^{\infty}\frac{x^k}{k!}\\ &=\sum_{k=2}^{\infty}\frac{x^k}{(k-1)!}-\sum_{k=2}^{\infty}\frac{x^k}{k!}\\ &=x\sum_{k=1}^{\infty}\frac{x^k}{k!}-\sum_{k=2}^{\infty}\frac{x^k}{k!}\\ &=x(e^x-1)-(e^x-x-1)\\ &=xe^x-x-e^x+x+1\\ &=e^x(x-1)+1 \end{align} The $1$ is absorbed in the arbitrary constant, so the final result is $$\int xe^x\,dx=e^x(x-1)+c$$ Differentiating we indeed have $e^x(x-1)+e^x=xe^x$