Dove's LibraryDove's Library

6.10 - Integrating Functions Using Long Division and Completing the Square

Why Use These Techniques?

Sometimes the integrand can’t be integrated in the form it’s given to you. We use algebraic techniques to rewrite it into a form we recognize.
The integrand is everything between the ∫\int and the dxdx:
∫f(x)⏟integrand dx\int \underbrace{f(x)}_{\text{integrand}} \, dx
Two main algebraic tools:
  1. Polynomial long division (or synthetic division)
  1. Completing the square
Both of these turn integrands into recognizable patterns.

Polynomial Long Division

When to Use It

Use long division when:
  • The numerator’s degree is greater than or equal to the denominator’s degree
  • You have a rational function (a polynomial divided by a polynomial)

Basic Procedure

Example: ∫3x3−x2−5x+1x−2 dx\int \dfrac{3x^3 - x^2 - 5x + 1}{x - 2} \, dx
Step 1: Set up the long division.
3x² + 5x + 5 _______________ x - 2 | 3x³ - x² - 5x + 1
Step 2: Divide.
  • xx into 3x33x^3 gives 3x23x^2
  • Multiply: 3x2(x−2)=3x3−6x23x^2(x-2) = 3x^3 - 6x^2
  • Subtract: (−x2)−(−6x2)=5x2(-x^2) - (-6x^2) = 5x^2
  • Bring down: 5x2−5x5x^2 - 5x
Keep going the same way.
Step 3: The result.
3x3−x2−5x+1x−2=3x2+5x+5+11x−2\frac{3x^3 - x^2 - 5x + 1}{x - 2} = 3x^2 + 5x + 5 + \frac{11}{x-2}
Step 4: Integrate.
∫(3x2+5x+5+11x−2)dx=x3+5x22+5x+11ln⁡∣x−2∣+C\int \left(3x^2 + 5x + 5 + \frac{11}{x-2}\right) dx = x^3 + \frac{5x^2}{2} + 5x + 11\ln|x-2| + C
Note: for the 11x−2\frac{11}{x-2} term, use u=x−2u = x-2 and du=dxdu = dx to get 11ln⁡∣x−2∣11\ln|x-2|.

Synthetic Division

When You Can Use It

Synthetic division works ONLY when the divisor is linear in the form (x−a)(x - a), with no coefficient on the xx.
Can use: (x−2)(x - 2), (x+5)(x + 5), (x−0)(x - 0)
Cannot use: (2x−1)(2x - 1), (x2+1)(x^2 + 1), (3x+7)(3x + 7)

Procedure

Same example: 3x3−x2−5x+1x−2\dfrac{3x^3 - x^2 - 5x + 1}{x - 2}
Step 1: Identify the zero. For x−2x - 2, the zero is a=2a = 2.
Step 2: Set up the synthetic division.
2 | 3 -1 -5 1 | 6 10 10 |__________________ 3 5 5 11
How it works:
  1. Bring down the 3
  1. Multiply: 2×3=62 \times 3 = 6, add to −1-1, get 5
  1. Multiply: 2×5=102 \times 5 = 10, add to −5-5, get 5
  1. Multiply: 2×5=102 \times 5 = 10, add to 11, get 11 (the remainder)
Step 3: Interpret the results. The bottom row gives the coefficients, dropping one power each time:
3x2+5x+5+11x−23x^2 + 5x + 5 + \frac{11}{x-2}
Much faster than long division.

Example: Long Division with U-Substitution

Evaluate ∫6x4−7x3+x2+2x3x−5 dx\int \dfrac{6x^4 - 7x^3 + x^2 + 2x}{3x - 5} \, dx.
Step 1: Long division.
2x³ + x² + 2x + 4 _________________________ 3x - 5 | 6x⁴ - 7x³ + x² + 2x + 0
After dividing:
6x4−7x3+x2+2x3x−5=2x3+x2+2x+4+203x−5\frac{6x^4 - 7x^3 + x^2 + 2x}{3x - 5} = 2x^3 + x^2 + 2x + 4 + \frac{20}{3x-5}
Step 2: Integrate.
∫(2x3+x2+2x+4+203x−5)dx\int \left(2x^3 + x^2 + 2x + 4 + \frac{20}{3x-5}\right) dx
Step 3: Handle the fractional term with u-sub.
For ∫203x−5 dx\int \dfrac{20}{3x-5} \, dx:
u=3x−5,du=3 dx,dx=du3u = 3x - 5, \quad du = 3 \, dx, \quad dx = \frac{du}{3}∫20u⋅du3=203ln⁡∣u∣=203ln⁡∣3x−5∣\int \frac{20}{u} \cdot \frac{du}{3} = \frac{20}{3}\ln|u| = \frac{20}{3}\ln|3x-5|
Step 4: The complete answer.
=x42+x33+x2+4x+203ln⁡∣3x−5∣+C= \frac{x^4}{2} + \frac{x^3}{3} + x^2 + 4x + \frac{20}{3}\ln|3x-5| + C

Completing the Square

The Formula

For x2+bxx^2 + bx, complete the square by adding and subtracting (b2)2\left(\frac{b}{2}\right)^2:
x2+bx+(b2)2=(x+b2)2\boxed{x^2 + bx + \left(\frac{b}{2}\right)^2 = \left(x + \frac{b}{2}\right)^2}
Steps:
  1. Take half of the linear coefficient
  1. Square it
  1. Add it to create the perfect square
  1. Subtract it to keep the expression balanced

Example 1: Basic Completing the Square

Evaluate ∫1x2+6x+10 dx\int \dfrac{1}{x^2 + 6x + 10} \, dx.
Step 1: Focus on the denominator: x2+6x+10x^2 + 6x + 10.
Step 2: Complete the square.
Half of 6 is 3, and 32=93^2 = 9, so
x2+6x+10=(x2+6x+9)−9+10=(x+3)2+1x^2 + 6x + 10 = (x^2 + 6x + 9) - 9 + 10 = (x+3)^2 + 1
Step 3: Rewrite the integral.
∫1(x+3)2+1 dx\int \frac{1}{(x+3)^2 + 1} \, dx
Step 4: Recognize the pattern. This matches ∫1u2+1 du=tan⁡−1(u)+C\int \frac{1}{u^2 + 1} \, du = \tan^{-1}(u) + C.
With u=x+3u = x + 3 and du=dxdu = dx:
=tan⁡−1(x+3)+C= \tan^{-1}(x+3) + C

Example 2: With a Negative Leading Coefficient

Evaluate ∫1−x2−8x−15 dx\int \dfrac{1}{\sqrt{-x^2 - 8x - 15}} \, dx.
Step 1: Factor the negative out of the quadratic.
−x2−8x−15=−(x2+8x+15)-x^2 - 8x - 15 = -(x^2 + 8x + 15)
Step 2: Complete the square.
Half of 8 is 4, and 42=164^2 = 16, so
x2+8x+15=(x2+8x+16)−16+15=(x+4)2−1x^2 + 8x + 15 = (x^2 + 8x + 16) - 16 + 15 = (x+4)^2 - 1
Step 3: Substitute back.
−(x2+8x+15)=−[(x+4)2−1]=1−(x+4)2-(x^2 + 8x + 15) = -[(x+4)^2 - 1] = 1 - (x+4)^2
Step 4: Rewrite the integral.
∫11−(x+4)2 dx\int \frac{1}{\sqrt{1 - (x+4)^2}} \, dx
Step 5: Recognize the inverse trig pattern. This matches ∫11−u2 du=sin⁡−1(u)+C\int \frac{1}{\sqrt{1-u^2}} \, du = \sin^{-1}(u) + C.
With u=x+4u = x + 4:
=sin⁡−1(x+4)+C= \sin^{-1}(x+4) + C

Complex Example: Multiple Techniques

Evaluate ∫32x2−4x+20 dx\int \dfrac{32}{x^2 - 4x + 20} \, dx.
Step 1: Complete the square.
x2−4x+20=(x2−4x+4)−4+20=(x−2)2+16x^2 - 4x + 20 = (x^2 - 4x + 4) - 4 + 20 = (x-2)^2 + 16
Step 2: Rewrite.
∫32(x−2)2+16 dx\int \frac{32}{(x-2)^2 + 16} \, dx
Step 3: Factor to get a “+1.” We need the form u2+1u^2 + 1 for tan⁡−1\tan^{-1}, so factor out the 16:
=∫3216[(x−2)216+1] dx=∫2(x−24)2+1 dx= \int \frac{32}{16\left[\frac{(x-2)^2}{16} + 1\right]} \, dx = \int \frac{2}{\left(\frac{x-2}{4}\right)^2 + 1} \, dx
Step 4: U-substitution.
u=x−24,du=14 dx,dx=4 duu = \frac{x-2}{4}, \quad du = \frac{1}{4} \, dx, \quad dx = 4 \, du
Step 5: Substitute.
∫2u2+1⋅4 du=8∫1u2+1 du\int \frac{2}{u^2 + 1} \cdot 4 \, du = 8\int \frac{1}{u^2 + 1} \, du
Step 6: Integrate.
=8tan⁡−1(u)+C=8tan⁡−1(x−24)+C= 8\tan^{-1}(u) + C = 8\tan^{-1}\left(\frac{x-2}{4}\right) + C
Definite version: the same antiderivative evaluates a definite integral. For example:
∫2632x2−4x+20 dx=8tan⁡−1(x−24)∣26=8[tan⁡−1(1)−tan⁡−1(0)]=8⋅π4=2π\int_2^6 \frac{32}{x^2 - 4x + 20} \, dx = 8\tan^{-1}\left(\frac{x-2}{4}\right) \Bigg|_2^6 = 8\left[\tan^{-1}(1) - \tan^{-1}(0)\right] = 8 \cdot \frac{\pi}{4} = 2\pi

Key Takeaways

  • Use long division when the numerator’s degree is greater than or equal to the denominator’s
  • Synthetic division is faster, but it only works for (x−a)(x - a) divisors
  • The remainder becomes Rdivisor\frac{R}{\text{divisor}} in the result
  • Completing the square creates perfect square trinomials
  • Formula: x2+bxx^2 + bx becomes (x+b2)2\left(x + \frac{b}{2}\right)^2 after adding and subtracting (b2)2\left(\frac{b}{2}\right)^2
  • Factor out negatives before completing the square, since you need the x2x^2 coefficient to be 1
  • Goal: transform the integrand into a recognizable pattern, especially inverse trig
  • Inverse trig patterns: look for u2+1u^2 + 1, 1−u2\sqrt{1-u^2}, and uu2−1u\sqrt{u^2-1}
  • Combine techniques. You often need completing the square plus u-substitution
  • Check the degree and make sure you’re in proper form before integrating
  • These are some of the most challenging integration techniques in the course

AP® is a registered trademark of the College Board, which is not affiliated with Dove's Library and was not involved in the production of, and does not endorse, this website.

Providing free, high-quality AP notes to help students succeed, earn college credit, and reach their educational goals, ensuring everyone has access to the resources they need.

© 2026 Standard Learning Group, Inc., which operates Dove's Library. All rights reserved.