Computing the integral $\int(x-ab)x^{a-1}e^{-\frac{x}{b}}dx$ Can someone justify to me why 
$\int(x-ab)x^{a-1}e^{-\frac{x}{b}}dx = -bx^ae^{-\frac{x}{b}}$?
WolframAlpha gives the answer but does not explain why. I'm absolutely new to this kind of integration. Thanks!

The right hand side is the antiderivative of the integrand. By the way since you have an indefinite integral there should be a constant of integration on the RHS.
We can expand:
\begin{align}
\int (x-ab)x^{a-1}e^{-\frac{x}{b}}\ \mathrm{d}x&=\int x^ae^{-\frac{x}{b}}\ \mathrm{d}x+\int ax^{a-1}(-be^{-\frac{x}{b}})\ \mathrm{d}x\\
&\equiv\mathcal{I}+\mathcal{II}
\end{align}
and use integration by parts for $\mathcal{II}$ 
\begin{equation}
\mathcal{II}=-bx^ae^{-\frac{x}{b}}-\int x^ae^{-\frac{x}{b}}\ \mathrm{d}x+c
\end{equation}where  c is the constant of integration. Then we have
\begin{equation}
\mathcal{I}+\mathcal{II}=-bx^ae^{-\frac{x}{b}}+c
\end{equation}which is what your right hand side is.
Of course, if you can identify the antiderivative which is what the answer before mine is trying to get at then you get your result straightaway.
