---
title: "Integrating Functions Using Long Division and Completing the Square | FiveStudy"
description: "Neither is an integration technique. Both are algebra that turns an unfamiliar integrand into a familiar one."
url: https://fivestudy.com/guides/ap-calculus-bc-6-10-integrating-using-long-division-and-completing-the-square
---

[AP Calculus BC](https://fivestudy.com/ap-calculus-bc) · Study guide

# Integrating Functions Using Long Division and Completing the Square

[Figure: FiveStudy]

FiveStudy

AP® Calculus BC · Unit 6 · Integration and Accumulation of Change

AP® Calculus BC · Unit 6 · Integration and Accumulation of Change

# 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.

1. When the top is too big 2. Completing the square 3. Choosing the move

The idea in one paragraph

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).

## 1 When the top is too big

Worked Example 1 Divide first

### \(\displaystyle\int \frac{x^2 + 3x + 1}{x + 1}\,dx\)

1. 1

   The top’s degree (2) is at least the bottom’s (1), so divide: \(x^2 + 3x + 1 = (x + 1)(x + 2) - 1\).

2. 2

   So \(\dfrac{x^2 + 3x + 1}{x + 1} = x + 2 - \dfrac{1}{x + 1}\).

3. 3

   Integrate each piece: \(\dfrac{x^2}{2} + 2x - \ln|x + 1|\).

**Answer:** \(\dfrac{x^2}{2} + 2x - \ln|x + 1| + C\)

**Figure 1.** Dividing gives a polynomial part, x + 2, plus a small fraction, −1/(x + 1). Each piece is easy to integrate; the original fraction is not.

Worked Example 2 Divide, then substitute

### \(\displaystyle\int \frac{x^3}{x^2 + 1}\,dx\)

1. 1

   Divide: \(x^3 = x(x^2 + 1) - x\), so the integrand is \(x - \dfrac{x}{x^2 + 1}\).

2. 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)\).

**Answer:** \(\dfrac{x^2}{2} - \dfrac12\ln(x^2 + 1) + C\)

Common Mistake 1 · Splitting the fraction by its denominator’s terms

\(\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.

## 2 Completing 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\) |

Worked Example 3 Complete the square: arctangent

### \(\displaystyle\int \frac{1}{x^2 + 4x + 13}\,dx\)

1. 1

   The bottom does not factor. Complete the square: \(x^2 + 4x + 13 = (x + 2)^2 + 9\).

2. 2

   Use \(\displaystyle\int\frac{du}{u^2 + a^2} = \frac1a\arctan\frac{u}{a}\) with \(u = x + 2\), \(a = 3\).

**Answer:** \(\tfrac13\arctan\left(\dfrac{x + 2}{3}\right) + C\)

Worked Example 4 Complete the square: arcsine

### \(\displaystyle\int \frac{1}{\sqrt{6x - x^2}}\,dx\)

1. 1

   Rewrite inside the root: \(6x - x^2 = -(x^2 - 6x) = -\left[(x - 3)^2 - 9\right] = 9 - (x - 3)^2\).

2. 2

   Use \(\displaystyle\int\frac{du}{\sqrt{a^2 - u^2}} = \arcsin\frac{u}{a}\) with \(u = x - 3\), \(a = 3\).

**Answer:** \(\arcsin\left(\dfrac{x - 3}{3}\right) + C\)

Write it like this

“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\).”

Common Mistake 2 · Losing the 1/a

\(\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}\).

Worked Example 5 A definite version

### \(\displaystyle\int_{-2}^{1} \frac{dx}{x^2 + 4x + 13}\)

1. 1

   From Worked Example 3: \(\left[\tfrac13\arctan\tfrac{x + 2}{3}\right]_{-2}^{1} = \tfrac13\arctan 1 - \tfrac13\arctan 0\).

2. 2

   \(= \tfrac13 \cdot \tfrac{\pi}{4} - 0\).

**Answer:** \(\dfrac{\pi}{12} \approx 0.262\)

## 3 Choosing 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 |

Common Mistake 3 · Completing the square with the wrong sign

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\) |

FiveStudy AP® Calculus BC · Long division and completing the square
