AP® CALCULUS AB & BC · UNIT 6
Integrating with Long Division and Completing the Square
Rewrite rational and quadratic expressions before integrating. Use colorful worked examples to check the algebra, choose a matching antiderivative, and evaluate definite integrals.

1. What Topic 6.10 asks you to do
Rewrite an integrand into an equivalent form before choosing an antiderivative. Polynomial long division separates a polynomial part from a proper rational remainder. Completing the square makes a quadratic's shift and scale visible.
2. When to use polynomial long division
Let be the numerator polynomial and the denominator polynomial. If , polynomial division writes
Here is the quotient and is the remainder. The remainder is zero or has degree less than . On the original domain, where , divide by to get
For example, calls for division. The numerator of already has lower degree, so that fraction is proper.
- Order both polynomials by descending powers. Include a zero coefficient for any missing power when you set up the subtraction.
- Divide the leading terms to find the next quotient term.
- Multiply the entire divisor by that term, then subtract and bring down the next term.
- Repeat until the remainder is zero or has lower degree than the divisor. Verify by multiplying the quotient by the divisor and adding the remainder.
Integrate the polynomial term by term. For the remainder, look for a derivative of the denominator, a completed square, or another suitable technique.
3. How to complete the square
For a quadratic with , factor from the two terms involving . Half the coefficient of inside the parentheses is . Add and subtract its square inside those parentheses.
The resulting form is
where and . The same multiplies the term you add and the term you subtract. That is why contains .
For example, becomes . The shift is , and the nonnegative square plus makes the denominator positive for every real input.
If the denominator can be written as with , factor out the constant and match the arctangent form. A difference of squares under a square root can instead produce the arcsine form. Check the signs and the original domain before choosing a formula.
4. Recognize the antiderivative form
Let . After the shift , match the complete integrand, including the differential and any outside constant. Angles are in radians.
| Integrand in | Antiderivative family |
|---|---|
The arctangent row works for all real . The arcsine integrand requires ; its endpoints make the denominator zero. The logarithm row applies on either side of , with a constant chosen on each interval.
If a numerator is proportional to the derivative of its denominator, try the logarithmic rule first. When only part of the numerator matches, split off that part before handling the remainder.
Extra reference: the inverse secant form
For and , take . Use the usual inverse secant branch, equivalently the inverse cosine of the reciprocal:
The absolute value lets the same expression differentiate correctly on both separate intervals. The endpoints remain excluded.
5. Worked examples: indefinite and definite integrals
Example 1 · Divide by a linear denominator
Find .
1 · Compare degrees and divide
The numerator has degree and the divisor has degree . The leading terms and give the first quotient term .
| Quotient term | Product to subtract | New remainder |
|---|---|---|
2 · Check the quotient and remainder
The quotient is and the remainder is . Expanding gives the numerator back.
3 · Integrate and check the domain
The derivative gives . The original integrand excludes , so use a separate constant on each interval.
What the quotient and remainder show
Example 2 · Stop when the remainder has lower degree
Rewrite using long division, and integrate its polynomial part.
1 · Track the missing power and subtract
Include a zero coefficient on in the numerator. After subtracting , the remainder is . Subtracting leaves .
The quotient is , and the degree of the remainder is .
2 · Integrate the polynomial part
The full remainder numerator is not a constant multiple of . A direct denominator substitution alone does not finish this fraction. Use the rewrite on intervals excluding and .
Show the BC preview for the remaining fraction
Topic 6.12 covers this partial fraction step. For , the remainder splits as
Keep the polynomial primitive and find the logarithmic primitive separately:
Differentiating recovers the original integrand on any interval that avoids both poles.
Example 3 · Complete the square to reveal arctangent
Find .
1 · Find the shifted quadratic
Half of is , and its square is . Add and subtract .
2 · Substitute and recognize the scale
Let , so and the denominator is .
3 · Substitute back and differentiate
The derivative simplifies to , which is defined for every real .
Example 4 · Keep the leading coefficient outside
Find .
1 · Factor and complete the square
Let . Factor , then complete the square inside the parentheses.
2 · Integrate with the outside factor
Use , so . The integral becomes
3 · Return to the original variable
The derivative includes the factor ; its denominator expands to .
Example 5 · Split a logarithm term from an arctangent term
Find .
1 · Match part of the numerator to the derivative
Let . Then , so the numerator is .
2 · Recognize both patterns
The first term has primitive . For the second, complete the square: . Its reciprocal has primitive .
3 · Preserve the subtraction
The completed square shows , so is valid. Differentiating the answer gives , as required.
Example 6 · Evaluate a definite integral after shifting and scaling
Evaluate .
1 · Complete the square and choose the new variable
The denominator is . Let , giving . The denominator becomes .
2 · Convert both bounds
| Bound | Original | New |
|---|---|---|
| Start | ||
| End |
3 · Evaluate in the new variable
The denominator is positive throughout the interval, so this definite integral equals the shaded area.
The completed square reveals the vertex
The reciprocal is the integrand
Example 7 · Use long division and completing the square together
Find .
1 · Divide the polynomials of equal degree
The quotient is . Subtract the denominator from the numerator to get remainder .
Here .
2 · Complete the square in the remainder's denominator
The polynomial term integrates to . The remaining reciprocal gives an arctangent.
3 · Combine and verify
The derivative is , and is positive for every real input.
Example 8 · Recognize arcsine when the square is subtracted
Find .
1 · Complete the square under the radical
The radicand becomes . The denominator must be positive, so the original domain is .
2 · Scale to the arcsine form
Let . Then , and the denominator is . The factors of cancel.
3 · Substitute back and check the interval
The derivative gives the original reciprocal radical for . The endpoints remain excluded.
6. Check the algebra, domain, and bounds
- Compare degrees before integrating a rational function. Check long division by multiplying the quotient by the divisor and adding the remainder.
- Keep the leading coefficient when completing the square. Expand the new expression to verify every term.
- Match the form and the scale. A positive sum of squares in the denominator can give arctangent. A positive square minus a variable square under a root can give arcsine. Check the differential and all outside factors.
- Preserve the original domain. A cancelled factor can still leave an excluded point. For a definite integral, verify the conditions for applying the Fundamental Theorem on the interval.
- Check the final answer. Differentiate an indefinite answer and include . For a definite answer, use bounds that match the variable and verify the endpoint subtraction.
On an AP response, show the algebraic rewrite that makes the integrand recognizable. Then show your antiderivative and, for a definite integral, the evaluation at both bounds.
7. Practice with step-by-step solutions
Problem 1
Find .
Show solution 1
Solution
The quotient is and the remainder is . Work on an interval where .
Problem 2
Find .
Show solution 2
Solution
The numerator is . Division gives quotient and zero remainder; the denominator never vanishes.
An extra arctangent term would change the derivative. Differentiate the answer to get , exactly the simplified integrand.
Problem 3
Find .
Show solution 3
Solution
Complete the square to get . The scale in the arctangent formula is .
Problem 4
Find .
Show solution 4
Solution
The completed square is . The shift is now , so the argument uses .
Problem 5
Find .
Show solution 5
Solution
Factor the denominator as . Keep the outside factor and use scale .
Problem 6
Evaluate .
Show solution 6
Solution
Use the antiderivative from Example 1. The interval avoids the pole. The polynomial part changes by , and the log part changes by .
Problem 7
Find and state the restriction.
Show solution 7
Solution
Cancel the common factor to get wherever . Cancellation does not define the original fraction at .
Use this result on each of the two intervals separated by ; the constants can differ.
Problem 8
Evaluate .
Show solution 8
Solution
The denominator is , so a primitive is . Evaluate in the original variable.
8. Continue studying integration
Review Topic 6.8's antiderivative rules and Topic 6.9's substitution steps when matching a rewritten integrand.