There is a nice rule of thumb for choosing known as the LIATE rule (though its more a guideline than a rule; there are always exceptions). Among several different types of factors, choose to be the factor that comes first in this list.
Inverse trigonometric functions
For example, when doing we have an inverse trigonometric factor, and an algebraic factor, Using the above guideline, we let
But if you were doing you would prefer the algebraic factor for leaving the exponential for So,