6. Integration and Accumulation of Change

Integrating Functions Using Long Division And Completing The Square

Integrating Functions Using Long Division and Completing the Square

students, imagine trying to find the area under a curve when the graph looks messy and the function does not fit the basic patterns you already know. 😄 In AP Calculus AB, this happens a lot with rational functions and quadratic expressions inside square roots or denominators. Two powerful algebra tools—long division and completing the square—can transform hard integrals into easier ones.

By the end of this lesson, you should be able to:

  • Explain why long division and completing the square are useful before integrating.
  • Use algebra to rewrite functions into forms that can be integrated more easily.
  • Connect these methods to antiderivatives, the Fundamental Theorem of Calculus, and accumulation of change.
  • Recognize when an integral becomes simpler after rewriting the function.

These strategies are not separate from calculus—they are part of the bigger AP Calculus AB goal of turning rates of change into accumulated change. When a function is rewritten into a simpler form, the integral often becomes a sum of basic pieces that you already know how to handle.

Why algebra comes before integration

Some integrals are straightforward because they match familiar rules, such as $\int x^n \, dx$, $\int e^x \, dx$, or $\int \frac{1}{x} \, dx$. But many real problems do not arrive in that neat form. For example, a rational function may have a numerator with degree greater than or equal to the denominator, or a quadratic expression may be awkward inside a square root.

That is where algebra helps. Long division and completing the square are not “extra steps” unrelated to calculus. They are tools for rewriting the integrand so that the integral can be broken into pieces with known antiderivatives. This is a very common AP Calculus AB skill because it combines symbolic manipulation with integration reasoning.

For example, if you see a function like $\frac{x^2+3x+2}{x+1}$, it is easier to integrate after simplifying. If you see $\frac{1}{x^2+4x+5}$, completing the square reveals a form related to the arctangent pattern.

Using long division for rational functions

Long division is used when the degree of the numerator is greater than or equal to the degree of the denominator. In that case, the rational expression is called an improper rational function. The goal is to rewrite it as a polynomial plus a proper fraction.

Consider

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

Since the degree of $x^2+3x+2$ is larger than the degree of $x+1$, divide first:

$$\frac{x^2+3x+2}{x+1}=x+2$$

because $(x+1)(x+2)=x^2+3x+2$.

Now the integral becomes

$$\int (x+2) \, dx$$

which is easy to evaluate:

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

This example shows an important AP idea: sometimes the “hard” integrand is actually just a simpler function in disguise. Long division reveals that disguise. 🎯

Let’s look at a slightly harder example:

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

Using long division, we get

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

because $(x-1)(2x+7)=2x^2+5x-7$, wait—that is not correct. Let’s check carefully. The correct division gives

$$\frac{2x^2+5x-3}{x-1}=2x+7+\frac{4}{x-1}$$

so the integral becomes

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

Now integrate term by term:

$$\int 2x\,dx=x^2, \quad \int 7\,dx=7x, \quad \int \frac{4}{x-1}\,dx=4\ln|x-1|$$

So the final answer is

$$x^2+7x+4\ln|x-1|+C$$

The absolute value is important because the antiderivative of $\frac{1}{x}$ is $\ln|x|+C$, not just $\ln x+C$.

Completing the square to reveal a familiar form

Completing the square is useful when a quadratic expression appears in a denominator or inside a square root. The purpose is to rewrite the quadratic in vertex form so it matches a standard integration pattern.

A common pattern is

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

If the denominator is not already in the form $x^2+a^2$, completing the square can make it match.

For example,

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

Complete the square:

$$x^2+4x+5=(x+2)^2+1$$

So the integral becomes

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

Now use the substitution idea mentally: this matches the pattern with $u=x+2$. The antiderivative is

$$\arctan(x+2)+C$$

because the inside derivative is $1$, so no extra constant factor is needed.

Here is another example:

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

Complete the square:

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

Then rewrite:

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

This matches the arctangent form with $a=2$, so the answer is

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

This is a great example of how algebra makes the calculus visible. 🧠

When completing the square helps with square roots

Completing the square is also useful when a quadratic appears under a square root. Some integrals with radicals are not part of the basic AP Calculus AB toolkit, but completing the square is still important because it prepares the expression for further methods or interpretation.

For instance, consider

$$\int \frac{1}{\sqrt{x^2+6x+10}} \, dx$$

Complete the square:

$$x^2+6x+10=(x+3)^2+1$$

So the integral becomes

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

This form is easier to analyze than the original one. Depending on the context of the course, this may suggest a trigonometric substitution or a recognition of a standard inverse hyperbolic form, but the main AP Calculus AB point is that the square is completed to simplify the expression.

Another reason this matters is graph interpretation. Rewriting $x^2+6x+10$ as $(x+3)^2+1$ shows that the expression is always at least $1$, so the square root is always defined. That kind of insight helps with domain and behavior of the function.

Connecting these methods to accumulated change

In AP Calculus AB, integration is about accumulated change. A definite integral like

$$\int_a^b f(x)\,dx$$

represents net change or signed area over an interval. If the original integrand is difficult, long division or completing the square can change the problem into a sum of simpler accumulated changes.

Suppose a velocity function is given by

$$v(t)=\frac{t^2+3t+2}{t+1}$$

Then the displacement from $t=0$ to $t=2$ is

$$\int_0^2 v(t)\,dt$$

Using long division, $v(t)=t+2$, so

$$\int_0^2 (t+2)\,dt=\left[\frac{t^2}{2}+2t\right]_0^2=\left(2+4\right)-0=6$$

This means the object’s net displacement is $6$ units. The algebra step did not change the meaning of the integral. It only made the accumulated change easier to compute.

Similarly, if a rate function contains a quadratic like $x^2+4x+5$, completing the square can reveal a standard antiderivative and make the definite integral manageable. The numerical answer still measures accumulated change, just as the Fundamental Theorem of Calculus says.

How to choose the right method

A good AP Calculus AB strategy is to inspect the integrand first.

Use long division when:

  • The integrand is a rational function.
  • The degree of the numerator is greater than or equal to the degree of the denominator.
  • You want to split the integrand into a polynomial plus a proper fraction.

Use completing the square when:

  • A quadratic expression appears in the denominator.
  • A quadratic is inside a square root or another nonlinear expression.
  • Rewriting the quadratic may reveal a standard form like $x^2+a^2$ or $(x-h)^2+a^2$.

A useful habit is to ask: “Can I rewrite this into a form I already know how to integrate?” If the answer is yes, you are using calculus like a problem solver, not just a formula memorizer. ✅

Conclusion

Long division and completing the square are essential algebraic tools for integration in AP Calculus AB. Long division turns improper rational functions into simpler pieces, while completing the square reshapes quadratics so they match familiar integration patterns. Both methods help you move from a complicated integrand to an antiderivative you can actually find.

These techniques fit directly into the broader theme of integration and accumulation of change because they make it possible to compute definite integrals that represent net change, area, or displacement. students, when you see a difficult integral, remember that algebra can be the first step toward calculus success.

Study Notes

  • Long division is used for rational functions when the numerator’s degree is greater than or equal to the denominator’s degree.
  • After long division, rewrite the integrand as a polynomial plus a simpler fraction.
  • Completing the square rewrites a quadratic as $(x-h)^2+k$.
  • A common integral pattern is $\int \frac{1}{x^2+a^2} \, dx=\frac{1}{a}\arctan\left(\frac{x}{a}\right)+C$.
  • Completing the square can help identify arctangent forms and simplify expressions under radicals.
  • The antiderivative of $\frac{1}{x}$ is $\ln|x|+C$.
  • These algebraic steps do not change the value of a definite integral; they only make the integral easier to evaluate.
  • In AP Calculus AB, integration represents accumulated change, so simplifying the integrand helps compute area, displacement, and net change more efficiently.

Practice Quiz

5 questions to test your understanding

Integrating Functions Using Long Division And Completing The Square — AP Calculus AB | A-Warded