If I'm understanding correctly, then your notion of "integrating in a lump" is the same thing as applying u-substitution. Your notion of "integrating in pieces" means u-substitution can't be applied, so you need to do some algebraic manipulation.
In general, there is no absolute way to know that u-substitution (lumps) can be used. Sometimes you just need to be clever. But there is a general guideline:
Remember that u-substitution for integration is "undoing" a chain rule for differentiation. Thus you want to look for the inner part of a composition whose derivative lies outside the composition (up to a constant).
In your first example, the derivative of is just .
In your second example, the derivative of is , which is not in the problem.
If the integrand was , then a u-substitution (lump) would work.
Hope this helps!