 Functions like $\ln(x)$, $\tan^{1}(x)$,
$\frac{1}{1+x^2}$, $\sin^{1}(x)$,
$\frac{1}{\sqrt{1x^2}}$ and $\frac{1}{x}$ almost
never get grouped into $dv$. Either we do not
have an (easy) antiderivative for them (like the first
few), so they must be $u$, or they get a lot simpler
when differentiated or get a lot more complicated when
antidifferentiated.
 Functions like $x^n$ (with $n>0$) get a little
simpler when differentiated and a little more
complicated when antidifferentiated. They
sometimes get grouped into $u$ and sometimes into
$dv$, depending on what else is in the integrand.
 Functions like $\sin(x)$, $\cos(x)$ and $e^x$ have
the same complexity when differentiated or
antidifferentiated. The other factor in the
integrand will determine whether they should be $u$ or
$dv$.
 A few functions, like $\sec^2(x)$, $x e^{x^2}$ and
$x^{n}$ (with $n$ at least 2), actually get simpler
when antidifferentiated. These almost always get
grouped into $dv$.
 Don't forget that 1 is a function! You can always
apply integration by parts to $\int f(x) \,dx$ by
picking $u=f(x)$ and $dv= 1\, dx$. This can be
used to evaluate $\int\ln(x)\,dx$ and
$\int\tan^{1}(x)\,dx$.
