Scribe logoScribeNotes & practice
Sign inStart free
  1. Notes
  2. ›AP Calculus AB
  3. ›6 Integration and Accumulation of Change
  4. ›6.10 Long division and completing the square

AP Calculus AB · Unit 6 · Integration and Accumulation of Change

6.10 Long division and completing the square

Simplify rational functions by long division or completing the square, then integrate the rewritten expressions.

  • 3 min read
  • 4 parts
  • 10 questions
  • Draft
Start a Quick 5 on this topic→Jump to the 10 questions
1/4Long division separates a rational function into simpler terms
  1. 1Long division separates a rational function into simpler terms
  2. 2Completing the square reveals a useful quadratic form
  3. 3Integrate each term after polynomial long division
  4. 4A completed square can lead to inverse tangent
  5. Check your recall
  6. Practice: 10 questions
1

Part 1 of 4: Long division separates a rational function into simpler terms

A rational function is a quotient of polynomials. Use polynomial long division when the numerator’s degree is at least the denominator’s degree. Divide the leading terms, multiply the result by the denominator, and subtract. Repeat until the remainder has a lower degree than the denominator. Write the result as a polynomial plus a fraction containing that remainder.

This rewrite is valid wherever the original denominator is nonzero. It often turns an unfamiliar integral into a polynomial integral and a simpler rational integral. Keep the denominator’s excluded values in mind, even if the rewritten expression looks simpler.

Common mistake

Do not discard a nonzero remainder. Divide it by the original denominator and include that fraction.

Key terms · tap one for its definition

rational function

A rational function is a quotient of two polynomials, defined where its denominator is nonzero.

polynomial long division

Polynomial long division writes a polynomial quotient as a polynomial plus a remainder over the original divisor.

Part 1 done

2

Part 2 of 4: Completing the square reveals a useful quadratic form

Use completing the square to rewrite a quadratic denominator around a squared binomial. For a monic quadratic, x2+bx+c=(x+b2)2+c−b24x^2+bx+c=(x+\frac b2)^2+c-\frac{b^2}{4}x2+bx+c=(x+2b​)2+c−4b2​. First halve the coefficient of xxx. Then square that value and adjust the constant term. If the leading coefficient is not one, factor it from the quadratic first.

A positive constant after the squared binomial gives a sum-of-squares form, (x−h)2+a2(x-h)^2+a^2(x−h)2+a2. This form makes the inverse tangent integral recognizable. A zero or negative constant calls for a different approach. Completing the square rewrites the denominator; it does not change the function’s values.

Key terms · tap one for its definition

completing the square

Completing the square rewrites a quadratic using a squared binomial and a constant.

sum-of-squares form

A sum-of-squares form has a squared variable expression plus a positive squared constant.

Part 2 done

Quick check

One question on the part you just read

Easy

Identify the polynomial quotient and remainder when x2+3x+5x^2+3x+5x2+3x+5 is divided by x+2x+2x+2.
Show answer and explanation

Answer: C · Worked explanation

Since (x+2)(x+1)=x2+3x+2(x+2)(x+1)=x^2+3x+2(x+2)(x+1)=x2+3x+2, subtracting this product from x2+3x+5x^2+3x+5x2+3x+5 leaves remainder 3. The tempting remainder 1 comes from an incorrect subtraction of the constant terms.
3

Part 3 of 4: Integrate each term after polynomial long division

After division, integrate the polynomial and remainder fraction separately. A linear remainder over a linear denominator may simplify to a constant. A constant over a linear denominator gives a logarithmic antiderivative. For a denominator of x+1x+1x+1, the integral of 1x+1\frac{1}{x+1}x+11​ is ln⁡∣x+1∣+C\ln|x+1|+Cln∣x+1∣+C.

Worked example

Divide before integrating

Find ∫x2+1x+1 dx\int\frac{x^2+1}{x+1}\,dx∫x+1x2+1​dx.
  1. 1
    Divide leading terms: x2÷x=xx^2\div x=xx2÷x=x. Subtract x(x+1)x(x+1)x(x+1) to get −x+1-x+1−x+1.
  2. 2
    Divide again: −x÷x=−1-x\div x=-1−x÷x=−1. Subtract −(x+1)-(x+1)−(x+1) to get remainder 2.
  3. 3
    Rewrite: x2+1x+1=x−1+2x+1\frac{x^2+1}{x+1}=x-1+\frac{2}{x+1}x+1x2+1​=x−1+x+12​, for x≠−1x\ne-1x=−1.
  4. 4
    Integrate each term: ∫(x−1+2x+1)dx=x22−x+2ln⁡∣x+1∣+C\int\left(x-1+\frac{2}{x+1}\right)dx=\frac{x^2}{2}-x+2\ln|x+1|+C∫(x−1+x+12​)dx=2x2​−x+2ln∣x+1∣+C.

Answer: x22−x+2ln⁡∣x+1∣+C\displaystyle\frac{x^2}{2}-x+2\ln|x+1|+C2x2​−x+2ln∣x+1∣+C, for x≠−1x\ne-1x=−1.

Exam tip

Use absolute value bars in ln⁡∣x+1∣\ln|x+1|ln∣x+1∣. The original function is defined on both sides of x=−1x=-1x=−1.

Key term

logarithmic antiderivative

For a nonzero constant aaa, an antiderivative of 1ax+b\frac{1}{ax+b}ax+b1​ is 1aln⁡∣ax+b∣\frac1a\ln|ax+b|a1​ln∣ax+b∣.

Part 3 done

4

Part 4 of 4: A completed square can lead to inverse tangent

The inverse tangent pattern is ∫duu2+a2=1aarctan⁡(ua)+C\int\frac{du}{u^2+a^2}=\frac1a\arctan\left(\frac ua\right)+C∫u2+a2du​=a1​arctan(au​)+C for a>0a>0a>0. Once the denominator is a sum of squares, check its scale and the numerator. An integral with dxdxdx may require a constant factor after rewriting the denominator. Differentiate the result to check that factor.

Worked example

Complete the square before integrating

Find ∫1x2+4x+8 dx\int\frac{1}{x^2+4x+8}\,dx∫x2+4x+81​dx.
  1. 1
    Complete the square: x2+4x+8=(x+2)2+4x^2+4x+8=(x+2)^2+4x2+4x+8=(x+2)2+4.
  2. 2
    Set u=x+2u=x+2u=x+2, so du=dxdu=dxdu=dx and 4=224=2^24=22.
  3. 3
    Apply the pattern: ∫duu2+22=12arctan⁡(u2)+C\int\frac{du}{u^2+2^2}=\frac12\arctan\left(\frac u2\right)+C∫u2+22du​=21​arctan(2u​)+C.
  4. 4
    Replace uuu: 12arctan⁡(x+22)+C\frac12\arctan\left(\frac{x+2}{2}\right)+C21​arctan(2x+2​)+C.

Answer: 12arctan⁡(x+22)+C\displaystyle\frac12\arctan\left(\frac{x+2}{2}\right)+C21​arctan(2x+2​)+C.

The denominator is always positive, so this antiderivative works for every real xxx. Differentiating it gives 1(x+2)2+4\frac{1}{(x+2)^2+4}(x+2)2+41​, matching the original integrand.

Key term

inverse tangent pattern

For a>0a>0a>0, an antiderivative of 1u2+a2\frac{1}{u^2+a^2}u2+a21​ with respect to uuu is 1aarctan⁡(u/a)\frac1a\arctan(u/a)a1​arctan(u/a).

Note read

Check your recall[12 marks]

5 written questions. Answer each one in your head or on paper, then open the mark scheme.

  1. 1.State[1 mark]

    State when polynomial long division is useful before integrating a rational function.

    Show mark schemeHide mark scheme

    Model answer

    Use it when the numerator’s degree is at least the denominator’s degree.

    • 1 mark for stating that the numerator’s degree is at least the denominator’s degree
  2. 2.Describe[2 marks]

    Describe how polynomial long division rewrites a rational function, including a nonzero remainder.

    Show mark schemeHide mark scheme

    Model answer

    It gives a polynomial quotient plus the remainder divided by the original denominator. The remainder has lower degree than the denominator.

    • 1 mark for writing the result as a polynomial quotient plus the remainder over the original denominator
    • 1 mark for stating that the remainder has lower degree than the denominator
  3. 3.Calculate[4 marks]

    Calculate ∫x2+1x+1 dx\int\frac{x^2+1}{x+1}\,dx∫x+1x2+1​dx using long division.

    Show mark schemeHide mark scheme

    Model answer

    Division gives x2+1x+1=x−1+2x+1\frac{x^2+1}{x+1}=x-1+\frac{2}{x+1}x+1x2+1​=x−1+x+12​. Therefore, the integral is x22−x+2ln⁡∣x+1∣+C\frac{x^2}{2}-x+2\ln|x+1|+C2x2​−x+2ln∣x+1∣+C, for x≠−1x\ne-1x=−1.

    • 1 mark for finding the polynomial quotient x−1x-1x−1
    • 1 mark for finding the remainder fraction 2x+1\frac{2}{x+1}x+12​
    • 1 mark for integrating the polynomial terms to obtain x22−x\frac{x^2}{2}-x2x2​−x
    • 1 mark for integrating the remainder fraction to obtain 2ln⁡∣x+1∣+C2\ln|x+1|+C2ln∣x+1∣+C
  4. 4.Show[2 marks]

    Show that x2+4x+8x^2+4x+8x2+4x+8 is a sum of squares.

    Show mark schemeHide mark scheme

    Model answer

    Since x2+4x+8=x2+4x+4+4x^2+4x+8=x^2+4x+4+4x2+4x+8=x2+4x+4+4, it equals (x+2)2+22(x+2)^2+2^2(x+2)2+22.

    • 1 mark for adding and subtracting the square-completion value 4, or showing an equivalent rearrangement
    • 1 mark for obtaining (x+2)2+22(x+2)^2+2^2(x+2)2+22
  5. 5.Calculate[3 marks]

    Calculate ∫1x2+4x+8 dx\int\frac{1}{x^2+4x+8}\,dx∫x2+4x+81​dx by completing the square.

    Show mark schemeHide mark scheme

    Model answer

    The denominator is (x+2)2+22(x+2)^2+2^2(x+2)2+22. Applying the inverse tangent pattern gives 12arctan⁡(x+22)+C\frac12\arctan\left(\frac{x+2}{2}\right)+C21​arctan(2x+2​)+C.

    • 1 mark for rewriting the denominator as (x+2)2+4(x+2)^2+4(x+2)2+4
    • 1 mark for recognizing the inverse tangent pattern with u=x+2u=x+2u=x+2 and a=2a=2a=2
    • 1 mark for giving 12arctan⁡(x+22)+C\frac12\arctan\left(\frac{x+2}{2}\right)+C21​arctan(2x+2​)+C

Practice this topic

10 quick-fire multiple-choice questions, easy to hard. Tap an answer to see if you're right and the worked explanation. (The written questions with mark schemes are under “Check your recall” above.)

0 right0 of 10 answered

Includes the quick check in the note above.

2.

Easy·State[1 mark]

State the completed-square form of x2−6x+13x^2-6x+13x2−6x+13.
Show answer and explanation

Answer: A · Worked explanation

Half of -6 is -3, whose square is 9, so x2−6x+13=(x−3)2+13−9=(x−3)2+4x^2-6x+13=(x-3)^2+13-9=(x-3)^2+4x2−6x+13=(x−3)2+13−9=(x−3)2+4. The tempting form (x−3)2+13(x-3)^2+13(x−3)2+13 adds the squared binomial without adjusting the constant.
3.

Easy·Identify[1 mark]

Identify an antiderivative of 1x−4\frac{1}{x-4}x−41​ on an interval that does not include x=4x=4x=4.
Show answer and explanation

Answer: C · Worked explanation

Differentiating ln⁡∣x−4∣\ln|x-4|ln∣x−4∣ gives 1/(x−4)1/(x-4)1/(x−4). The absolute value allows this form on intervals on either side of x=4x=4x=4.
4.

Easy·Identify[1 mark]

Which of the following rewrites 3x2+12x+213x^2+12x+213x2+12x+21 by completing the square?
Show answer and explanation

Answer: B · Worked explanation

Factor out 3 to get 3(x2+4x+7)3(x^2+4x+7)3(x2+4x+7). Completing the square gives x2+4x+7=(x+2)2+3x^2+4x+7=(x+2)^2+3x2+4x+7=(x+2)2+3. The tempting constant 7 leaves the original constant unchanged and therefore fails to account for the added square-completion value.
5.

Medium·Determine[2 marks]

Determine the integral ∫x2+2x+4x+1 dx\int\frac{x^2+2x+4}{x+1}\,dx∫x+1x2+2x+4​dx.
Show answer and explanation

Answer: B · Worked explanation

Long division gives x2+2x+4=(x+1)(x+1)+3x^2+2x+4=(x+1)(x+1)+3x2+2x+4=(x+1)(x+1)+3, so the integrand is x+1+3/(x+1)x+1+3/(x+1)x+1+3/(x+1). Integrating term by term gives x2/2+x+3ln⁡∣x+1∣+Cx^2/2+x+3\ln|x+1|+Cx2/2+x+3ln∣x+1∣+C. The tempting expression with 3(x+1)3(x+1)3(x+1) incorrectly integrates 3/(x+1)3/(x+1)3/(x+1) as though it were the constant 3.
6.

Medium·Calculate[2 marks]

Calculate ∫1x2−2x+5 dx\int\frac{1}{x^2-2x+5}\,dx∫x2−2x+51​dx.
Show answer and explanation

Answer: C · Worked explanation

Complete the square: x2−2x+5=(x−1)2+4x^2-2x+5=(x-1)^2+4x2−2x+5=(x−1)2+4. With u=x−1u=x-1u=x−1 and a=2a=2a=2, the inverse tangent pattern gives (1/2)arctan⁡(u/2)+C(1/2)\arctan(u/2)+C(1/2)arctan(u/2)+C. The tempting answer without the factor 1/21/21/2 differentiates to twice the required integrand.
7.

Medium·Determine[2 marks]

Determine ∫2x+5x2+5x+8 dx\int\frac{2x+5}{x^2+5x+8}\,dx∫x2+5x+82x+5​dx.
Show answer and explanation

Answer: B · Worked explanation

The denominator's derivative is 2x+52x+52x+5, exactly the numerator, so substitution of the denominator gives ln⁡∣x2+5x+8∣+C\ln|x^2+5x+8|+Cln∣x2+5x+8∣+C. The tempting half-log answer would be appropriate if the numerator were half the denominator's derivative.
8.

Medium·Calculate[2 marks]

Calculate ∫x3+1x2+1 dx\int\frac{x^3+1}{x^2+1}\,dx∫x2+1x3+1​dx.
Show answer and explanation

Answer: D · Worked explanation

Division gives x3+1x2+1=x+1−xx2+1\frac{x^3+1}{x^2+1}=x+\frac{1-x}{x^2+1}x2+1x3+1​=x+x2+11−x​. Integrating the three terms yields x22+arctan⁡x−12ln⁡(x2+1)+C\frac{x^2}{2}+\arctan x-\frac12\ln(x^2+1)+C2x2​+arctanx−21​ln(x2+1)+C.
9.

Medium·Determine[2 marks]

Determine ∫4(x−2)2+9 dx\int\frac{4}{(x-2)^2+9}\,dx∫(x−2)2+94​dx.
Show answer and explanation

Answer: D · Worked explanation

The inverse tangent pattern gives ∫4 du/(u2+32)=(4/3)arctan⁡(u/3)+C\int 4\,du/(u^2+3^2)=(4/3)\arctan(u/3)+C∫4du/(u2+32)=(4/3)arctan(u/3)+C, where u=x−2u=x-2u=x−2. The tempting factor 4/94/94/9 incorrectly divides by a2a^2a2 instead of by aaa.
10.

Hard·Determine[2 marks]

Determine ∫x2+4x+7x+2 dx\int\frac{x^2+4x+7}{x+2}\,dx∫x+2x2+4x+7​dx.
Show answer and explanation

Answer: A · Worked explanation

Division yields x2+4x+7=(x+2)(x+2)+3x^2+4x+7=(x+2)(x+2)+3x2+4x+7=(x+2)(x+2)+3, so the integrand becomes x+2+3/(x+2)x+2+3/(x+2)x+2+3/(x+2). Its integral is x2/2+2x+3ln⁡∣x+2∣+Cx^2/2+2x+3\ln|x+2|+Cx2/2+2x+3ln∣x+2∣+C. The tempting linear remainder term 3(x+2)3(x+2)3(x+2) confuses the remainder in the numerator with the fraction it forms.

Keep going

Next topic6.14 Choosing an antidifferentiation techniquePrevious topic6.9 Integration by substitution

More in Unit 6 · Integration and Accumulation of Change

  1. 6.3Summation and definite integral notationNotes · 10 questions
  2. 6.4FTC and accumulation functionsNotes · 10 questions
  3. 6.5Behaviour of accumulation functionsNotes · 10 questions
  4. 6.6Properties of definite integralsNotes · 10 questions
  5. 6.7FTC and definite integralsNotes · 10 questions
  6. 6.8Antiderivatives and indefinite integralsNotes · 10 questions
  7. 6.9Integration by substitutionNotes · 10 questions
  8. 6.10Long division and completing the squareNotes · 10 questions
  9. 6.14Choosing an antidifferentiation techniqueNotes · 10 questions

All AP Calculus AB topics →

Draft: written by Scribe and checked automatically, not yet by a subject reviewer.

Practice questions are original, written by Scribe and checked automatically for correctness.

Topic codes follow the official numbering. Not endorsed by College Board or any exam board.

On this page

0/4 read

  1. 1Long division separates a rational function into simpler terms
  2. 2Completing the square reveals a useful quadratic form
  3. 3Integrate each term after polynomial long division
  4. 4A completed square can lead to inverse tangent
  5. Check your recall
  6. Practice: 10 questions
All coursesScribeHow it worksPricingPrivacyTerms

Notes and questions are written by Scribe in our own words. Topic codes follow the official course numbering so you can find your place. Not produced or endorsed by the IB, College Board, AQA, OCR, Pearson Edexcel or any exam board.

© 2026 Scribe