Long Division and Completing the Square
Some fractions only become integrable after algebra. This guide shows the two most useful moves: dividing when the top is too big, and completing the square to reach an arctangent or arcsine.
If the degree of the numerator is at least the degree of the denominator, divide first: the result is a polynomial plus a fraction with a smaller top, and each piece is a basic integral or a substitution. If the bottom is a quadratic that does not factor, complete the square to turn it into \(u^2 + a^2\) (giving an arctangent) or, under a square root, \(a^2 - u^2\) (giving an arcsine).
1When the top is too big
\(\displaystyle\int \frac{x^2 + 3x + 1}{x + 1}\,dx\)
- 1The top’s degree (2) is at least the bottom’s (1), so divide: \(x^2 + 3x + 1 = (x + 1)(x + 2) - 1\).
- 2So \(\dfrac{x^2 + 3x + 1}{x + 1} = x + 2 - \dfrac{1}{x + 1}\).
- 3Integrate each piece: \(\dfrac{x^2}{2} + 2x - \ln|x + 1|\).
\(\displaystyle\int \frac{x^3}{x^2 + 1}\,dx\)
- 1Divide: \(x^3 = x(x^2 + 1) - x\), so the integrand is \(x - \dfrac{x}{x^2 + 1}\).
- 2\(\int x\,dx = \frac{x^2}{2}\). For \(\int\frac{x}{x^2 + 1}\,dx\), let \(u = x^2 + 1\): \(\frac12\ln(x^2 + 1)\).
\(\dfrac{x^2 + 3x + 1}{x + 1}\) is not \(\dfrac{x^2}{x} + \dfrac{3x}{1} + \dfrac{1}{1}\). Only a one-term denominator splits that way. A multi-term denominator calls for division.
2Completing the square
| Form after completing the square | Integral |
|---|---|
| \(\dfrac{1}{u^2 + a^2}\) | \(\dfrac1a\arctan\dfrac{u}{a} + C\) |
| \(\dfrac{1}{\sqrt{a^2 - u^2}}\) | \(\arcsin\dfrac{u}{a} + C\) |
\(\displaystyle\int \frac{1}{x^2 + 4x + 13}\,dx\)
- 1The bottom does not factor. Complete the square: \(x^2 + 4x + 13 = (x + 2)^2 + 9\).
- 2Use \(\displaystyle\int\frac{du}{u^2 + a^2} = \frac1a\arctan\frac{u}{a}\) with \(u = x + 2\), \(a = 3\).
\(\displaystyle\int \frac{1}{\sqrt{6x - x^2}}\,dx\)
- 1Rewrite inside the root: \(6x - x^2 = -(x^2 - 6x) = -\left[(x - 3)^2 - 9\right] = 9 - (x - 3)^2\).
- 2Use \(\displaystyle\int\frac{du}{\sqrt{a^2 - u^2}} = \arcsin\frac{u}{a}\) with \(u = x - 3\), \(a = 3\).
“Completing the square, \(x^2 + 4x + 13 = (x + 2)^2 + 9\), so \(\displaystyle\int\frac{dx}{(x + 2)^2 + 9} = \frac13\arctan\frac{x + 2}{3} + C\).”
\(\displaystyle\int\frac{du}{u^2 + 9} = \frac13\arctan\frac{u}{3}\), not \(\arctan\frac{u}{3}\). Check by differentiating: \(\frac{d}{du}\left[\frac13\arctan\frac{u}{3}\right] = \frac13 \cdot \frac{1/3}{1 + u^2/9} = \frac{1}{u^2 + 9}\).
\(\displaystyle\int_{-2}^{1} \frac{dx}{x^2 + 4x + 13}\)
- 1From Worked Example 3: \(\left[\tfrac13\arctan\tfrac{x + 2}{3}\right]_{-2}^{1} = \tfrac13\arctan 1 - \tfrac13\arctan 0\).
- 2\(= \tfrac13 \cdot \tfrac{\pi}{4} - 0\).
3Choosing the move
| The fraction looks like | First move |
|---|---|
| Top degree ≥ bottom degree | Long division |
| Bottom is a quadratic that factors | Partial fractions (or substitution) |
| Bottom is a quadratic that does not factor | Complete the square → arctangent |
| Square root of a quadratic with −x² | Complete the square → arcsine |
| Top is the derivative of the bottom | Substitution → ln |
For \(6x - x^2\), factor out the minus sign first: \(-(x^2 - 6x)\). Completing the square inside gives \(-(x - 3)^2 + 9\). Skipping the factoring step leads to \((x - 3)^2 - 9\), the wrong sign.
Quick reference
| Algebra | Example |
|---|---|
| Long division | \(\frac{x^2 + 3x + 1}{x + 1} = x + 2 - \frac{1}{x + 1}\) |
| Complete the square | \(x^2 + bx + c = \left(x + \frac{b}{2}\right)^2 + c - \frac{b^2}{4}\) |
| Arctangent form | \(\int\frac{du}{u^2 + a^2} = \frac1a\arctan\frac{u}{a} + C\) |
| Arcsine form | \(\int\frac{du}{\sqrt{a^2 - u^2}} = \arcsin\frac{u}{a} + C\) |