Unit 6Long Division and Completing the Square
Concept 4.108Built for May 2027 AP Exam

Long Division and Completing the Square

Reviewed by ACEpath AP Math Editorial Team

Last Updated: September 2026

30-second summary

Two algebraic rewrites turn integrals that look untouchable into standard forms. Long division handles a rational function whose numerator has the same degree as the denominator or higher: divide first, and the integral splits into a polynomial plus a proper fraction you already know. Completing the square handles a quadratic denominator with no real roots: rewrite x2+bx+cx^{2} + bx + c as a perfect square plus a constant, and the integral becomes an arctangent. Neither rewrite is integration. Both are the step that makes integration possible, and both are where the exam hides the difficulty inside a multiple-choice item.

On the AP Exam

AP Calculus AB tests this skill through the representations and reasoning described below.

What you’ll see
Multiple-choice items such as ∫x2x+1 dx\int \frac{x^{2}}{x+1}\,dx or ∫1x2+4x+13 dx\int \frac{1}{x^{2}+4x+13}\,dx, offered without a hint about the method. The stem supplies an unfamiliar integrand and four familiar-looking answers.
What you’ll do
Compare the degrees of numerator and denominator. If the numerator is at least as high, divide. If the denominator is an irreducible quadratic, complete the square and reach for the arctangent.
Memory hook
Divide if top is heavy, square if bottom is irreducible. Degree comparison decides the first method, discriminant decides the second.
Use it on the exam
For MCQs: Differentiate the choices. A candidate that differentiates to the original rational function is correct, and the check is often faster than either rewrite. For FRQs: Rely on these rewrites only as an internal step, and show the rewritten form on the page. A reader who sees x2x+1=x−1+1x+1\frac{x^{2}}{x+1} = x - 1 + \frac{1}{x+1} can follow the rest; a reader who sees only the final answer cannot.

Concept Review

When the Top Is Too Heavy

Figure 1 — Polynomial long division peels off a polynomial part and leaves a proper remainder. The quotient and the remainder together are the rewritten integrand.

A rational function is called proper when the degree of the numerator is smaller than the degree of the denominator. Only proper fractions are ready to integrate in the standard forms. When the numerator's degree is greater or equal, divide first:

x2+4x+7x+2=x+2+3x+2\frac{x^{2} + 4x + 7}{x + 2} = x + 2 + \frac{3}{x + 2}

The division produces a polynomial, which integrates by the power rule, plus a proper remainder, which integrates to a logarithm when the denominator is linear. The remainder carries the original denominator, which is why the arithmetic has to be exact rather than approximate.

Degree comparisonShapeMethod
numerator degree < denominator degreeproperstandard forms apply directly
numerator degree = denominator degreeimproperdivide, get a constant plus a proper fraction
numerator degree > denominator degreeimproperdivide, possibly repeatedly
denominator is a linear powereitherdivide, then the logarithm
Polynomial long division peels off a polynomial part and leaves a proper remainder. The quotient and the remainder together are the rewritten integrand.

A Division Worth Practising

The routine is the same one used on integers, and writing it in full is faster than guessing the quotient. Take 2x3−3x2+4x−1\frac{2x^{3} - 3x^{2} + 4}{x - 1}. Divide 2x32x^{3} by xx to get 2x22x^{2}, multiply back, subtract, and continue with −x2-x^{2}:

2x3−3x2+4x−1=2x2−x−1+3x−1\frac{2x^{3} - 3x^{2} + 4}{x - 1} = 2x^{2} - x - 1 + \frac{3}{x - 1}

The check is multiplication: (x−1)(2x2−x−1)+3\left(x-1\right)\left(2x^{2} - x - 1\right) + 3 must return the original numerator. That check is one line and it catches every arithmetic slip in the process.

Completing the Square

When the denominator is quadratic with no real roots, the discriminant b2−4acb^{2} - 4ac is negative and the fraction cannot be split into linear factors. The rewrite is

x2+bx+c=(x+b2)2+(c−b24)x^{2} + bx + c = \left(x + \frac{b}{2}\right)^{2} + \left(c - \frac{b^{2}}{4}\right)

The bracketed constant is positive exactly when the quadratic has no real roots, so the result reads u2+a2u^{2} + a^{2} with u=x+b2u = x + \frac{b}{2}. That is the standard arctangent form:

∫duu2+a2=1aarctan⁡ua+C\int \frac{du}{u^{2} + a^{2}} = \frac{1}{a}\arctan\frac{u}{a} + C

For the denominator x2+4x+13x^{2} + 4x + 13 we get (x+2)2+9\left(x+2\right)^{2} + 9, so a=3a = 3 and the integral is 13arctan⁡x+23+C\frac{1}{3}\arctan\frac{x+2}{3} + C.

Recognising Which Rewrite Applies

IntegrandDegreesDiscriminantMethod
x2x+1\frac{x^{2}}{x+1}22 over 11not applicabledivide
x3+1x2+1\frac{x^{3}+1}{x^{2}+1}33 over 22negativedivide, then complete the square on the remainder
1x2+4x+13\frac{1}{x^{2}+4x+13}00 over 2216−52<016 - 52 < 0complete the square
xx2−9\frac{x}{x^{2}-9}11 over 2236>036 > 0complete the square is unnecessary; the denominator factors
5x2+1\frac{5}{x^{2}+1}00 over 22−4<0-4 < 0already in standard form

The third column is the fastest test available. A positive discriminant means the denominator factors and the method is partial fractions rather than arctangent, which is a distinction worth making before writing anything.

Neither Rewrite Is Integration

Both methods are algebra. They change the appearance of the integrand without changing its value, and the integral is computed afterwards from a table of standard forms. Students who treat them as integration techniques look for a rule to apply and find none; students who treat them as algebra look for a form to reach and find it quickly.

Common Misconception Check

  • Myth 1: “Long division is optional if the fraction looks simple.” Truth: x2x+1\frac{x^{2}}{x+1} is simple-looking and improper. Integrating it as a logarithm is wrong, and the error survives because the answer looks like a logarithm.
  • Myth 2: “Completing the square changes the value of the fraction.” Truth: It is an identity. Every step is reversible and the value is untouched.
  • Myth 3: “Any quadratic denominator gives an arctangent.” Truth: Only an irreducible one. A factorable denominator leads to logarithms through partial fractions.

Topic-Specific Study Method

Compare, Then Rewrite

Borrowed idea: Degrees first. That comparison chooses the method before you write anything. Then look at the discriminant of the denominator. A negative value means the quadratic will not factor, so complete the square. A positive value means it does factor, so arctangent is the wrong tool entirely. Neither rewrite is integration, and both are the algebra that makes integration possible.

Exam disguiseWhat you see on the pageWhat your brain must translateRequired execution
x2x+1\frac{x^{2}}{x+1}equal-looking powersnumerator degree exceeds denominatordivide, then integrate
1x2+4x+13\frac{1}{x^{2}+4x+13}an innocent quadraticdiscriminant negativecomplete the square, arctangent
xx2−9\frac{x}{x^{2}-9}a quadratic belowdiscriminant positivefactor, do not arctangent
2x3−3x2+4x−1\frac{2x^{3}-3x^{2}+4}{x-1}a cubic over a lineardivide twicequotient plus remainder
A choice that looks like a logarithmfour candidate antiderivativesdifferentiate eachpick the one that returns the integrand

① Compute the degree difference before writing anything. A difference of one or more means division, and no other method will work.

② Compute the discriminant before reaching for arctangent. A positive value means the denominator factors, and the arctangent form does not apply at all.

③ Multiply back after dividing. The check is one line, and it is the only reliable guard against a sign error inside the subtraction.


Training & Error Diagnosis

Core Archetype (Simplest Form): Find ∫x2x+1 dx\int \frac{x^{2}}{x+1}\,dx.

Standard Execution:

  1. Compare. Numerator degree 22, denominator degree 11, so divide.
  2. Divide. x2x+1=x−1+1x+1\frac{x^{2}}{x+1} = x - 1 + \frac{1}{x+1}.
  3. Integrate. ∫(x−1)dx=x22−x\int\left(x - 1\right)dx = \frac{x^{2}}{2} - x, and ∫dxx+1=ln⁡∣x+1∣\int\frac{dx}{x+1} = \ln\lvert x+1 \rvert.
  4. Answer. x22−x+ln⁡∣x+1∣+C\frac{x^{2}}{2} - x + \ln\lvert x+1 \rvert + C.
  5. Check. Differentiating returns x−1+1x+1x - 1 + \frac{1}{x+1}, which simplifies to x2x+1\frac{x^{2}}{x+1}.

Exam Variation (Context / Parameter Shift): Find ∫1x2+6x+25 dx\int \frac{1}{x^{2} + 6x + 25}\,dx.

Solution: The discriminant is 36−100=−6436 - 100 = -64, so the denominator does not factor. Complete the square: x2+6x+25=(x+3)2+16x^{2} + 6x + 25 = \left(x+3\right)^{2} + 16. With u=x+3u = x+3 and a=4a = 4, the integral is 14arctan⁡x+34+C\frac{1}{4}\arctan\frac{x+3}{4} + C. Differentiating gives 14⋅11+(x+34)2⋅14\frac{1}{4}\cdot\frac{1}{1 + \left(\frac{x+3}{4}\right)^{2}}\cdot\frac{1}{4}, which simplifies to 1(x+3)2+16\frac{1}{\left(x+3\right)^{2}+16}, and that is the original integrand.

Common Traps & Failure Signals:

  1. Improper fraction integrated directly (Signal: a logarithm where a polynomial term belongs): divide first.
  2. Square completed with the wrong sign (Signal: (x+3)2−16\left(x+3\right)^{2} - 16 for a denominator that never vanishes): the constant must keep the denominator positive.
  3. Arctangent applied to a factorable quadratic (Signal: an arctangent answer for a denominator with real roots): check the discriminant.

6D Cognitive Error Diagnosis (Where Your Thinking Broke):

  • Degrees Uncompared: Compare before you write.
  • Discriminant Skipped: You reached for arctangent because the denominator was quadratic, which is a shape match rather than a test, and a factorable quadratic produces logarithms instead, so the answer is structurally wrong rather than arithmetically wrong.
  • Division Unchecked: You divided, dropped a sign in the subtraction, and never multiplied back, so the remainder is wrong by a constant that no later step can detect.

Past 10-Year AP Exam Appearance

Testing Frequency
MCQ Only
No released free-response part since 2017 requires either rewrite; the two techniques appear in the multiple-choice section, where the answers are offered without a stated method
10-Year Total Count
0 of 9 Exams · 0 FRQ Parts
The nine free-response sets contain no rational integrand needing division or a quadratic needing completion of the square
FRQ Years Appeared
None in Released FRQs ---

Practice Examples

MCQ 1

Divide First

Find the indefinite integral ∫x2x+2 dx\int \frac{x^{2}}{x+2}\,dx and choose the correct family below.

MCQ 2

The Arctangent Form

∫1x2+9 dx=\int \frac{1}{x^{2}+9}\,dx =

MCQ 3

Recognise the Factorable Case

∫1x2−4 dx\int \frac{1}{x^{2}-4}\,dx is best evaluated by

FRQ 4

Two Rewrites, One Skill

(a) Rewrite x2+3x+5x+1\frac{x^{2}+3x+5}{x+1} in the form q(x)+rx+1q(x) + \frac{r}{x+1}, where qq is a polynomial and rr is a constant.

(b) Use part (a) to find ∫x2+3x+5x+1 dx\int \frac{x^{2}+3x+5}{x+1}\,dx.

(c) Find ∫1x2+2x+5 dx\int \frac{1}{x^{2}+2x+5}\,dx, showing the completed-square form before integrating.

Cheatsheet

Core Reference

RewriteResult
numerator degree ≥\ge denominatordividepolynomial plus proper remainder
irreducible quadraticx2+bx+c=(x+b2)2+kx^{2}+bx+c = \left(x+\frac{b}{2}\right)^{2} + karctangent form
factorable quadraticfactorpartial fractions, not arctangent
duu2+a2\frac{du}{u^{2}+a^{2}}standard form1aarctan⁡ua+C\frac{1}{a}\arctan\frac{u}{a} + C
any divisionmultiply back to checkreturns the original numerator

Sentences That Score

TOPIC REVIEW • NEXT STEP IN YOUR LEARNING LOOP

Ready to check your understanding?

Strengthen this topic with AP-style practice, or continue to next topic.