This browser is too old to run Achievable.

Update it, or open this page in a current version of Chrome, Safari, Firefox or Edge. On an iPhone or iPad, update iOS: every browser there runs on the version of Safari that comes with it.

Achievable logoAchievable logo
AP Calculus AB
Sign in
Sign up
Purchase
Textbook
Practice exams
Support
How it works
Resources
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
Wrapping up
Achievable logoAchievable logo
6.9 Long division & completing the square
Achievable AP Calculus AB
6. Integration
Our AP Calculus AB course is now in "early access" - get 50% off for a limited time.

Long division & completing the square

6 min read
Font
Discuss
Share
Feedback

What you’ll learn

  • Algebraic manipulation: Rewrite complex integrals using long division, completing the square, or clever splitting to match standard forms.
  • Inverse trigonometric integrals: Evaluate advanced integrals that result in arcsine or arctangent functions.

Some integrals look complicated only because they are not in a standard form yet. These techniques rewrite them into familiar expressions so you can apply known rules. We focus on two tools:

  1. Polynomial long division
  2. Completing the square

Polynomial long division

Apply this technique when the rational function is improper, meaning:

degree (numerator)≥degree (denominator)

This rewrites the fraction as a polynomial + a proper rational function.

Example 1.

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

Solution

Step 1: Divide

Using polynomial long division, we find:

2x2÷x=2x

Multiplying back gives 2x(x+1)=2x2+2x, and subtracting leaves x+5.

Then,

x÷x=1

Multiplying back gives 1(x+1)=x+1, and subtracting leaves 4.

Thus,

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

Step 2: Integrate term-by-term

∫(2x+1+x+14​)dx=x2+x+4ln∣x+1∣+C​

Try the next example yourself before expanding the solution.

Example 2.

∫x2+1x3−x2+2​dx

Solution

(spoiler)

1. Polynomial long division:

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

2. Split the integrals:

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

3. Evaluate each term:

  • Term 1 (power rule):

∫(x−1)dx=21​x2−x

  • Term 2 (u-sub):

Let u=x2+1⟹du=2xdx.

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

  • Term 3 (inverse tangent):

Recall that dxd​(arctanx)=x2+11​. Then:

∫x2+13​dx=3arctanx+C

Putting it all together,

∫x2+1x3−x2+2​dx=21​x2−x−21​ln(x2+1)+3arctanx+C​

Advanced inverse trig forms

Know the following integration formulas involving inverse trig functions, where:

  • a is a constant (a>0)
  • u is a differentiable function of x

Integrals leading to inverse trig:

∫a2+u21​du∫a2−u2​1​du​=a1​arctan(au​)+C=arcsin(au​)+C​

Note: These formulas use du, not dx. You must compute du from your substitution first.

Example 3.

∫4+9x21​dx

Solution

(spoiler)

Matching the terms,

  • Constant: a2=4⟹a=2
  • Function: u2=9x2⟹u=3x

With u-substitution, du=3dx⟹31​du=dx.

Then

∫22+(3x)21​dx=∫22+u21​⋅31​du=31​[21​arctan(2u​)]+C=61​arctan(23x​)+C​

Completing the square

Apply this technique when the denominator contains a quadratic expression that cannot be factored. This rewrites the expression into a form that matches a standard inverse trigonometric integral.

Example 4.

∫x2+4x+62​dx

Solution

(spoiler)

1. Complete the square in the denominator:

(x2+4x)+6​=(x2+4x+4)−4+6=(x+2)2+2​

The integral rewritten:

∫(x+2)2+22​dx

2. Recognize form:

∫a2+u21​du=a1​arctan(au​)+C

We have:

  • Constant: a2=2⟹a=2​
  • Function: u=x+2⟹du=dx

Then:

∫(x+2)2+22​dx=2∫u2+(2​)21​du=2[2​1​arctan(2​u​)]+C=2​arctan(2​x+2​)+C​

Example 5.

∫8−2x−x2​1​dx

Solution

(spoiler)

1. Complete the square in the denominator:

8−2x−x2​=8−(x2+2x)=8−(x2+2x+1)+1=9−(x+1)2​

The integral rewritten:

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

2. Recognize form:

∫a2−u2​1​du=arcsin(au​)+C

We have:

  • a2=9⟹a=3
  • u=x+1⟹du=dx

Then:

∫9−(x+1)2​1​dx=∫32−u2​1​du=arcsin(3x+1​)+C​

Watch out for these common mistakes:

  • Always include +C on indefinite integrals. It’s easy to drop it in multi-step problems - make it a habit to write +C.
  • Convert the differential during u-substitution. When you substitute u, replace dx with the correct du expression. Leaving dx in a u-integral is inconsistent and leads to errors in the coefficient.

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 6 quiz questions on this topic

Previous
Next  | 7.1 Intro to differential equations
All rights reserved ©2016 - 2026 Achievable, Inc.

Long division & completing the square

What you’ll learn

  • Algebraic manipulation: Rewrite complex integrals using long division, completing the square, or clever splitting to match standard forms.
  • Inverse trigonometric integrals: Evaluate advanced integrals that result in arcsine or arctangent functions.

Some integrals look complicated only because they are not in a standard form yet. These techniques rewrite them into familiar expressions so you can apply known rules. We focus on two tools:

  1. Polynomial long division
  2. Completing the square

Polynomial long division

Apply this technique when the rational function is improper, meaning:

degree (numerator)≥degree (denominator)

This rewrites the fraction as a polynomial + a proper rational function.

Example 1.

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

Solution

Step 1: Divide

Using polynomial long division, we find:

2x2÷x=2x

Multiplying back gives 2x(x+1)=2x2+2x, and subtracting leaves x+5.

Then,

x÷x=1

Multiplying back gives 1(x+1)=x+1, and subtracting leaves 4.

Thus,

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

Step 2: Integrate term-by-term

∫(2x+1+x+14​)dx=x2+x+4ln∣x+1∣+C​

Try the next example yourself before expanding the solution.

Example 2.

∫x2+1x3−x2+2​dx

Solution

(spoiler)

1. Polynomial long division:

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

2. Split the integrals:

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

3. Evaluate each term:

  • Term 1 (power rule):

∫(x−1)dx=21​x2−x

  • Term 2 (u-sub):

Let u=x2+1⟹du=2xdx.

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

  • Term 3 (inverse tangent):

Recall that dxd​(arctanx)=x2+11​. Then:

∫x2+13​dx=3arctanx+C

Putting it all together,

∫x2+1x3−x2+2​dx=21​x2−x−21​ln(x2+1)+3arctanx+C​

Advanced inverse trig forms

Know the following integration formulas involving inverse trig functions, where:

  • a is a constant (a>0)
  • u is a differentiable function of x

Integrals leading to inverse trig:

∫a2+u21​du∫a2−u2​1​du​=a1​arctan(au​)+C=arcsin(au​)+C​

Note: These formulas use du, not dx. You must compute du from your substitution first.

Example 3.

∫4+9x21​dx

Solution

(spoiler)

Matching the terms,

  • Constant: a2=4⟹a=2
  • Function: u2=9x2⟹u=3x

With u-substitution, du=3dx⟹31​du=dx.

Then

∫22+(3x)21​dx=∫22+u21​⋅31​du=31​[21​arctan(2u​)]+C=61​arctan(23x​)+C​

Completing the square

Apply this technique when the denominator contains a quadratic expression that cannot be factored. This rewrites the expression into a form that matches a standard inverse trigonometric integral.

Example 4.

∫x2+4x+62​dx

Solution

(spoiler)

1. Complete the square in the denominator:

(x2+4x)+6​=(x2+4x+4)−4+6=(x+2)2+2​

The integral rewritten:

∫(x+2)2+22​dx

2. Recognize form:

∫a2+u21​du=a1​arctan(au​)+C

We have:

  • Constant: a2=2⟹a=2​
  • Function: u=x+2⟹du=dx

Then:

∫(x+2)2+22​dx=2∫u2+(2​)21​du=2[2​1​arctan(2​u​)]+C=2​arctan(2​x+2​)+C​

Example 5.

∫8−2x−x2​1​dx

Solution

(spoiler)

1. Complete the square in the denominator:

8−2x−x2​=8−(x2+2x)=8−(x2+2x+1)+1=9−(x+1)2​

The integral rewritten:

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

2. Recognize form:

∫a2−u2​1​du=arcsin(au​)+C

We have:

  • a2=9⟹a=3
  • u=x+1⟹du=dx

Then:

∫9−(x+1)2​1​dx=∫32−u2​1​du=arcsin(3x+1​)+C​

Watch out for these common mistakes:

  • Always include +C on indefinite integrals. It’s easy to drop it in multi-step problems - make it a habit to write +C.
  • Convert the differential during u-substitution. When you substitute u, replace dx with the correct du expression. Leaving dx in a u-integral is inconsistent and leads to errors in the coefficient.
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

More from Integration

  • Accumulation of change
  • Riemann sums & area
  • Definite integrals
  • Accumulation functions
  • Behavior of accumulation functions