6. Integration and Accumulation of Change

Integrating Functions Using Long Division And Completing The Square

Integrating Functions Using Long Division and Completing the Square

Introduction

students, in calculus, an integral often represents accumulated change, total area, or the net result of something adding up over time 📈. When the integrand is a rational function or a quadratic expression, direct integration is not always possible right away. That is where long division and completing the square become powerful tools. They help rewrite a function into a form that is easier to integrate using antiderivatives, the Fundamental Theorem of Calculus, and familiar formulas.

Learning objectives

By the end of this lesson, students will be able to:

  • Explain why long division and completing the square are useful in integration.
  • Integrate rational functions that require polynomial long division.
  • Integrate expressions involving quadratic terms by completing the square.
  • Connect these methods to accumulation of change and antiderivatives.
  • Recognize when to use each technique on AP Calculus BC problems.

These strategies matter because AP Calculus BC often asks students to integrate expressions that are not immediately in a standard form. Instead of forcing a difficult integral, you can transform the expression into one that matches known antiderivatives. That skill is a big part of problem solving in calculus 🔍.

Using Long Division for Rational Functions

A rational function is a quotient of polynomials, such as $\frac{x^2+3x+2}{x-1}$ or $\frac{2x^3+5x-1}{x^2+1}$. Long division is useful when the degree of the numerator is greater than or equal to the degree of the denominator. In that case, the expression can be rewritten as a polynomial plus a simpler rational function.

For example, consider

$$

$\int \frac{x^2+3x+2}{x-1} \, dx.$

$$

Because the numerator has degree $2$ and the denominator has degree $1$, divide first. Using polynomial long division,

$$

$\frac{x^2+3x+2}{x-1}=x+4+\frac{6}{x-1}.$

$$

Now the integral becomes

$$

$\int \left(x+4+\frac{6}{x-1}\right) dx.$

$$

This separates into easier pieces:

$$

$\int x\,dx+\int 4\,dx+\int \frac{6}{x-1}\,dx.$

$$

Using standard antiderivatives,

$$

$\frac{x^2}{2}+4x+6\ln|x-1|+C.$

$$

This is a perfect example of how long division turns a complicated integral into a manageable one. The logarithm appears because $\int \frac{1}{u} \, du = \ln|u| + C$.

Why long division works

Long division works because every rational function with numerator degree at least as large as denominator degree can be rewritten as

$$

$\text{polynomial} + \frac{\text{remainder}}{\text{denominator}}.$

$$

The remainder term has a lower degree than the denominator, making it easier to simplify further. In AP Calculus BC, this often appears before partial fraction decomposition or as a stand-alone strategy.

Another example

Integrate

$$

$\int \frac{2x^3+5x^2-3}{x^2+1} \, dx.$

$$

Since the numerator has degree $3$ and the denominator has degree $2$, divide first:

$$

$\frac{2x^3+5x^2-3}{x^2+1}=2x+5+\frac{-2x-8}{x^2+1}.$

$$

Then

$$

$\int \left(2x+5+\frac{-2x-8}{x^2+1}\right) dx$

$$

becomes

$$

$\int 2x\,dx+\int 5\,dx-2\int \frac{x}{x^2+1}\,dx-8\int \frac{1}{x^2+1}\,dx.$

$$

The first three pieces are straightforward, and the last one uses the arctangent formula:

$$

$\int \frac{1}{x^2+1}\,dx=\arctan(x)+C.$

$$

So the antiderivative is

$$

$ x^2+5x-\ln(x^2+1)-8\arctan(x)+C.$

$$

Notice that the term $\int \frac{x}{x^2+1} \, dx$ can be handled with a substitution $u=x^2+1$, since $du=2x\,dx$.

Completing the Square for Quadratic Expressions

Completing the square is especially helpful when the denominator contains a quadratic expression that cannot be factored nicely. A quadratic such as $x^2+6x+13$ can be rewritten in a form that matches known inverse trigonometric or logarithmic integrals.

The general idea is to turn

$$

$ax^2+bx+c$

$$

into something like

$$

$a(x-h)^2+k.$

$$

This makes the expression easier to analyze and integrate.

A basic example

Consider

$$

$\int \frac{1}{x^2+6x+13} \, dx.$

$$

Complete the square in the denominator:

$$

$ x^2+6x+13=(x+3)^2+4.$

$$

So the integral becomes

$$

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

$$

This matches the standard form

$$

$\int \frac{1}{u^2+a^2} \, du=\frac{1}{a}\arctan\left(\frac{u}{a}\right)+C.$

$$

With $u=x+3$ and $a=2$, the result is

$$

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

$$

Completing the square is essential here because the original quadratic does not factor over the real numbers.

When the numerator is related to the derivative of the denominator

Sometimes the numerator can be split to match the derivative of the denominator. For example,

$$

$\int \frac{2x+6}{x^2+6x+13} \, dx.$

$$

Since

$$

$\frac{d}{dx}(x^2+6x+13)=2x+6,$

$$

this is a direct logarithmic form:

$$

$\ln(x^2+6x+13)+C.$

$$

If the numerator does not match neatly, you can still complete the square and then rewrite the numerator to separate the integral into simpler parts.

A more involved example

Integrate

$$

$\int \frac{x+1}{x^2+4x+8} \, dx.$

$$

First complete the square:

$$

$ x^2+4x+8=(x+2)^2+4.$

$$

Now rewrite the numerator in terms of $x+2$:

$$

$ x+1=(x+2)-1.$

$$

So the integral becomes

$$

$\int$ $\frac{x+2}{(x+2)^2+4}$ \, dx-$\int$ $\frac{1}{(x+2)^2+4}$ \, dx.

$$

For the first part, use $u=(x+2)^2+4$, so $du=2(x+2)\,dx$:

$$

$\int \frac{x+2}{(x+2)^2+4} \, dx=\frac{1}{2}\ln\left((x+2)^2+4\right).$

$$

For the second part,

$$

$\int \frac{1}{(x+2)^2+2^2} \, dx=\frac{1}{2}\arctan\left(\frac{x+2}{2}\right)+C.$

$$

So the final answer is

$$

$\frac{1}{2}$$\ln$$\left($(x+2)^2+$4\right)$-$\frac{1}{2}$$\arctan$$\left($$\frac{x+2}{2}$$\right)$+C.

$$

This shows how completing the square can reveal the best path to an antiderivative.

How These Methods Connect to Accumulation of Change

In AP Calculus BC, definite integrals measure net change. For example, if $v(t)$ is velocity, then

$$

$\int_a^b v(t)\,dt$

$$

gives displacement over time. Similarly, if a function is a rate of change, integrating it accumulates the total effect.

Long division and completing the square do not change the meaning of the integral. They only rewrite the integrand so that the antiderivative is easier to find. After rewriting, the Fundamental Theorem of Calculus can be applied to evaluate definite integrals.

For example,

$$

$\int_1^3 \frac{x^2+3x+2}{x-1} \, dx$

$$

can be rewritten using long division as

$$

$\int_1^3 \left(x+4+\frac{6}{x-1}\right) dx.$

$$

This new form is easier to interpret and compute, though note that the interval includes $x=1$, where the original integrand is undefined. That means this definite integral is improper and must be handled carefully, since the function has a vertical asymptote at $x=1$.

This is an important reminder: before integrating, students should always check the domain and identify discontinuities. If the interval includes a point where the denominator is zero, the integral may be improper and require limits.

Choosing the Right Tool on AP Calculus BC

A good strategy is to inspect the form of the integrand first:

  • If you see a rational function with top degree at least as large as bottom degree, try long division.
  • If you see a quadratic expression that does not factor easily, try completing the square.
  • If the denominator becomes $u^2+a^2$, look for an arctangent form.
  • If the denominator becomes a perfect square plus a variable term, consider a logarithmic form.

For AP-style problems, this often appears in one of three ways:

  1. As an antiderivative problem.
  2. As a definite integral needing evaluation.
  3. As part of a larger accumulation problem involving rates, total change, or area.

The main skill is not memorizing random tricks. It is recognizing structure and rewriting the expression in a form that matches a known rule.

Conclusion

Long division and completing the square are essential integration tools because they transform difficult functions into familiar forms. Long division simplifies rational functions by separating out a polynomial and a smaller remainder. Completing the square rewrites quadratic expressions so they match logarithmic or inverse tangent antiderivatives. Together, these methods support the broader goal of calculus: measuring accumulated change through antiderivatives and definite integrals.

For students, the key takeaway is that many integration problems become easier once the integrand is rewritten thoughtfully. On AP Calculus BC, that flexibility helps you move from a complicated expression to a clear, correct solution ✅.

Study Notes

  • Long division is used when the degree of the numerator is greater than or equal to the degree of the denominator.
  • After long division, rewrite the rational function as a polynomial plus a proper rational function.
  • Completing the square rewrites a quadratic into the form $a(x-h)^2+k$.
  • A denominator of the form $u^2+a^2$ often leads to an arctangent antiderivative.
  • A numerator that matches the derivative of the denominator often leads to a logarithmic antiderivative.
  • Always check for discontinuities before evaluating definite integrals, especially when a denominator can be zero.
  • These methods help convert complicated integrands into forms that fit standard antiderivative formulas.
  • In AP Calculus BC, these techniques connect directly to accumulation of change, the Fundamental Theorem of Calculus, and improper integrals.

Practice Quiz

5 questions to test your understanding