. I mean, you can prove that it works, but some people "see" how to separate a function and some don't.
You don't ever "see" how to seperate the function into udv to get uv-vdu. Even in the case of the most "obvious" examples like xe^x, you still need to decide which part should be u or dv.
After a few dozen (hundred?) times of doing this, you get a feel for which should be chosen. More recently, this knowledge has been codified in a LIATE mnemonic/algorithm for choosing the two parts, which works for most elementary integrals students are likely to encounter.
Nobody can "just integrate". Nobody. Not even Euler was able to integrate everything. With experience -- extensive expeirience -- you may garner enough tricks and techniques to be able to integrate something like x^m(a+bx^n)^p -- but you would need to be very well read to know that you could only do so if one of p, (m+1)/n, or (m+1)/n +p is an integer -- (see Chebyshev's Integral). I didn't "see" or know this fact -- I learned it from reading works of others who came before me. No gene can replicate that.