A summary

Here are the steps for computing $\int \frac{P(x)}{Q(x)}\,dx$, where $P(x)$ and $Q(x)$ are polynomials.  First, see if substitution will work.  Then check for trig substitution possibilities.  If none of these work, or if the trig substitution is too complicated, try partial fraction decomposition.

Partial fraction decomposition process

  • Check that we have a proper fraction. If not, do long division of polynomials.

  • Factor $Q(x)$ into a product of linear and irreducible quadratic terms.

  • Write $\displaystyle\frac{P(x)}{Q(x)}$ as a sum of terms with unknown coefficients:

    • For every factor of $(x-a)$ in $Q(x)$, we have a term $\displaystyle\frac{A}{x-a}$.

    • For every repeated linear factor $(x-a)^n$, we have $$\displaystyle\frac{A_1}{(x-a)} + \frac{A_2}{(x-a)^2} + \ldots + \frac{A_n}{(x-a)^n}.$$

    • For every irreducible quadratic factor $x^2 + bx + c$, we have $$\displaystyle\frac{Ax+B}{x^2+bx+c}.$$

    • For every repeated irreducible quadratic factor $(x^2+bx+c)^n$, we have $$\displaystyle\frac{A_1 x + B_1}{x^2+bx+c} + \frac{A_2x+B_2}{(x^2+bx+c)^2}+\ldots + \frac{A_nx+B_n}{(x^2+bx+c)^n}.$$


  • Multiply both sides of the equation by $Q(x)$. Then plug in different values of $x$ to get equations that determine the coefficients. For distinct linear factors, we can always get the coefficients by plugging in the $x$ value that will make the factor zero. For repeated linear factors or for quadratic factors, it can be a little trickier.

  • If all else fails, compare the coefficients of 1, $x$, $x^2$, etc. on both sides to get equations involving $A$, $B$, etc.

  • Integrate. Recall that $\int \frac{1}{x-a}\,dx =\ln\lvert x-a\rvert +C$, and remember substitution (for repeated linear factors), and trig substitution with tangent (irreducible quadratic factors).  Integrating other quadratic expressions is done with either a $u$-substitution or a trig substitution with tangent, after possibly completing the square.