When can you use integration by parts?
As far as I know, there is no independent test to see whether integration by parts will work for a particular integral.
The way to determine if you can use integration by parts is to try it. If you get an antiderivative, then it worked.
You can try bits of it first. Ask yourself,
"Can I integrate this factor or that factor?"
But other than trying it, I can't think of a way to determine whether it can be used.
I know of know way of determining that it cannot be used. (Perhaps there is a substitution that we haven't though of, that will make it integrable by parts.)