Unit 6.10 – Integrating Functions Using Long Division and Completing the Square

AP® Calculus AB & BC | Advanced Integration Techniques

Why This Matters: When faced with rational functions (fractions with polynomials) or integrals involving quadratic expressions, two algebraic techniques become essential: polynomial long division and completing the square. Long division converts improper rational functions into proper ones, while completing the square transforms quadratics into perfect square form, enabling the use of inverse trig formulas. These techniques are crucial for BC Calculus and help simplify seemingly impossible integrals into manageable forms!

📐 Part 1: Integration Using Polynomial Long Division

WHEN TO USE LONG DIVISION

Use polynomial long division when integrating a rational function where the degree of the numerator is greater than or equal to the degree of the denominator.

Proper vs. Improper Rational Functions:
  • Proper: deg(numerator) < deg(denominator)
    Example: \(\frac{x+1}{x^2+3}\) (degree 1 < degree 2)
  • Improper: deg(numerator) ≥ deg(denominator)
    Example: \(\frac{x^3+2x}{x^2+1}\) (degree 3 ≥ degree 2)

⚠️ For improper fractions, use long division FIRST!

The Long Division Process

Steps for Polynomial Long Division:

  1. Set up: Write numerator ÷ denominator in long division format
  2. Divide: Leading term of numerator ÷ leading term of denominator
  3. Multiply: Result × entire denominator
  4. Subtract: Original numerator − product
  5. Bring down: Next term (if any)
  6. Repeat: Until remainder has lower degree than denominator
\[ \frac{\text{Numerator}}{\text{Denominator}} = \text{Quotient} + \frac{\text{Remainder}}{\text{Denominator}} \]

Example 1: Long Division for Integration

Problem: Find \(\int \frac{x^2 + 3x + 5}{x + 2} \, dx\)

Solution:

Step 1: Check degrees

Numerator degree: 2, Denominator degree: 1

Since 2 > 1, we need long division!

Step 2: Perform long division

x + 1 ___________ x+2 | x² + 3x + 5 x² + 2x ________ x + 5 x + 2 _____ 3

Result: \(\frac{x^2 + 3x + 5}{x + 2} = x + 1 + \frac{3}{x + 2}\)

Step 3: Integrate

\[ \int \frac{x^2 + 3x + 5}{x + 2} \, dx = \int \left(x + 1 + \frac{3}{x+2}\right) dx \]
\[ = \int x\,dx + \int 1\,dx + 3\int \frac{1}{x+2}\,dx \]
\[ = \frac{x^2}{2} + x + 3\ln|x+2| + C \]

Answer: \(\frac{x^2}{2} + x + 3\ln|x+2| + C\)

Example 2: More Complex Long Division

Problem: Find \(\int \frac{x^3 - 2x^2 + 4}{x^2 - 1} \, dx\)

Solution:

Step 1: Long division

Dividing \(x^3 - 2x^2 + 4\) by \(x^2 - 1\):

Result: \(x - 2 + \frac{x + 2}{x^2 - 1}\)

Step 2: Integrate

\[ = \int x\,dx - 2\int dx + \int \frac{x+2}{x^2-1}\,dx \]
\[ = \frac{x^2}{2} - 2x + \int \frac{x+2}{x^2-1}\,dx \]

For the last integral, use substitution or partial fractions (covered later)

Key Point: Long division converts improper fraction to polynomial + proper fraction

🔲 Part 2: Integration Using Completing the Square

WHEN TO USE COMPLETING THE SQUARE

Use completing the square when integrating expressions involving quadratics that don't factor nicely, especially:

  • Integrals of the form \(\int \frac{1}{ax^2 + bx + c}\,dx\)
  • Expressions that can lead to inverse trig functions
  • When the quadratic in denominator can't be factored over reals

Completing the Square Method

General Form:
\[ ax^2 + bx + c = a\left(x + \frac{b}{2a}\right)^2 + \left(c - \frac{b^2}{4a}\right) \]

Steps to Complete the Square:

  1. Factor out leading coefficient: From \(x^2\) and \(x\) terms
    \(ax^2 + bx + c = a(x^2 + \frac{b}{a}x) + c\)
  2. Take half of \(x\)-coefficient, square it:
    Half: \(\frac{b}{2a}\), Squared: \(\left(\frac{b}{2a}\right)^2 = \frac{b^2}{4a^2}\)
  3. Add and subtract inside parentheses:
    \(a\left(x^2 + \frac{b}{a}x + \frac{b^2}{4a^2} - \frac{b^2}{4a^2}\right) + c\)
  4. Factor perfect square, simplify:
    \(a\left(x + \frac{b}{2a}\right)^2 + c - \frac{b^2}{4a}\)

🔺 Key Inverse Trig Integration Formulas

Essential Formulas (After Completing the Square):

Inverse Trig Integration Formulas
Integral Form Result
\(\int \frac{1}{a^2 + x^2}\,dx\) \(\frac{1}{a}\arctan\left(\frac{x}{a}\right) + C\)
\(\int \frac{1}{\sqrt{a^2 - x^2}}\,dx\) \(\arcsin\left(\frac{x}{a}\right) + C\)
\(\int \frac{1}{x\sqrt{x^2 - a^2}}\,dx\) \(\frac{1}{a}\text{arcsec}\left(\frac{|x|}{a}\right) + C\)

Example 3: Completing the Square - Basic

Problem: Find \(\int \frac{1}{x^2 + 4x + 13} \, dx\)

Solution:

Step 1: Complete the square in denominator

\[ x^2 + 4x + 13 = (x^2 + 4x + 4) + 13 - 4 \]
\[ = (x + 2)^2 + 9 = (x + 2)^2 + 3^2 \]

Step 2: Substitute \(u = x + 2\), \(du = dx\)

\[ \int \frac{1}{(x+2)^2 + 9}\,dx = \int \frac{1}{u^2 + 9}\,du \]

Step 3: Use inverse trig formula

This is the form \(\int \frac{1}{u^2 + a^2}\,du\) with \(a = 3\)

\[ = \frac{1}{3}\arctan\left(\frac{u}{3}\right) + C \]

Step 4: Back-substitute

\[ = \frac{1}{3}\arctan\left(\frac{x+2}{3}\right) + C \]

Answer: \(\frac{1}{3}\arctan\left(\frac{x+2}{3}\right) + C\)

Example 4: Completing the Square - With Coefficient

Problem: Find \(\int \frac{1}{2x^2 + 8x + 10} \, dx\)

Solution:

Step 1: Factor out leading coefficient

\[ 2x^2 + 8x + 10 = 2(x^2 + 4x + 5) \]

Step 2: Complete the square

\[ x^2 + 4x + 5 = (x^2 + 4x + 4) + 5 - 4 = (x+2)^2 + 1 \]

So: \(2x^2 + 8x + 10 = 2[(x+2)^2 + 1]\)

Step 3: Rewrite integral

\[ \int \frac{1}{2[(x+2)^2 + 1]}\,dx = \frac{1}{2}\int \frac{1}{(x+2)^2 + 1}\,dx \]

Step 4: Substitute \(u = x+2\)

\[ = \frac{1}{2}\int \frac{1}{u^2 + 1}\,du = \frac{1}{2}\arctan(u) + C \]

Step 5: Back-substitute

\[ = \frac{1}{2}\arctan(x+2) + C \]

Answer: \(\frac{1}{2}\arctan(x+2) + C\)

Example 5: Natural Log Form

Problem: Find \(\int \frac{2x + 3}{x^2 + 4x + 5} \, dx\)

Solution:

Key observation: Numerator is related to derivative of denominator!

Derivative of \(x^2 + 4x + 5\) is \(2x + 4\)

Rewrite: \(2x + 3 = (2x + 4) - 1\)

Split the integral:

\[ \int \frac{2x+3}{x^2+4x+5}\,dx = \int \frac{2x+4}{x^2+4x+5}\,dx - \int \frac{1}{x^2+4x+5}\,dx \]

First integral: Natural log form

\[ \int \frac{2x+4}{x^2+4x+5}\,dx = \ln|x^2+4x+5| + C_1 \]

Second integral: Complete the square

\(x^2 + 4x + 5 = (x+2)^2 + 1\)

\[ \int \frac{1}{(x+2)^2+1}\,dx = \arctan(x+2) + C_2 \]

Combine:

\[ = \ln|x^2+4x+5| - \arctan(x+2) + C \]

Answer: \(\ln(x^2+4x+5) - \arctan(x+2) + C\)

💡 Essential Tips & Strategies

✅ Long Division Tips:

  • Check degrees first: Only needed if numerator degree ≥ denominator degree
  • Write in descending order: Include all powers (use 0 for missing terms)
  • Stop when: Remainder degree < denominator degree
  • Verify: Multiply quotient by divisor and add remainder—should get original
  • After division: Integrate term by term

🔥 Completing the Square Tips:

  • Factor out \(a\) first: Make coefficient of \(x^2\) equal to 1
  • Formula shortcut: \(x^2 + bx\) becomes \((x + \frac{b}{2})^2 - (\frac{b}{2})^2\)
  • Goal: Get form \((x - h)^2 \pm k^2\)
  • Then use: Appropriate inverse trig formula
  • Don't forget: To substitute back after using \(u = x - h\)

Decision Tree:

For Rational Functions:

  1. Is numerator degree ≥ denominator degree?
    • Yes: Use long division first
    • No: Try other methods
  2. After division (if needed), do you have quadratic in denominator?
    • Yes: Try completing the square
  3. Is numerator the derivative of denominator?
    • Yes: Natural log form!

❌ Common Mistakes to Avoid

  • Mistake 1: Forgetting to do long division when numerator degree ≥ denominator degree
  • Mistake 2: In long division, not including placeholder zeros for missing powers
  • Mistake 3: Sign errors when subtracting in long division
  • Mistake 4: Not factoring out leading coefficient before completing square
  • Mistake 5: Completing the square incorrectly—forgetting to add AND subtract \((\frac{b}{2a})^2\)
  • Mistake 6: Using wrong inverse trig formula (arctam vs arcsin vs arcsec)
  • Mistake 7: Forgetting the \(\frac{1}{a}\) factor in \(\int \frac{1}{x^2+a^2}\,dx = \frac{1}{a}\arctan(\frac{x}{a})\)
  • Mistake 8: Not back-substituting after using \(u\)-substitution
  • Mistake 9: Forgetting +C for indefinite integrals
  • Mistake 10: Not simplifying the final answer

📝 Practice Problems

Set A: Long Division

  1. \(\int \frac{x^2 + 5}{x + 1} \, dx\)
  2. \(\int \frac{x^3 + x}{x^2 + 1} \, dx\)

Answers:

  1. \(\frac{x^2}{2} - x + 6\ln|x+1| + C\)
  2. \(\frac{x^2}{2} + C\) (or \(\frac{x^2}{2} - \arctan(x) + C\) depending on approach)

Set B: Completing the Square

  1. \(\int \frac{1}{x^2 + 6x + 13} \, dx\)
  2. \(\int \frac{1}{x^2 - 4x + 8} \, dx\)
  3. \(\int \frac{1}{3x^2 + 6x + 12} \, dx\)

Answers:

  1. \(\frac{1}{2}\arctan\left(\frac{x+3}{2}\right) + C\)
  2. \(\frac{1}{2}\arctan\left(\frac{x-2}{2}\right) + C\)
  3. \(\frac{1}{3\sqrt{3}}\arctan\left(\frac{x+1}{\sqrt{3}}\right) + C\)

✏️ AP® Exam Success Tips

What AP® Graders Look For:

  • Show long division work: At least key steps
  • State completing the square: Show the algebraic transformation
  • Identify inverse trig form: Explicitly note the pattern
  • Show substitution: Write \(u =\) and \(du =\)
  • Back-substitute clearly: Replace \(u\) with original variable
  • Include +C: For indefinite integrals

⚡ Ultimate Quick Reference

ESSENTIAL FORMULAS & PROCEDURES

Quick Reference Guide
Technique When to Use Key Formula
Long Division deg(num) ≥ deg(den) \(\frac{N}{D} = Q + \frac{R}{D}\)
Completing Square Quadratic denominator \(ax^2+bx+c = a(x+\frac{b}{2a})^2 + (c-\frac{b^2}{4a})\)
Arctan Formula \(x^2 + a^2\) in denominator \(\int \frac{1}{x^2+a^2}\,dx = \frac{1}{a}\arctan(\frac{x}{a}) + C\)
Arcsin Formula \(\sqrt{a^2-x^2}\) in denominator \(\int \frac{1}{\sqrt{a^2-x^2}}\,dx = \arcsin(\frac{x}{a}) + C\)

Master Both Techniques! Polynomial long division is essential when the numerator degree ≥ denominator degree in rational functions—it converts improper fractions to polynomial + proper fraction form. Completing the square transforms quadratics into perfect square form \((x-h)^2 + k^2\), enabling use of inverse trig formulas. The key inverse trig integral is \(\int \frac{1}{x^2+a^2}\,dx = \frac{1}{a}\arctan(\frac{x}{a}) + C\). For long division: divide until remainder degree < divisor degree, then integrate term by term. For completing square: factor out leading coefficient, add/subtract \((\frac{b}{2a})^2\), factor perfect square, then use u-substitution with inverse trig formulas. These techniques often work together: use long division first if needed, then complete the square on the remaining proper fraction. Practice recognizing when each technique applies—pattern recognition is key! Show all algebraic work clearly on AP® exams. 🎯✨