Integration:
Long Division & Completing the Square
Master two powerful algebraic techniques that simplify complex rational integrands into forms you already know how to integrate.
Why Algebraic Prep Before Integrating?
Not every integrand is ready for a direct formula. When you face a rational function where the numerator's degree is greater than or equal to the denominator's (i.e., \(\deg(P) \geq \deg(D)\)), or a quadratic in the denominator that isn't a perfect square, you need to rewrite before you integrate.
What is Polynomial Long Division?
When you have \(\displaystyle\int \frac{P(x)}{D(x)}\,dx\) and \(\deg(P) \geq \deg(D)\), the fraction is called improper. Polynomial long division rewrites it as:
Now \(Q(x)\) is a simple polynomial you integrate with the power rule, and \(\frac{R(x)}{D(x)}\) is a proper fraction: often a logarithm or arctangent form.
What is Completing the Square?
When the denominator contains an irreducible quadratic like \(x^2 + bx + c\), completing the square rewrites it as:
This produces the form \(u^2 + a^2\), which unlocks the arctangent integration formula: \(\displaystyle\int \frac{du}{u^2+a^2} = \frac{1}{a}\arctan\!\left(\frac{u}{a}\right)+C\).
The Two Key Formulas
Used after long division leaves a linear denominator.
Used after completing the square produces \(u^2+a^2\).
When to Use Which Technique?
| Long Division | Completing the Square | |
|---|---|---|
| Trigger | \(\deg(\text{num}) \geq \deg(\text{den})\) | Irreducible quadratic \(ax^2+bx+c\) in denominator |
| Goal | Split into polynomial + proper fraction | Rewrite as \(u^2+a^2\) form |
| Result | Power rule + \(\ln\) or \(\arctan\) | \(\arctan\) (or \(\ln\) with substitution) |
| Example | \(\frac{x^2}{x+1}\) | \(\frac{1}{x^2+4x+8}\) |
Decision Flowchart
Step-by-Step: Long Division
Example 1: \(\displaystyle\int \frac{x^2+3}{x+1}\,dx\)
Step-by-Step: Completing the Square
Example 2: \(\displaystyle\int \frac{dx}{x^2+6x+13}\)
Example 3: Both Techniques Together
Evaluate \(\displaystyle\int\frac{x^2+2x+3}{x^2+2x+5}\,dx\).
Visualizing Completing the Square
Handling a Linear Numerator
When the numerator is not just a constant, split the integral. For \(\displaystyle\int\frac{2x+5}{x^2+4x+8}\,dx\), rewrite the numerator to match the derivative of the denominator:
Common Mistakes to Avoid
Summary Reference
| Integrand Type | Technique | Result Form |
|---|---|---|
| \(\frac{x^n+\cdots}{x^m+\cdots}\), \(n\geq m\) | Long division | Polynomial + proper fraction |
| \(\frac{1}{x^2+bx+c}\) | Complete the square | \(\frac{1}{a}\arctan\!\left(\frac{u}{a}\right)+C\) |
| \(\frac{Ax+B}{x^2+bx+c}\) | Split + both techniques | \(\ln|\cdot| + \arctan(\cdot) + C\) |
| \(\frac{x^n+\cdots}{x^2+bx+c}\), \(n\geq 2\) | Long division, then complete sq. | Polynomial + \(\ln\) + \(\arctan\) + \(C\) |
Question 1 of 5
What is the first step when evaluating \(\displaystyle\int\frac{x^3+1}{x+2}\,dx\)?
Question 2 of 5
Completing the square on \(x^2 + 8x + 20\) gives:
Question 3 of 5
Evaluate \(\displaystyle\int\frac{x^2}{x-1}\,dx\).
Question 4 of 5
Evaluate \(\displaystyle\int\frac{dx}{x^2+2x+10}\).
Question 5 of 5
To evaluate \(\displaystyle\int\frac{x^2+x+1}{x^2+4x+5}\,dx\), what combination of techniques is needed?