When $u$ and $v$ are differentiable functions of $x$, $d(uv) = u \, dv + v \, du\,$ or $\,u \, dv = d(uv) - v \, du$. When this is integrated we have
$\displaystyle \int u\,dv = uv - \int v\, du$
The expression to be integrated must be separated into two parts, one part being $u$ and the other part, together with $dx$, being $dv$. The factor corresponding to $dv$ must obviously contain the differential of the variable of integration.