Advanced Placement
Skip to the notes

AP Calculus BC

Topic 6.10: Integrating Functions Using Long Division and Completing the Square

Watch now21 min

Updated · For the May 2027 AP exam

Every scary fraction is a familiar curve in disguise

This topic starts at 0:00 in a lesson that also covers Topic 6.14: Selecting Techniques for Antidifferentiation.

Topic 6.10 key terms

long division before integrating
When the top's degree is at least the bottom's, divide: p(x)d(x)=q(x)+r(x)d(x)\frac{p(x)}{d(x)} = q(x) + \frac{r(x)}{d(x)}. Integrate the quotient and the remainder piece separately; the remainder never gets dropped.
completing the square
Rewrite x2+bx+cx^2 + bx + c as (x+b2)2+(c−b24)\left(x + \frac{b}{2}\right)^2 + \left(c - \frac{b^2}{4}\right): half of bb, squared, is the corner that completes the square.
Witch of Agnesi
The curve y=11+x2y = \frac{1}{1+x^2}, from Maria Gaetana Agnesi's 1748 calculus textbook. The area under it from 00 to xx is arctan⁡x\arctan x.
arctan form
∫duu2+a2=1aarctan⁡ua+C\int \frac{du}{u^2 + a^2} = \frac{1}{a}\arctan\frac{u}{a} + C for a>0a > 0; the 1a\frac1a comes from the stretch.
choosing a technique
Ask in order: a basic rule? an inside function with its derivative (u-substitution)? a top-heavy fraction (divide)? a quadratic bottom that won't factor (complete the square)? Then differentiate to check.

Transcript

1,793 words · 5 parts

Pi with no circle

Here’s a curve made out of almost nothing, x squared over x squared plus one, and watch what happens when we use it to cut a square. The square is one unit on each side, and the little gold piece is the part under the curve. How big is that gold piece, and I mean exactly, not roughly?

The exact area turns out to be one minus pi over four. There isn’t a single circle anywhere in this picture, and nothing in that formula is round, so where on earth is the pi coming from?

The answer is that there’s a second curve hiding inside this one, and hiding inside that second curve there’s a circle. By the end of this lesson, you’ll be able to find areas like this one exactly, by hand. When a scary-looking fraction shows up under an integral sign on the AP exam, you’ll know which trick cracks it open. The first trick is one you already know from precalc, long division, and it’s about to pull that hidden curve right out.

The witch inside

Look at one thin vertical slice of the square. The whole slice is one unit tall, the gold takes x squared over one plus x squared of it, and the amber piece above the curve gets whatever’s left.

Imagine we lift that amber leftover off the glass and flip it upside down. What shape do you think it makes? Now test your prediction. Grab the amber piece and flip it over yourself.

That’s half of a hump, and if we let the pen keep going in both directions, here’s the whole curve, y equals one over one plus x squared. This curve is famous, and she has one of the strangest names in all of math, but first let’s find her with algebra.

Let’s write the gold area as an integral, from zero to one of x squared over x squared plus one, and notice that the top and the bottom have the same degree. When the top’s degree is at least as big as the bottom’s, the fraction is top-heavy, like seven thirds, and you divide. x squared plus one goes into x squared exactly once, and once is x squared plus one, which overshoots by one, so the remainder is minus one.

That makes the fraction one, minus one over x squared plus one, and that second piece is exactly the hump we just flipped. Put it back over one denominator to check, and you land right where we started.

Now integrate the two pieces one at a time. The antiderivative of one is x. One over one plus x squared is the derivative of arctan x, which you met with the inverse trig derivatives, so that piece gives arctan x. Plug in one and zero, and since arctan of zero is zero, we’re left with one minus arctan of one.

The arctan of one is the angle whose tangent is one, forty-five degrees, or pi over four radians, so there’s our pi, one minus pi over four, about point two one five. That’s a sensible size, because this curve never rises above y equals x squared, whose area from zero to one is a third.

The hidden circle

The pi came from arctan, which is an angle, and that leaves a strange question, because why would an angle show up as an area? Maria Gaetana Agnesi included this curve in the calculus textbook she published in Milan in 1748. She called it the versiera, after a rope that turns a sail. An English translation turned that name into witch, which is why we still call this the Witch of Agnesi.

She drew the witch with a circle, and this brass machine works the same way. It has a ring one unit across sitting on the x-axis, a rail along its top at height one, and an arm that swings up from the bottom of the ring. The arm’s spot on the rail gives the pen its x, and the ring gives its height, so as the arm swings, the pen traces the witch exactly.

The rail sits exactly one unit above the pivot, so when the arm points at x, the tangent of its angle from straight up is x over one. That means the arm’s angle is arctan x.

Let’s swing the arm to forty-five degrees and fill the area as it goes. Look, the area and the angle read the same number, point seven eight five, pi over four. They have to match, because the area is arctan x, the antiderivative we just found, and the arm’s angle is arctan x too, straight from that triangle.

Now you take the handle. Turn the arm to the right until the gold area under the witch is exactly one. On the board that’s one line worth keeping, the integral from zero to x of one over one plus t squared is arctan x, so when you spot the witch, expect an angle.

Divide, then integrate

Let’s try x squared over x plus one, where we have more division to do. The numerator has the higher degree, so I’ll divide before I integrate. I’ll write the top as x squared plus zero x plus zero, so that every power gets a slot. x goes into x squared x times, x times x plus one is x squared plus x, and when I subtract that whole row, I’m left with minus x.

Bring down the zero. x goes into minus x negative one times, and negative one times x plus one is minus x minus one. Subtracting that leaves a remainder of one. That means x squared over x plus one is x minus one, plus one over x plus one.

Precalc students will recognize this picture, because the curve hugs the slant line y equals x minus one, and the gap is the leftover piece, one over x plus one. In precalc we let that sliver fade to see where the curve heads, but for an exact area you have to keep it, because even a thin sliver has area.

Now integrate piece by piece, x squared over two, minus x, plus the natural log of the absolute value of x plus one, plus C. The absolute value lets the answer work on both sides of minus one.

Differentiate to check, and you get back exactly what the division gave us. The move I see all the time is integrating the top and the bottom separately. It’s wrong, because integrals don’t have a quotient rule.

Let’s do one together, and precalc students, you’ve divided this exact fraction before. What goes in first? x goes into two x squared two x times, two x times x minus one is two x squared minus two x, and subtracting leaves five x minus one.

x goes into that five times and leaves a remainder of four, so the fraction is two x plus five, plus four over x minus one. Integrate each piece, and you get x squared plus five x, plus four natural log of the absolute value of x minus one, plus C.

Now one on your own, and this time it’s a definite integral. Find the integral from zero to two of x squared plus one, over x plus one, to three decimal places.

Complete the square

Here’s a different kind of disguise, the integral of one over x squared plus four x plus five. Division won’t help, because the top’s degree is already lower, and taking u to be the bottom won’t work either, because there’s no two x plus four on top. That bottom is a square in disguise, and the best way to see why is to build it.

Here it is in stone, a marble square x by x, a terracotta strip four by x, and five little tiles, each one by one. Split the strip down the middle into two strips, each two by x, and slide them against two sides of the big square. Now we’ve almost got a bigger square, except for one missing corner. That corner is two by two, so it needs four tiles, and we happen to have five.

Fill the corner with tiles and finish the square. Make the big square any size and the corner stays two by two, with one tile left over. On paper, half of four is two, two squared is four, and five is four plus one, so the bottom is x plus two, squared, plus one.

I’ll call x plus two u, so du equals dx and our integral becomes one over u squared plus one. That integrates to arctan u, and replacing u gives arctan of x plus two, plus C. From minus two to minus one, u runs from zero to one, so the answer is arctan one minus arctan zero, pi over four again. We got pi over four again because we moved the very same piece of the witch two units to the left.

The dashed ghost is one over x squared plus four x plus five, and when the witch slides two to the left, she lands right on it. Let’s change the five to an eight and see what happens. Completing the square still gives x plus two squared, but now four is left over. This one’s yours. Move and stretch the witch until she lands exactly on the ghost.

That half is about to show up in the answer. I want a square plus one inside the brackets, because that’s the witch and we know her integral, so I’ll factor four out of the entire denominator. Inside those brackets we have the square of x plus two over two, plus one. Squaring x plus two over two divides by four, and the four out front puts it right back.

Let u be x plus two over two, so du is half of dx, which makes dx two du. The four we factored out leaves a quarter, and a quarter times two is one half. That makes the answer one half arctan of x plus two over two, plus C, and there’s the half from the stretch. Forgetting that half is the easiest mistake here, and you can catch it, because the derivative of arctan of x plus two over two comes out twice as tall as our curve.

The general rule is worth keeping in your pocket, the integral of one over u squared plus a squared is one over a, times arctan of u over a, plus C. Here u is x plus two, and a squared is the number left over, four, so a is two. Let’s put that rule to work. Which one is the integral of one over x squared plus six x plus thirteen?

Unit 6: Integration and Accumulation of Change

  1. 6.1Exploring Accumulations of Change
  2. 6.2Approximating Areas with Riemann Sums
  3. 6.3Riemann Sums, Summation Notation, and Definite Integral Notation
  4. 6.4The Fundamental Theorem of Calculus and Accumulation Functions
  5. 6.5Interpreting the Behavior of Accumulation Functions Involving Area
  6. 6.6Applying Properties of Definite Integrals
  7. 6.7The Fundamental Theorem of Calculus and Definite Integrals
  8. 6.8Finding Antiderivatives and Indefinite Integrals: Basic Rules and Notation
  9. 6.9Integrating Using Substitution
  10. 6.10Integrating Functions Using Long Division and Completing the Square
  11. 6.11Integrating Using Integration by Parts
  12. 6.12Integrating Using Linear Partial Fractions
  13. 6.13Evaluating Improper Integrals
  14. 6.14Selecting Techniques for Antidifferentiation