Understanding Rational Function Integration

A rational function is the ratio of two polynomials, such as (3x² + 9x + 7)/(5x² + x + 3). Integrating these functions requires breaking them into simpler pieces that standard antiderivative formulas can handle.

The strategy depends on the degrees of numerator and denominator. If the numerator has a degree greater than or equal to the denominator, polynomial long division comes first. This reduces the problem to integrating a polynomial plus a proper fraction—one where the numerator degree is strictly less than the denominator.

For proper rational fractions, partial fraction decomposition is the conventional route. But when the denominator is quadratic or lacks real factors, completing the square offers a powerful alternative that avoids complex algebraic splitting.

The Completing the Square Method

For integrals of the form ∫ 1/(ax² + bx + c) dx, completing the square rewrites the quadratic into a perfect square plus a constant.

ax² + bx + c = a(x + b/(2a))² + (c − b²/(4a))

After substitution u = x + b/(2a), the integral becomes:

∫ 1/(a(u² + k)) du

where k = (c − b²/(4a))/a. For positive k, this integrates to:

(1/√(ak)) × arctan(√(a/k) × u) + C

  • a — Coefficient of x² term
  • b — Coefficient of x term
  • c — Constant term
  • k — Adjusted constant after completing the square

Step-by-Step Integration Process

Step 1: Check Numerator Degree
If the numerator's degree ≥ denominator's degree, use polynomial long division first to isolate the polynomial part. Integrate that separately using the power rule.

Step 2: Complete the Square in the Denominator
For ax² + bx + c, factor out a from the quadratic terms, then add and subtract (b/(2a))² inside the brackets. This produces the form a(x + b/(2a))² + remainder.

Step 3: Apply U-Substitution
Let u = x + b/(2a) and du = dx. The integral now involves only u and constants in the denominator.

Step 4: Recognize the Standard Form
Once simplified, you'll have ∫ 1/(u² + k) du, which is the arctangent integral if k > 0, or a logarithmic integral if k < 0.

Common Integration Pitfalls

Avoid these mistakes when completing the square for integration problems.

  1. Forgetting the coefficient a — When completing the square, always factor a out of the x² and x terms before splitting the square. Writing x² + bx + c directly without isolating a leads to incorrect constant terms and wrong antiderivatives. This error is especially common in expressions like 2x² + 8x + 5.
  2. Sign errors in the constant adjustment — After completing the square, the remaining constant is c − b²/(4a), not c + b²/(4a). Double-check the sign; a positive remainder yields arctangent, while a negative remainder (complex roots) introduces logarithmic or complex-valued antiderivatives.
  3. Mishandling higher powers in the denominator — When the denominator is (ax² + bx + c)ⁿ with n > 1, completing the square alone doesn't finish the job. You'll need reduction formulas or repeated integration by parts. Don't assume the arctangent formula applies directly for n > 1.

When Completing the Square Beats Partial Fractions

Partial fraction decomposition requires factoring the quadratic denominator, which demands finding real roots. If the discriminant b² − 4ac < 0, the quadratic has no real factors—so partial fractions forces you into complex coefficients and conjugate terms.

Completing the square bypasses factorization entirely. It converts an unfactorable quadratic into a sum u² + k directly, avoiding complex arithmetic. For denominators like x² + x + 1 or 3x² + 2x + 2, completing the square is often faster and cleaner.

This method also scales well to higher powers. The reduction formula for ∫ 1/(u² + k)ⁿ du is well-documented and efficient once the denominator is in completed-square form.

Frequently Asked Questions

What is the completing the square formula?

The completing the square formula transforms ax² + bx + c into a(x + b/(2a))² + (c − b²/(4a)). The key insight is adding and subtracting (b/(2a))² to create a perfect square trinomial. This rewrites any quadratic as the sum of a squared binomial and a constant, making it ideal for integration and solving equations.

Can you integrate using completing the square if the numerator is not 1?

Yes. If the numerator is a polynomial of lower degree (like 2x + 3), split the fraction into parts using partial fraction decomposition or rewrite the numerator as a linear combination of the denominator and its derivative. The derivative method is often faster: express the numerator as A(2ax + b) + B, then split the integral into two simpler ones. Completing the square handles the resulting arctangent term.

What happens if the discriminant is negative?

When b² − 4ac < 0, the quadratic has no real roots. After completing the square, c − b²/(4a) is negative, meaning you get a form like 1/(u² − k) with positive k. This integral evaluates to a logarithmic expression involving (u − √k)/(u + √k), not an arctangent. Alternatively, you can use complex arctangent if working in the complex domain.

How do I handle higher powers like 1/(ax² + bx + c)²?

Completing the square first to get 1/(a(u² + k))², then apply the reduction formula for ∫ 1/(u² + k)ⁿ du. For n = 2, the formula is (1/(2k)) × [u/(u² + k) + (1/√k) × arctan(u/√k)] + C. Reduction formulas derive new integrals recursively, so n = 3 and higher are progressively more involved but follow a pattern.

When should I use completing the square instead of partial fractions?

Use completing the square when the quadratic denominator has no real roots (negative discriminant) or when you want to avoid factoring. For rational functions with factorable denominators, partial fractions can be simpler. However, completing the square always works and often requires less algebra, making it a strong default strategy for quadratic denominators.

How does substitution work after completing the square?

After rewriting ax² + bx + c as a(x + b/(2a))² + (c − b²/(4a)), substitute u = x + b/(2a), so du = dx. The integral becomes ∫ 1/(a(u² + k)) du where k = (c − b²/(4a))/a. This eliminates the linear x term, leaving only u and constants—transforming a complex-looking integral into a recognizable arctangent or logarithmic standard form.

More math calculators (see all)