| Study Guides
AP · Integration with long division and completing the square · 14 min read · Updated 2026-05-10

Integration with long division and completing the square — AP Calculus AB Study Guide

For: AP Calculus AB candidates sitting AP Calculus AB.

Covers: Polynomial long division for improper rational integrands, rewriting proper rational integrands via completing the square, integrating resulting forms with natural log or inverse tangent rules, and evaluating definite integrals of rational functions.

You should already know: Antiderivatives of 1/x, 1/(a²+x²), and basic polynomials. Polynomial long division of two polynomials. How to complete the square for a quadratic function.

A note on the practice questions: All worked questions in the "Practice Questions" section below are original problems written by us in the AP Calculus AB style for educational use. They are not reproductions of past College Board / Cambridge / IB papers and may differ in wording, numerical values, or context. Use them to practise the technique; cross-check with official mark schemes for grading conventions.


1. What Is Integration with long division and completing the square?

Integration with long division and completing the square are algebraic preprocessing techniques for integrating rational functions (ratios of two polynomials), which appear regularly on the AP Calculus AB exam. The AP Calculus AB Course and Exam Description (CED) places this topic in Unit 6: Integration and Accumulation of Change, where it accounts for roughly 1-2% of total exam score, appearing in both multiple-choice (MCQ) and free-response (FRQ) sections.

These methods do not introduce entirely new integration rules; instead, they rewrite messy rational functions that cannot be integrated as-written into a sum of simpler functions whose antiderivatives you already know. When the degree of the numerator is greater than or equal to the degree of the denominator (called an improper rational function), long division splits the function into a polynomial plus a smaller proper rational function. When the denominator is an irreducible quadratic (cannot be factored over the reals), completing the square rewrites the denominator to match the form for the inverse tangent antiderivative. This topic tests both integration fluency and algebraic accuracy, both core skills for the AP exam.

2. Integration of Improper Rational Functions via Polynomial Long Division

For a rational function , where is the numerator polynomial and is the denominator polynomial, is called improper if the degree of is greater than or equal to the degree of . You cannot integrate an improper rational function directly with basic rules, so we use polynomial long division to rewrite it as: where is the quotient polynomial, is the remainder polynomial, and the degree of is strictly less than the degree of . This makes a proper rational function, and both and can be integrated with basic antiderivative rules by linearity of integration.

This is identical to dividing integers: if you have , you rewrite it as to make it easier to work with, and we do the exact same thing for polynomials. The division identity holds for all x where , so the antiderivative of the left-hand side is equal to the sum of the antiderivatives of the right-hand side.

Worked Example

Problem: Evaluate the indefinite integral .

  1. Check degrees: The degree of the numerator is 3, and the degree of the denominator is 1. Since , the integrand is improper, so long division is required.
  2. Divide by :
    • , multiply , subtract from the dividend to get .
    • , multiply , subtract to get .
    • , multiply , subtract to get remainder .
    • Result: .
  3. Split the integral by linearity:
  4. Integrate term-by-term:

Exam tip: Always check the degrees of numerator and denominator before starting integration of a rational function. If you skip this step and try u-substitution on an improper rational function, you will waste time and get the wrong answer on exam day.

3. Rewriting Irreducible Quadratics via Completing the Square

When you have a proper rational function with a quadratic denominator of the form , first check if it can be factored over the reals by calculating the discriminant: . If the discriminant is negative, the quadratic is irreducible (cannot be factored into linear real terms), so we use completing the square to rewrite it in the form , which matches the standard form for the inverse tangent antiderivative:

To complete the square for :

  1. Factor out of the first two terms:
  2. Add and subtract inside the parentheses:
  3. Simplify the constant term: , where and

If the numerator is linear, you can split it into a multiple of the derivative of the denominator (which gives a log term) plus a constant (which gives an arctan term), resulting in a full antiderivative.

Worked Example

Problem: Evaluate the indefinite integral .

  1. Check the discriminant of the denominator: , so the quadratic is irreducible, complete the square.
  2. Complete the square: .
  3. Rewrite the numerator to split the integral: The derivative of the denominator is , so rewrite . Split the integral:
  4. Integrate the first term: Let , so , or . The first integral becomes (the quadratic is always positive, so we can drop the absolute value).
  5. Integrate the second term: Let , , so .
  6. Combine terms: , where .

Exam tip: AP Calculus AB will only test completing the square for irreducible quadratics (partial fractions for factorable quadratics is BC-only content). If your discriminant is negative, you know you are in the right place with this technique.

4. Evaluating Definite Integrals with These Techniques

Most AP exam questions on this topic ask for a definite integral (rather than just an indefinite antiderivative), so the process combines the algebraic preprocessing above with the Fundamental Theorem of Calculus, Part 2 (FTC 2): , where is any antiderivative of .

The steps are identical to indefinite integration up to the final step: after finding , evaluate it at the upper bound and lower bound, then subtract. Common simplifications include , which often appears when integrating from 0 to a positive bound, and arctan(0) = 0, which also simplifies final answers. Always confirm that the integrand is continuous over the entire interval of integration (for AP problems, this will always be true, but you should check that the denominator is never zero on ).

Worked Example

Problem: Evaluate the definite integral .

  1. Check degrees: numerator degree 2 > denominator degree 1, so use long division.
  2. Divide by : result is .
  3. Find the antiderivative: (we can ignore the constant C for definite integrals).
  4. Apply FTC 2: .

Exam tip: Simplify known values like and arctan(1) immediately to avoid carrying unnecessary terms through your calculation, which reduces the chance of arithmetic error.

5. Common Pitfalls (and how to avoid them)

  • Wrong move: Forgetting to check the degree of numerator and denominator, and trying to do u-substitution directly on . Why: Students rush into integration without checking the form, and assume all rational functions can be solved with u-substitution. Correct move: Always compare the degree of numerator and denominator first; if the top degree is ≥ bottom degree, do long division first.
  • Wrong move: When completing the square for , incorrectly writing it as instead of . Why: Students forget to multiply the subtracted constant by the leading coefficient when moving it outside the parentheses. Correct move: After completing the square inside the parentheses, multiply the subtracted constant by the leading coefficient before adding it to the trailing constant.
  • Wrong move: When integrating , splitting the integrand as instead of . Why: Students don't match the numerator to the derivative of the denominator, leading to an unsolvable integral. Correct move: Always rewrite the linear numerator as a multiple of the term from completing the square, plus a constant remainder.
  • Wrong move: Writing the antiderivative of as instead of . Why: Students mix up the derivative and integral rules for inverse tangent. Correct move: Always quickly differentiate your antiderivative to confirm: , which matches the integrand.
  • Wrong move: Reversing the bounds when applying FTC 2, calculating instead of . Why: Students rush on exam day and misremember the order of subtraction. Correct move: Always write "F(upper) minus F(lower)" explicitly on your paper before calculating.

6. Practice Questions (AP Calculus AB Style)

Question 1 (Multiple Choice)

Which of the following is the antiderivative of ? A) B) C) D)

Worked Solution: First, check degrees: numerator degree 2 > denominator degree 1, so we use polynomial long division. Dividing by gives a quotient of and a remainder of 7, so the integrand simplifies to . Integrating term-by-term gives . This matches option D. Correct answer:


Question 2 (Free Response)

Let . (a) Use polynomial long division to rewrite as the sum of a linear polynomial and a proper rational function. (b) Evaluate the indefinite integral . (c) Find the exact value of .

Worked Solution: (a) The degree of the numerator is 3, and the degree of the denominator is 2. Dividing gives: This is a linear term plus a proper rational function.

(b) Complete the square on the denominator: . Rewrite the numerator , then split the integral: $$ \begin{align*} \int f(x) dx &= \int x dx - \int \frac{(x-1) + 1}{(x-1)^2 + 1} dx \ &= \frac{x^2}{2} - \left(\frac{1}{2}\ln\left((x-1)^2 + 1\right) + \arctan(x-1)\right) + C \ &= \frac{x^2}{2} - \frac{1}{2}\ln(x^2 - 2x + 2) - \arctan(x-1) + C \end{align*} $$

(c) Apply FTC 2, evaluating at and :

Exact value:


Question 3 (Application / Real-World Style)

The marginal profit of producing thousand units of a new wearable device is given by , where is measured in thousands of dollars per thousand units. The total profit of producing 0 units is (fixed production costs). Find the total profit from producing 3 thousand units, rounded to the nearest dollar.

Worked Solution: By the Fundamental Theorem of Calculus, total profit is , with thousand dollars. Use long division to rewrite the integrand: . The antiderivative is . Evaluate from 0 to 3: Add the fixed cost: thousand dollars, or .

Interpretation: After accounting for fixed production costs, producing 3 thousand units of the device generates a total profit of approximately .

7. Quick Reference Cheatsheet

Category Formula Notes
Improper Rational Division Use when ; = quotient, = remainder
Integral of 1/u $\int \frac{1}{u} du = \ln u
Completing the Square Use for irreducible quadratics with negative discriminant
Inverse Tangent Integral Use after completing the square for irreducible denominators
Split Linear Numerator Rewrite to split into a log term and an arctan term
FTC for Definite Integrals is any antiderivative of ; always subtract lower bound from upper bound
Drop Absolute Value for Quadratics $\ln ax^2 + bx + c

8. What's Next

This topic is a critical prerequisite for working with all rational function integrals in AP Calculus AB, and it builds the algebraic fluency required for all subsequent integration topics. Immediately after this topic, you will apply these same algebraic preprocessing skills to solve differential equations, compute areas between curves, and find volumes of solids of revolution, all of which are heavily weighted on the AP exam. Mastery of long division and completing the square for integration ensures that you can correctly rewrite any unintegrable-as-written rational function into a sum of basic functions whose antiderivatives you already know. Without solid skills in these steps, you will be unable to solve accumulation, area, or differential equation problems involving rational functions, which appear regularly on both MCQ and FRQ sections.

Follow-on topics: u-substitution for indefinite integrals, the fundamental theorem of calculus, slope fields and differential equations, area between two curves

← Back to topic

Stuck on a specific question?
Snap a photo or paste your problem — Ollie (our AI tutor) walks through it step-by-step with diagrams.
Try Ollie free →