Achievable logoAchievable logo
AP Calculus AB
Sign in
Sign up
Purchase
Textbook
Practice exams
Support
How it works
Exam catalog
Mountain with a flag at the peak
Textbook
Introduction
1. Limits
2. Derivative basics
3. Advanced differentiation
4. Contextual uses
5. Analytical uses
6. Integration
6.1 Accumulation of change
6.2 Riemann sums & area
6.3 Definite integrals
6.4 Accumulation functions
6.5 Behavior of accumulation functions
6.6 Fundamental theorem of calculus
6.7 Indefinite integrals
6.8 u-substitution
6.9 Long division & completing the square
7. Differential equations
8. Applications of integrals
9. Testing details tag
Wrapping up
Achievable logoAchievable logo
6.9 Long division & completing the square
Achievable AP Calculus AB
6. Integration
Our AP Calculus AB course is currently in development and is a work-in-progress.

Long division & completing the square

5 min read
Font
Discuss
Share
Feedback

What you’ll learn:

  • Other integration techniques to simplify integrals into recognizable forms
  • More integrals involving inverse trig functions

This section introduces two techniques for rewriting an integral into a more familiar form, so you can apply standard integration rules or u-substitution.

  1. Long division
  2. Completing the square

Long division

When integrating a rational function where the degree of the numerator is greater than or equal to the degree of the denominator, try polynomial long division first. The goal is to rewrite the integrand as a polynomial plus a proper fraction.

∫x+12x2+3x+5​dx

Solution

Using polynomial long division,

x+12x2+3x+5​=2x+1+x+14​

So the integral becomes

∫(2x+1+x+14​)dx

Split it into simpler pieces:

∫(2x+1)dx+4∫x+11​dx

Use the reverse power rule on ∫(2x+1)dx. For the logarithm-type integral, use u-substitution with

u=x+1

du=dx

Then

22x2​+x+4∫u1​du

=x2+x+4ln∣u∣

=x2+x+4ln∣x+1∣+C​

∫x2+1x3−x2+2​dx

Solution

(spoiler)

Using polynomial long division,

x2+1x3−x2+2​=x−1+x2+1−x+3​

So the integral becomes

∫(x−1+x2+1−x+3​)dx

Split it into two integrals:

∫(x−1)dx+∫x2+1−x+3​dx

=2x2​−x+∫x2+1−x+3​dx

The remaining fraction is easier if we separate it:

2x2​−x+∫x2+1−x​dx+∫x2+13​dx

For ∫x2+1−x​dx, use u-substitution with

u=x2+1

Then

du=2xdx

−21​du=−xdx

Rewrite and integrate:

∫x2+1−x​dx=∫u1​⋅(−21​)du

=−21​∫u1​du

=−21​ln∣u∣

=−21​ln(x2+1)

For ∫x2+13​dx, use the standard inverse tangent form:

∫x2+13​dx

=3∫x2+11​dx

=3tan−1(x)

Putting everything together,

∫x2+1x3−x2+2​dx

=2x2​−x−21​ln(x2+1)+3tan−1(x)−C​

Completing the square

If the integrand has a quadratic expression in the denominator or under a square root and it doesn’t factor nicely, try completing the square. This often turns the expression into a form that matches an inverse trig integral.

∫x2+4x+51​dx

Solution

(spoiler)

Complete the square in the denominator:

∫(x2+4x+4)+5−41​dx

=∫(x+2)2+11​dx

This matches the standard form

∫x2+11​dx=tan−1(x)+C

after the substitution

u=x+2

du=dx

Rewrite and integrate:

∫(x+2)2+11​dx

=∫u2+11​du

=tan−1(u)

=tan−1(x+2)+C​

∫−2x−x2​1​dx

Solution

(spoiler)

First rewrite the quadratic inside the square root and complete the square:

∫−(x2+2x+1)+1​1​dx

=∫1−(x+1)2​1​dx

This matches the inverse sine form

1−x2​1​dx=sin−1(x)+C

after the substitution

u=x+1

du=dx

Rewrite and integrate:

1−u2​1​du

=sin−1(u)

=sin−1(x+1)+C​

∫x2+4x+136​dx

Solution

(spoiler)

Complete the square in the denominator:

∫(x2+4x+4)+13−46​dx

∫(x+2)2+96​dx

This is close to the standard inverse tangent form

∫x2+11​dx=tan−1(x)+C

but we need the constant term to be 1 instead of 9. Multiply the numerator and denominator by 91​:

∫((x+2)2+9)⋅91​6⋅91​​dx

∫32​⋅9(x+2)2​+11​dx

Rewrite 9(x+2)2​ as (3x+2​)2:

∫32​⋅(3x+2​)2+11​dx

Now use the substitution

u=3x+2​

du=31​dx

Then the integral becomes

∫u2+12​dx

=2tan−1(u)

=2tan−1(3x+2​)+C​

Long division

  • Use when numerator degree ≥ denominator degree in rational functions
  • Rewrite as polynomial + proper fraction using polynomial long division
  • Integrate resulting terms separately:
    • Polynomials: reverse power rule
    • Proper fractions: u-substitution or standard forms (e.g., logarithms, inverse trig)

Completing the square

  • Use for quadratics in denominators or under square roots that don’t factor easily
  • Rewrite quadratic as (x+a)2+b form
  • Allows matching to standard inverse trig integrals:
    • ∫x2+11​dx=tan−1(x)+C
    • ∫1−x2​1​dx=sin−1(x)+C
  • May require u-substitution and adjusting constants for standard forms

Sign up for free to take 5 quiz questions on this topic

All rights reserved ©2016 - 2026 Achievable, Inc.

Long division & completing the square

What you’ll learn:

  • Other integration techniques to simplify integrals into recognizable forms
  • More integrals involving inverse trig functions

This section introduces two techniques for rewriting an integral into a more familiar form, so you can apply standard integration rules or u-substitution.

  1. Long division
  2. Completing the square

Long division

When integrating a rational function where the degree of the numerator is greater than or equal to the degree of the denominator, try polynomial long division first. The goal is to rewrite the integrand as a polynomial plus a proper fraction.

∫x+12x2+3x+5​dx

Solution

Using polynomial long division,

x+12x2+3x+5​=2x+1+x+14​

So the integral becomes

∫(2x+1+x+14​)dx

Split it into simpler pieces:

∫(2x+1)dx+4∫x+11​dx

Use the reverse power rule on ∫(2x+1)dx. For the logarithm-type integral, use u-substitution with

u=x+1

du=dx

Then

22x2​+x+4∫u1​du

=x2+x+4ln∣u∣

=x2+x+4ln∣x+1∣+C​

∫x2+1x3−x2+2​dx

Solution

(spoiler)

Using polynomial long division,

x2+1x3−x2+2​=x−1+x2+1−x+3​

So the integral becomes

∫(x−1+x2+1−x+3​)dx

Split it into two integrals:

∫(x−1)dx+∫x2+1−x+3​dx

=2x2​−x+∫x2+1−x+3​dx

The remaining fraction is easier if we separate it:

2x2​−x+∫x2+1−x​dx+∫x2+13​dx

For ∫x2+1−x​dx, use u-substitution with

u=x2+1

Then

du=2xdx

−21​du=−xdx

Rewrite and integrate:

∫x2+1−x​dx=∫u1​⋅(−21​)du

=−21​∫u1​du

=−21​ln∣u∣

=−21​ln(x2+1)

For ∫x2+13​dx, use the standard inverse tangent form:

∫x2+13​dx

=3∫x2+11​dx

=3tan−1(x)

Putting everything together,

∫x2+1x3−x2+2​dx

=2x2​−x−21​ln(x2+1)+3tan−1(x)−C​

Completing the square

If the integrand has a quadratic expression in the denominator or under a square root and it doesn’t factor nicely, try completing the square. This often turns the expression into a form that matches an inverse trig integral.

∫x2+4x+51​dx

Solution

(spoiler)

Complete the square in the denominator:

∫(x2+4x+4)+5−41​dx

=∫(x+2)2+11​dx

This matches the standard form

∫x2+11​dx=tan−1(x)+C

after the substitution

u=x+2

du=dx

Rewrite and integrate:

∫(x+2)2+11​dx

=∫u2+11​du

=tan−1(u)

=tan−1(x+2)+C​

∫−2x−x2​1​dx

Solution

(spoiler)

First rewrite the quadratic inside the square root and complete the square:

∫−(x2+2x+1)+1​1​dx

=∫1−(x+1)2​1​dx

This matches the inverse sine form

1−x2​1​dx=sin−1(x)+C

after the substitution

u=x+1

du=dx

Rewrite and integrate:

1−u2​1​du

=sin−1(u)

=sin−1(x+1)+C​

∫x2+4x+136​dx

Solution

(spoiler)

Complete the square in the denominator:

∫(x2+4x+4)+13−46​dx

∫(x+2)2+96​dx

This is close to the standard inverse tangent form

∫x2+11​dx=tan−1(x)+C

but we need the constant term to be 1 instead of 9. Multiply the numerator and denominator by 91​:

∫((x+2)2+9)⋅91​6⋅91​​dx

∫32​⋅9(x+2)2​+11​dx

Rewrite 9(x+2)2​ as (3x+2​)2:

∫32​⋅(3x+2​)2+11​dx

Now use the substitution

u=3x+2​

du=31​dx

Then the integral becomes

∫u2+12​dx

=2tan−1(u)

=2tan−1(3x+2​)+C​

Key points

Long division

  • Use when numerator degree ≥ denominator degree in rational functions
  • Rewrite as polynomial + proper fraction using polynomial long division
  • Integrate resulting terms separately:
    • Polynomials: reverse power rule
    • Proper fractions: u-substitution or standard forms (e.g., logarithms, inverse trig)

Completing the square

  • Use for quadratics in denominators or under square roots that don’t factor easily
  • Rewrite quadratic as (x+a)2+b form
  • Allows matching to standard inverse trig integrals:
    • ∫x2+11​dx=tan−1(x)+C
    • ∫1−x2​1​dx=sin−1(x)+C
  • May require u-substitution and adjusting constants for standard forms