$\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.
 A: 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.
A: 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$
