When doing integration by parts, how do you know which part should be $u$ ?
For example,
For the following: $$\int x^2e^xdx$$
$u = x^2$?
However for: $$\int \sqrt{x}\ln xdx$$
$u = \ln x$?
Is there a rule for which part should be $u$ ? As this is confusing.
There is an acronym called "LIATE":
Set $u$ to be the first function you see on this list (ordered):
Doesn't always work perfectly, but it's your best bet.
In your first integral, the algebraic function $x^2$ takes precedence.
In the second, the logarithm $\ln x$ takes precedence.