Mathematica's Integrate function represents the fruits of a huge amount of mathematical and computational research. It doesn't do integrals the way people do. Instead, it uses powerful, general algorithms that often involve very sophisticated math. There are a couple of approaches that it most commonly takes. One involves working out the general form for an integral, then differentiating this form and solving equations to match up undetermined symbolic parameters. Even for quite simple integrands, the equations generated in this way can be highly complex and require Mathematica's strong algebraic computation capabilities to solve. Another approach that Mathematica uses in working out integrals is to convert them to generalized hypergeometric functions, then use collections of relations about these highly general mathematical functions.