TITLE: What is the integral of $\int\frac{(x-1)e^{1/x}dx}{x}$?
QUESTION [5 upvotes]: I have been trying to solve this integral $\int\frac{(x-1)e^{1/x}dx}{x}$
I used WolframAlpha to solve it but it doesn't show the process. 
The solution is $e^{1/x}{x} + constant$

REPLY [7 votes]: We can integrate this by separating the integrand and integrating by parts:
$$\begin{align}
\int\frac{(x-1)e^{1/x}}{x}dx &=\int e^{1/x}dx-\int \frac{1}{x} e^{1/x}dx\\
&=\int e^{1/x}dx+\int x\left(\frac{d}{dx}e^{1/x}\right)dx\\
&= \int e^{1/x}dx + xe^{1/x}- \int e^{1/x}dx\\
&= xe^{1/x} + C
\end{align}$$

REPLY [2 votes]: $x=\frac1u,dx=-\frac1{u^2}du$
$-\int\dfrac{(\frac1u-1)\frac{e^u}{u^2}du}{\frac1u}$
Bring the minus inside and multiply top and bottom by $u$.  Bring the remaining $\frac1u$ inside the parentheses.
$\int(\frac1u-\frac1{u^2})e^udu=$
$\int\frac1ud(e^u)+e^ud(\frac1u)=\int d(\frac{e^u}u)=\frac{e^u}u+C=xe^{\frac1x}+C$