Unit 6 · Topic 6.10 Beta

Integrating by Long Division and Completing the Square

3 min read · freeNot practiced

Substitution and the basic rules cover most integrals, but a few fractions need a little algebra first. This page covers the two rewrites on the AB exam: polynomial long division, and completing the square to reach an arctangent.

Long division: when the top is "too big"

The graph of y = (x squared + 3x + 5)/(x + 1) in two branches on either side of the vertical asymptote x = -1, with the dashed line y = x + 2. The curve hugs the line far from x = -1; at x = 3 a vertical segment marks the gap 3/(x + 1). Long division gives x + 2 + 3/(x + 1).
Figure 1. The fraction is the line y = x + 2 plus a small piece, 3/(x + 1). LevlPrep original diagram.

In x2+3x+5x+1\frac{x^2 + 3x + 5}{x + 1} the top has degree 2 and the bottom degree 1. No basic rule fits, and substitution with u=x+1u = x + 1 is clumsy. Divide, exactly as with numbers: 175=3+25\frac{17}{5} = 3 + \frac{2}{5}.

Worked example 1. Find ∫x2+3x+5x+1dx\int \frac{x^2 + 3x + 5}{x + 1}\,dx.

Divide x2+3x+5x^2 + 3x + 5 by x+1x + 1. First term: xx, since x(x+1)=x2+xx(x + 1) = x^2 + x. Subtract: 2x+52x + 5 remains.

Next term: 22, since 2(x+1)=2x+22(x + 1) = 2x + 2. Subtract: 33 remains, the remainder.

So x2+3x+5x+1\frac{x^2 + 3x + 5}{x + 1}=x= x+2+ 2+3x+1+ \frac{3}{x + 1}. (Check: (x+1)(x+2)+3(x + 1)(x + 2) + 3=x2+3x+5= x^2 + 3x + 5.)

Integrate each piece: x22+2x+3ln⁡|x+1|+C\frac{x^2}{2} + 2x + 3\ln|x + 1| + C.

The figure shows what the division means: far from x=−1x = -1, the curve is nearly the line y=x+2y = x + 2, and the remainder 3x+1\frac{3}{x + 1} is the shrinking gap.

A quick version works when the bottom divides neatly into the top: 2x+3x+1\frac{2x + 3}{x + 1}=2(x+1)+1x+1= \frac{2(x + 1) + 1}{x + 1}=2= 2+1x+1+ \frac{1}{x + 1}, and x2x2+1\frac{x^2}{x^2 + 1}=(x2+1)−1x2+1= \frac{(x^2 + 1) - 1}{x^2 + 1}=1−1x2+1= 1 - \frac{1}{x^2 + 1}.

Completing the square: reaching arctan

The rule ∫11+u2du\int \frac{1}{1 + u^2}\,du=arctan⁡u+C= \arctan u + C handles a sum of squares on the bottom. A quadratic with no real zeros can always be written as one. To complete the square in x2+bx+cx^2 + bx + c, take half of bb, square it, and balance:

x2−2x+10=(x2−2x+1)+9=(x−1)2+9.x^2 - 2x + 10 = (x^2 - 2x + 1) + 9 = (x - 1)^2 + 9.

You also need the scaled version. With u=x−hu = x - h and a>0a > 0:

∫1u2+a2du=1aarctan⁡ua+C.\int \frac{1}{u^2 + a^2}\,du = \frac{1}{a}\arctan\frac{u}{a} + C.

(Check by differentiating: 1a⋅1/a1+u2/a2\frac{1}{a}\cdot\frac{1/a}{1 + u^2/a^2}=1a2+u2= \frac{1}{a^2 + u^2}.)

Worked example 2. Evaluate ∫141x2−2x+10dx\int_1^4 \frac{1}{x^2 - 2x + 10}\,dx.

Complete the square: (x−1)2+9(x - 1)^2 + 9, so u=x−1u = x - 1 and a=3a = 3.

Antiderivative: 13arctan⁡x−13\frac{1}{3}\arctan\frac{x - 1}{3}.

Evaluate: 13(arctan⁡1−arctan⁡0)\frac{1}{3}\left(\arctan 1 - \arctan 0\right)=13⋅π4= \frac{1}{3}\cdot\frac{\pi}{4}=π12= \frac{\pi}{12}.

Which rewrite, if any?

Integrand looks likeDo thisExample
top degree at least bottom degreelong divisionx2+3x+5x+1\frac{x^2 + 3x + 5}{x + 1}=x= x+2+ 2+3x+1+ \frac{3}{x + 1}
top is the derivative of the bottomsubstitute, get ln⁡\ln∫2x−2x2−2x+10dx\int \frac{2x - 2}{x^2 - 2x + 10}\,dx=ln⁡(x2−2x+10)= \ln(x^2 - 2x + 10)+C+ C
constant over a quadratic with no real zeroscomplete the square, get arctan∫dxx2+4x+5\int \frac{dx}{x^2 + 4x + 5}=arctan⁡(x+2)= \arctan(x + 2)+C+ C

Two habits prevent most errors: never integrate the top and bottom of a fraction separately, and differentiate your answer to check it. The factor 1a\frac{1}{a} in the arctan form is the piece most often lost.

When the bottom factors into different linear pieces, such as 1(x−1)(x+2)\frac{1}{(x - 1)(x + 2)}, the method of partial fractions splits it apart. That method is part of the BC course only and does not appear on the AB exam.

Spot a mistake on this page?