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.
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.