integration of rational functions
A rational function is a ratio of two polynomials, P(x)/Q(x). One of the cleanest facts in all of integration is that every such function can be integrated in closed form using elementary functions — there are no surprises, no non-elementary obstacles, ever. This is a complete and finished theory: given any rational function, there is a guaranteed, mechanical procedure that always succeeds.
The procedure is a three-step pipeline. First, if the numerator's degree is at least the denominator's, do polynomial long division to peel off a polynomial (which integrates trivially) plus a proper remainder fraction. Second, factor the denominator over the reals into linear factors (x - a) and irreducible quadratic factors (x^2 + bx + c), and decompose the proper fraction into partial fractions. Third, integrate each piece: a term A/(x - a) gives A ln|x - a|; a repeated factor gives a power; and an irreducible quadratic gives a logarithm (from the part that matches the derivative of the denominator) plus an arctangent (from the leftover constant, after completing the square). That is the entire alphabet of the answer: polynomials, logarithms, and arctangents.
This is why rational functions are the safe, solid ground of integration and the natural target of so many other techniques — trigonometric integrals via the Weierstrass substitution, and many algebraic-root integrals via clever substitutions, all funnel into a rational function precisely because we know rational functions can always be finished. The same partial-fraction machinery is what makes the inverse Laplace transform tractable. The one honest caveat is practical, not theoretical: the guarantee assumes you can factor the denominator, and for high-degree polynomials the real factorization may only be available numerically.
integral of (x^2 + 1)/(x^2 - 1) dx: long division gives 1 + 2/(x^2 - 1); partial fractions give 1 + 1/(x - 1) - 1/(x + 1); the integral is x + ln|x - 1| - ln|x + 1| + C.
Divide, decompose, integrate term by term — the result is always polynomials, logs, and arctangents.
The theory guarantees an elementary answer exists, but it assumes a real factorization of the denominator. For a high-degree denominator with no nice roots you may have to factor numerically, so the closed form is exact in principle yet approximate in practice.