PrepGo

Integrating Functions Using Long Division and Completing the Square - AP Calculus AB 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

Not all functions can be integrated using basic rules like the power rule or a simple u-substitution. This topic addresses a specific class of integrands—rational functions—that require algebraic manipulation before integration is possible. When faced with a rational function where the degree of the numerator is greater than or equal to the degree of the denominator (an "improper" rational function), polynomial long division is used to rewrite the expression as a polynomial plus a proper rational function. Each part can then be integrated separately.

Alternatively, when the integrand's denominator is an irreducible quadratic (one that cannot be factored), the technique of completing the square is used. This algebraic process transforms the denominator into the form , which allows the integral to be evaluated using the inverse tangent (arctangent) integration rule. These methods are purely algebraic tools used to change the form of the integrand into one that fits our known integration formulas.

Key Formulas/Rules

The primary goal of these algebraic techniques is to rewrite a complex integral into a form that matches a known integration rule. The most important rule associated with this topic is the one for the inverse tangent function, which arises from completing the square.

  • Inverse Tangent Rule: This rule is used to integrate functions of the form .

    In a more general form using u-substitution, where is a function of :

Note that polynomial long division is a process, not a formula. It allows you to rewrite a rational function as:

where is the quotient (a polynomial) and is the remainder.

Understanding the Algebraic Rewrites

The key to this topic is knowing when to apply each algebraic technique. The decision is based entirely on the structure of the rational function you are trying to integrate.

  • When to Use Long Division: Use polynomial long division when the integrand is an improper rational function. This means the degree of the polynomial in the numerator is greater than or equal to the degree of the polynomial in the denominator. The goal of long division is to break the single, complicated fraction into the sum of a simple polynomial (the quotient) and a proper rational function (the remainder over the divisor). The polynomial part can be integrated with the power rule, and the remaining fraction is often integrable with a simple u-substitution (often leading to a natural logarithm).

  • When to Use Completing the Square: Use completing the square when the denominator of the rational function is an irreducible quadratic of the form . An irreducible quadratic is one that cannot be factored over the real numbers (its discriminant, , is negative). The goal of completing the square is to rewrite this quadratic expression in the form . This manipulation creates the structure in the denominator, which is the precise form needed to apply the inverse tangent integration rule.

Core Concepts & Rules

  • Certain rational functions must be rewritten using algebraic techniques before integration rules can be applied.

  • If the degree of the numerator is greater than or equal to the degree of the denominator, perform polynomial long division first.

  • The result of long division transforms the integral of a single rational function into the sum of integrals of a polynomial and a proper rational function.

  • If the denominator is an irreducible quadratic, the technique of completing the square is often required.

  • Completing the square is used to manipulate the denominator into the form , setting up the integral for the arctangent rule.

  • The integral of is , not a natural logarithm.

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

Problem: Evaluate

Step 1: Analyze the Integrand

The degree of the numerator is 3, and the degree of the denominator is 2. Since , this is an improper rational function, and we must use polynomial long division.

Step 2: Perform Long Division

We divide by .

2x ____________ x^2-2x-8 | 2x^3 - 4x^2 - 15x + 5 -(2x^3 - 4x^2 - 16x) _________________ 0 + 0 + x + 5

The quotient is and the remainder is .

Step 3: Rewrite the Integral

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

So, the integral becomes:

*Note: The remaining fraction can be integrated using partial fraction decomposition, a technique covered in AP Calculus BC. For an AB-level question, the remainder would typically be simpler, such as , or the problem would stop here. For the sake of a complete AB-accessible example, let's assume the problem was .

Long division gives: .

The integral is .

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

Problem: Evaluate

Step 1: Analyze the Integrand

The degree of the numerator (0) is less than the degree of the denominator (2), so long division is not needed. Let's check if the denominator is an irreducible quadratic. The discriminant is . Since the discriminant is negative, the quadratic is irreducible, and we should use completing the square.

Step 2: Complete the Square on the Denominator

Focus on the expression .

  1. Take half of the coefficient of the term: .

  2. Square it: .

  3. Add and subtract this value: .

  4. Factor the perfect square trinomial: .

Step 3: Rewrite the Integral

Substitute the new form of the denominator back into the integral.

Step 4: Use u-Substitution

The integral is now in the form .

Let . Then .

Let .

The integral becomes:

Step 5: Apply the Arctangent Rule

Using the formula :

Step 6: Substitute Back and State the Final Answer

Substitute back into the expression.

Using Your Calculator

The techniques of long division and completing the square are purely algebraic manipulations required to find an indefinite integral by hand. A graphing calculator cannot perform these symbolic steps for you. Therefore, this topic is tested on the no-calculator portion of the AP exam.

The calculator's primary role is to check your work for a definite integral.

How to Check Your Answer:

Suppose you were asked to evaluate and your by-hand work yielded the antiderivative .

  1. Calculate the exact value by hand:

  2. Use the calculator to find a decimal approximation of your answer:

    Enter (5/2)*tan⁻¹(3) - (5/2)*tan⁻¹(2) into your calculator (in radian mode) to get a value, approximately .

  3. Use the calculator's numerical integration feature to evaluate the original definite integral:

    On a TI-84 style calculator, use the fnInt command:

    The calculator will return a value, approximately .

Since the results match, you can be confident that your antiderivative is correct.

AP Exam Quick Hit

Common Question Types

  • Direct Indefinite Integral (Multiple Choice): You will be given a rational function that clearly requires one of these two methods and asked to find the antiderivative from a list of options.

    • Example: Evaluate . (Requires long division)
  • Finding a Particular Solution (Free Response): You may be given a differential equation of the form where is a rational function requiring one of these techniques. You would need to integrate as a step toward finding the particular solution that passes through a given initial condition.

    • Example: Find the solution to the differential equation with initial condition . (Requires completing the square)

Common Mistakes

  • Algebraic Errors: The most common mistakes are simple errors during the long division process (especially with sign changes when subtracting) or while completing the square (e.g., forgetting to balance the equation by subtracting the added term).

  • Forgetting + C: This is a universal mistake for all indefinite integrals. Always add the constant of integration.

  • Incorrect Arctan Formula: A frequent error is forgetting the coefficient in the arctan formula. Students often write instead of the correct .

  • Confusing Log and Arctan Rules: Seeing a fraction and automatically assuming the integral will be a natural logarithm. The integral of is , but the integral of is an arctangent. Check if the denominator is a linear term or an irreducible quadratic.

  • Failure to Use Long Division: Attempting a complex u-substitution on an improper rational function like instead of first performing the required long division.