PrepGo

Integrating Functions Using Long Division and Completing the Square - AP Calculus BC Study Guide

Written by AP Content Team, Verified for 2026 AP Exams, Last updated: May 2026

Learn with study guides reviewed by top AP teachers. This guide takes about 11 minutes to read.

The Core Idea: Integrating Functions Using Long Division and Completing the Square

Certain rational functions cannot be integrated directly using basic antiderivative rules. The core idea of this topic is to use specific algebraic techniques to rewrite the integrand into a form that is recognizable and can be integrated with established rules. This process does not change the value of the function but rather its form, making integration possible.

The two primary algebraic techniques for this purpose are long division and completing the square. Long division is applied to rational functions where the degree of the numerator is greater than or equal to the degree of the denominator. This process breaks the complex fraction into a simpler polynomial and a proper rational function. Completing the square is used when the integrand has a quadratic expression in the denominator. This technique rewrites the quadratic into a sum of squares, which strategically alters the integrand into the form required for the arctangent integration rule.

Key Algebraic Rewriting Techniques

The following are not new integration rules but are the algebraic prerequisites for rewriting integrands into integrable forms.

Long Division of Polynomials

For a rational function where the degree of the polynomial is greater than or equal to the degree of the polynomial , long division can be used to rewrite the function. The original function is equivalent to the sum of a quotient polynomial, , and a remainder fraction, , where the degree of is less than the degree of .

The integral is then transformed as follows:

The first integral, , is a simple polynomial integration. The second integral is often solvable using other basic rules.

Completing the Square

This technique is used to rewrite a quadratic expression of the form into the form . This is specifically used to manipulate the denominator of a rational function to match the form required for the arctangent integration rule.

The target integration rule is:

By completing the square, a denominator like can be rewritten as , which is . This allows for a direct application of the arctangent rule with and .

Understanding When to Use Each Technique

The choice of which algebraic technique to use is determined by the structure of the rational function being integrated.

Condition for Long Division

Long division is the appropriate technique when the integrand is a rational function, , and the following condition is met:

  • Degree of Numerator Degree of Denominator

If the degree of the numerator is greater than or equal to the degree of the denominator, the fraction is "improper." Long division is the method to simplify it into a polynomial and a "proper" fraction, which is typically easier to integrate.

Condition for Completing the Square

Completing the square is the appropriate technique when the integrand is a rational function and the denominator has the following characteristics:

  • The denominator is a quadratic expression ().

  • The quadratic is irreducible (it cannot be factored over the real numbers).

The goal of this technique is to transform the denominator into the form of a sum of two squares, , thereby setting up the integral for the arctangent rule.

Core Concepts & Rules

  • Algebra First: The techniques of long division and completing the square are purely algebraic manipulations performed on the integrand before integration begins.

  • Goal of Rewriting: The sole purpose of these techniques is to change the form of the integrand into an equivalent expression that can be integrated using known rules.

  • Long Division Condition: For a rational function, if the degree of the numerator is greater than or equal to the degree of the denominator, use long division to simplify the integrand.

  • Completing the Square Condition: For a rational function with a quadratic denominator, completing the square can be used to rewrite the denominator.

  • Arctangent Target: The specific goal of completing the square in this context is to create an integrand of the form , which allows the application of the arctangent integration rule.

Step-by-Step Example 1: Integrating Using Long Division

Problem: Find the indefinite integral .

Step 1: Identify the Need for Long Division

The integrand is a rational function. The degree of the numerator is 2, and the degree of the denominator is 1. Since , long division is the appropriate technique.

Step 2: Perform Polynomial Long Division

We divide by .

x + 2 _______ x+1 | x^2 + 3x + 5 -(x^2 + x) _______ 2x + 5 -(2x + 2) ______ 3

The quotient is and the remainder is .

Step 3: Rewrite the Integral

Using the result from the long division, we rewrite the original integrand:

Therefore, the integral becomes:

Step 4: Integrate the Rewritten Expression

We can now integrate term by term:

The final answer is .

Step-by-Step Example 2: Integrating Using Completing the Square

Problem: Find the indefinite integral .

Step 1: Identify the Need for Completing the Square

The integrand is a rational function with a quadratic denominator, . The discriminant is , which is negative, so the quadratic is irreducible. This indicates that completing the square is the appropriate technique to transform it into the arctangent form.

Step 2: Complete the Square in the Denominator

We focus on the denominator .

To complete the square for , we take half of the coefficient of , which is , and square it: . We add and subtract 9 to the expression:

Group the first three terms, which form a perfect square:

Step 3: Rewrite the Integral

Substitute the completed square form back into the integral:

Step 4: Apply the Arctangent Rule

The integral is now in the form .

Let . Then .

Let .

Applying the arctangent formula :

The final answer is .

Using Your Calculator

The techniques of long division and completing the square are analytical and algebraic. They must be performed by hand to find an indefinite integral, as a calculator's symbolic integration capabilities are not permitted on the exam for demonstrating these steps.

However, a graphing calculator is an excellent tool for checking your work on a definite integral.

  1. Find the Antiderivative Analytically: First, solve the integral by hand using the appropriate technique (long division or completing the square) to find the antiderivative, .

  2. Evaluate Using the FTC: If the problem is a definite integral from to , calculate by hand.

  3. Verify with Numerical Integration: Use your calculator's numerical integration function (e.g., fnInt on a TI-84 or on the home screen) to evaluate the original integral, .

  4. Compare Results: The value from your hand calculation in Step 2 should match the decimal approximation provided by your calculator in Step 3.

For example, to check , you would first find the antiderivative as shown in Example 2. Then you would calculate . Finally, you would input fnInt(1/(X^2-6X+13), X, 0, 2) into your calculator and compare the results.

AP Exam Quick Hit

Common Question Types

  • Indefinite Integral Requiring Long Division: You will be given a rational function where the degree of the numerator is greater than or equal to the degree of the denominator and asked to find the antiderivative.

    • Example: Find .
  • Indefinite Integral Requiring Completing the Square: You will be given a rational function with an irreducible quadratic in the denominator and asked to find the antiderivative, which will involve an arctangent function.

    • Example: Find .
  • Definite Integral Requiring an Algebraic Technique: You will be asked to evaluate a definite integral that requires one of these two techniques as the first step before applying the Fundamental Theorem of Calculus.

    • Example: Evaluate .

Common Mistakes

  • Incorrect Long Division Setup: When performing long division, forgetting to include placeholder terms with zero coefficients for missing powers of (e.g., writing as ).

  • Remainder Error: After performing long division to get and , incorrectly rewriting the integral as instead of the correct form .

  • Algebraic Errors in Completing the Square: Incorrectly calculating the value of or, more commonly, adding it to the expression but forgetting to subtract it elsewhere to maintain equivalence. For example, turning into instead of the correct .

  • Misidentifying 'a' in the Arctangent Rule: After rewriting the denominator as , students may use as the value for in the arctangent formula, when in fact . For example, in , using instead of the correct .

  • Forgetting the Coefficient: A very common error is to correctly find the part of the answer but to forget the coefficient that must be placed in front of it.