AP Calculus AB and BC · Unit 6 · Topic 6.10

    6.10 Integrating Functions Using Long Division and Completing the Square

    Reviewed by P V Satish, Senior Faculty of Science and Academic Consultant · PG Life Sciences, PGD Biotechnology · 20+ years teaching NEET and AP · Special interest in biotechnology, biochemistry and the basics of physics
    Updated

    In short

    Two algebra tricks unlock many rational integrands. If the numerator's degree is at least the denominator's, divide first to get a polynomial plus a simpler fraction. If the denominator is a quadratic with no matching xx on top, complete the square to reach an arctangent (or, under a root, an arcsine) form.

    What you need to know

    • Use polynomial long division to rewrite a rational integrand.
    • Complete the square in a quadratic denominator.
    • Integrate to logarithm, arctangent and arcsine forms.
    • Decide whether division, completing the square or substitution is needed.

    Divide first

    ∫xx+1 dx\int \frac{x}{x + 1}\,dx has equal degrees on top and bottom. Rewrite: xx+1=(x+1)−1x+1=1−1x+1\frac{x}{x + 1} = \frac{(x + 1) - 1}{x + 1} = 1 - \frac{1}{x + 1}. So the integral is x−ln⁡∣x+1∣+Cx - \ln|x + 1| + C.

    For ∫x2x+1 dx\int \frac{x^2}{x + 1}\,dx, divide: x2=(x+1)(x−1)+1x^2 = (x + 1)(x - 1) + 1, so x2x+1=x−1+1x+1\frac{x^2}{x + 1} = x - 1 + \frac{1}{x + 1}, and the integral is x22−x+ln⁡∣x+1∣+C\frac{x^2}{2} - x + \ln|x + 1| + C.

    Division can also produce an arctangent: x3+x+1x2+1=x+1x2+1\frac{x^3 + x + 1}{x^2 + 1} = x + \frac{1}{x^2 + 1}, so ∫x3+x+1x2+1 dx=x22+arctan⁡x+C\int \frac{x^3 + x + 1}{x^2 + 1}\,dx = \frac{x^2}{2} + \arctan x + C.

    Complete the square

    ∫duu2+a2=1aarctan⁡ua+C,∫dua2−u2=arcsin⁡ua+C\int \frac{du}{u^2 + a^2} = \frac{1}{a}\arctan\frac{u}{a} + C, \qquad \int \frac{du}{\sqrt{a^2 - u^2}} = \arcsin\frac{u}{a} + C

    ∫1x2+4x+5 dx\int \frac{1}{x^2 + 4x + 5}\,dx: since x2+4x+5=(x+2)2+1x^2 + 4x + 5 = (x + 2)^2 + 1, the integral is arctan⁡(x+2)+C\arctan(x + 2) + C. And x2+6x+13=(x+3)2+4x^2 + 6x + 13 = (x + 3)^2 + 4, so ∫1x2+6x+13 dx=12arctan⁡x+32+C\int \frac{1}{x^2 + 6x + 13}\,dx = \frac{1}{2}\arctan\frac{x + 3}{2} + C.

    Under a square root: 2x−x2=1−(x−1)22x - x^2 = 1 - (x - 1)^2, so ∫12x−x2 dx=arcsin⁡(x−1)+C\int \frac{1}{\sqrt{2x - x^2}}\,dx = \arcsin(x - 1) + C.

    Which tool?

    Before completing the square, check whether the numerator is (a multiple of) the derivative of the denominator. ∫2x+4x2+4x+5 dx\int \frac{2x + 4}{x^2 + 4x + 5}\,dx is a substitution, u=x2+4x+5u = x^2 + 4x + 5, giving ln⁡(x2+4x+5)+C\ln(x^2 + 4x + 5) + C, not an arctangent. A constant numerator points to completing the square; the denominator's derivative on top points to a logarithm.

    On the exam

    These techniques appear mostly in multiple-choice questions, where the answer choices often differ only by a logarithm versus an arctangent, or by a constant factor such as 12\frac{1}{2}. Spend a moment classifying the integrand, then check your choice by differentiating it. Partial fractions, which split denominators that factor, are a BC topic and are not needed here.

    A worked definite integral. ∫01xx+1 dx=[x−ln⁡∣x+1∣]01=(1−ln⁡2)−(0−ln⁡1)=1−ln⁡2≈0.307\int_0^1 \frac{x}{x + 1}\,dx = \left[x - \ln|x + 1|\right]_0^1 = (1 - \ln 2) - (0 - \ln 1) = 1 - \ln 2 \approx 0.307. The division step comes first, then the familiar logarithm rule, then the subtraction from the Fundamental Theorem.

    Completing the square, step by step. For x2+bx+cx^2 + bx + c, take half of bb, square it, and write 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). With x2+6x+13x^2 + 6x + 13: half of 6 is 3, 32=93^2 = 9, and 13−9=413 - 9 = 4, so the denominator is (x+3)2+4(x + 3)^2 + 4 and a=2a = 2. If the leftover constant were negative, the quadratic would factor instead, which would lead to partial fractions rather than an arctangent.

    With a little practice, these steps take seconds, and they turn integrals that look unfamiliar into ones you already know. Always finish by differentiating your answer to confirm that it is correct before moving on.

    Key terms

    Polynomial long division
    Rewriting a rational function as a polynomial plus a proper fraction.
    Completing the square
    Writing x² + bx + c as (x + b/2)² plus a constant.
    Arctangent form
    ∫duu2+a2=1aarctan⁡ua+C\int \frac{du}{u^2 + a^2} = \frac{1}{a}\arctan\frac{u}{a} + C.
    Proper fraction
    A rational function whose numerator has lower degree than its denominator.

    Common mistakes

    • Integrating an improper fraction without dividing.

      Divide first when the top's degree is at least the bottom's.

    • Forgetting the 1a\frac{1}{a} in the arctangent form.

      For u2+a2u^2 + a^2 the answer is 1aarctan⁡ua\frac{1}{a}\arctan\frac{u}{a}.

    • Using arctangent when the numerator is the derivative of the denominator.

      That case is a substitution giving a logarithm.

    How this topic is tested

    • Compare degrees first.
    • Look for the denominator's derivative in the numerator.
    • Differentiate answer choices to check them.

    Practice questions

    Original AP-style multiple-choice questions. Pick an answer to see the explanation.

    1. Question 1 · MP 1 · Implementing Mathematical Processes

      What is ∫xx+1 dx\int \frac{x}{x + 1}\,dx?

    2. Question 2 · MP 1 · Implementing Mathematical Processes

      What is ∫1x2+4x+5 dx\int \frac{1}{x^2 + 4x + 5}\,dx?

    3. Question 3 · MP 3 · Justification

      What is ∫2x+4x2+4x+5 dx\int \frac{2x + 4}{x^2 + 4x + 5}\,dx?

    4. Question 4 · MP 1 · Implementing Mathematical Processes

      What is ∫1x2+6x+13 dx\int \frac{1}{x^2 + 6x + 13}\,dx?

    5. Question 5 · MP 1 · Implementing Mathematical Processes

      What is ∫12x−x2 dx\int \frac{1}{\sqrt{2x - x^2}}\,dx?

    Free-response practice

    Write your answer first, then mark it against the scoring guide.

    Free response (no calculator) · 3 points

    Let I=∫x3+x+1x2+1 dxI = \int \frac{x^3 + x + 1}{x^2 + 1}\,dx.

    1. (a) Rewrite the integrand as a polynomial plus a proper fraction.
    2. (b) Find I.

    Connected topics

    Frequently asked questions

    Are partial fractions on AB?

    No, partial fractions are BC only.

    When does completing the square give arcsine?

    When the quadratic is under a square root and has the form a² − u².

    How do I complete the square quickly?

    Halve the x coefficient, square it, and adjust the constant.

    How this shows up on the exam42 multiple-choice and 6 free-response questions, with and without a calculator. See how the exam is laid out.

    Free Unit 6 cheat sheet

    Every topic in Unit 6: Integration and Accumulation of Change on a few printable pages: the core idea, key terms, the two traps students fall into and what the exam asks.

    We'll use your email to tell you when new AP Calculus AB practice material is ready. No spam, and we'll delete it if you ask.

    Full-length AP Calculus AB practice examsUnit 6 is one of 8 units on the exam. Two timed exams in the 2027 format (42 MCQ + 6 FRQ, with calculator and no-calculator parts), worked explanations, scoring guides and an estimated 1–5 score. $14.99 · try 5 questions free.

    Related lessons in other AP courses

    All topics in Unit 6: Integration and Accumulation of Change

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

    Other units in AP Calculus AB

    AP® is a trademark registered by College Board, which is not affiliated with, and does not endorse, this website.