Use the formula Integral-of (dx/x) = ln|x| + C to solve almost all rational integration problems. C is the "constant of integration." The derivative -- the inverse of the integral -- of a function is a description of how the function changes, and a constant does not change so the derivative of any constant is zero. This means that if the derivative of x is dx, then the derivative of x + C -- where C is any constant -- is also dx. This means that the integral of dx is X + C where C is any constant.
Familiarize yourself with the standard integral simplification formulas such as Integral-of(k X f(Y)) = k X Integral-of (f(Y)) and Integral-of (f(X) + g(X)) = Integral-of (f(X)) + Integral-of (g(X)). For dealing with polynomials, it is good to know the formula Integral-of (X^n) = 1/(n + 1) X Integral=of (X^(n + 1)). The "integration by parts" formula Integral-of (u dv) = uv - Integral-of (v du) is also useful. Use these formulas to manipulate the rational function into a form that you can integrate.
Divide polynomials and integrate each part of the quotient. Manipulate the remainder until it can be integrated. For example, Integral-of ((Z^4 + 3Z^3 - 3Z^2 + 3Z - 4) / (Z^2 - Z)) = Integral -of ( (Z^3 + 4Z^2 + Z + 4)/Z) = Integral-of (Z^2 + 4X + 1 + 4/Z) = Integral-of (Z^2) + Integral-of (4Z) + Integral-of (1) +Integral-of (4/Z) = (1/3)Z^3 + 4 X Integral-of (Z) + Z + 4 X Integral-of (1/Z) = (1/3)Z^3 + 2Z^2 + Z + 4|ln Z|. All the constants of integration can be combined into a single constant of integration C, so the final answer is integral-of ((Z^4 + 3Z^3 - 3Z^2 + 3Z - 4) / (Z^2 - Z)) = (1/3)Z^3 + 2Z^2 + Z + 4|ln Z| + C.