AP Calculus AB and BC
Long Division and Completing the Square for Integrals
Before integrating a rational function, compare degrees. If the numerator's degree is at least the denominator's, do polynomial long division to get a polynomial plus a smaller fraction. If the denominator is a quadratic with no real roots, complete the square so the integral matches the arctangent form.
Algebra first, calculus second
Some rational integrands match no antiderivative rule as written, and no substitution fixes them. In these cases the integrand has to be rewritten with algebra before any calculus starts. Topic 6.10, Integrating Functions Using Long Division and Completing the Square, covers the two rewrites in this guide.
| What you see | Move | What it produces |
|---|---|---|
| Degree of numerator is greater than or equal to degree of denominator | Polynomial long division | A polynomial plus a fraction whose numerator has lower degree than its denominator |
| A constant over a quadratic with no real roots | Complete the square | The form , which integrates to an arctangent |
Check for a substitution before either move. If the numerator is a constant multiple of the derivative of the denominator, as in , then finishes the problem as a natural log and no rewriting is needed.
Long division when the numerator is too big
A rational function is called improper when the degree of its numerator is greater than or equal to the degree of its denominator. Dividing rewrites it as a quotient polynomial plus a remainder over the original denominator:
The polynomial integrates with the power rule. The leftover fraction is simpler than the original and usually integrates to a natural log, an arctangent, or a combination. For example, dividing by gives quotient and remainder , so
Check the division by multiplying back
Quotient times divisor plus remainder must rebuild the numerator. Here . This takes a few seconds and catches most sign errors.
Completing the square for the arctangent form
The target is this antiderivative rule, where is a positive constant:
A quadratic such as does not look like until the and terms are packed into a single square. For a quadratic with leading coefficient :
Take half the coefficient of , square it, and split the constant so that amount joins the square. For , half of is and , so . Now and .
The arctangent form needs the leftover constant to be positive. That is the same as the discriminant being negative, which means the quadratic has no real roots. If the leading coefficient is not , factor it out of the whole quadratic before completing the square.
The same move handles a quadratic under a square root. Completing the square can turn the radicand into , which matches .
A decision order for rational integrands
- Look for a substitution. If the numerator is a constant multiple of the derivative of the denominator, use equal to the denominator.
- Compare degrees. If the numerator's degree is greater than or equal to the denominator's, divide first.
- Look at the remaining denominator. If it is linear, the fraction integrates to a natural log.
- If it is a quadratic with no real roots, complete the square and use the arctangent form.
- If it is a quadratic that factors into different linear factors, the BC technique of partial fractions applies.
Sometimes one fraction needs two tools. In the derivative of the denominator is , so split the numerator as . The first piece is a substitution that gives , and the second piece is , an arctangent with .
Common mistakes
- Integrating an improper fraction without dividing. Rules like the natural log pattern do not apply until the fraction is proper.
- Dropping the remainder. The quotient alone is not equal to the original fraction.
- Skipping placeholder terms. When dividing by , write the numerator as so the columns line up.
- Forgetting the in front of the arctangent, or writing in place of .
- Using as . In the constant is , so .
- Integrating as a natural log of the denominator. That would need in the numerator.
Quick check
Differentiate your answer. The derivative of is , which matches the integrand.
Worked examples
Worked example
Long division with a linear denominator
Evaluate .
- Compare degrees. The numerator has degree and the denominator has degree , so divide first.
- Divide by . The first term of the quotient is , since . Subtracting leaves . The next term is , since . Subtracting leaves a remainder of .
- Check by multiplying back: .
- Rewrite the integral: .
- Integrate term by term: .
Worked example
Completing the square
Evaluate .
- Check the simpler options. The numerator is not a multiple of , so substitution with equal to the denominator fails. The discriminant is , so the quadratic has no real roots and does not factor.
- Complete the square: half of is , and , so .
- Match the arctangent form with , , and : the integral is .
- Apply the rule: .
Worked example
Both moves in one definite integral
Evaluate .
- Compare degrees. Both are degree , so divide. The numerator is the denominator plus , so .
- Complete the square in the remaining denominator: .
- Integrate. With and , . An antiderivative of the whole integrand is .
- Evaluate from to : at the value is , and at it is .
- Subtract: .
Frequently asked questions
How do I know when to use long division before integrating?
Compare the degrees of the numerator and denominator. If the numerator's degree is greater than or equal to the denominator's, divide first. If it is lower, the fraction is already proper and division does nothing.
When does completing the square lead to an arctangent?
When the integrand is a constant over a quadratic that has no real roots, which means its discriminant is negative. Completing the square then gives with , and . A constant numerator multiplies the result.
What if the denominator is a quadratic that does factor?
Then completing the square does not give the arctangent form, because the leftover constant is negative or zero. A quadratic with two different real roots splits into two linear factors, and the fraction is handled with partial fractions, which is a BC topic.