Mastering Completing the Square Integration

How completing the square turns integrals like ∫1/(x² + 4x + 13) dx into arctan and arcsin forms, with worked examples and the standard patterns to spot.

Using Completing the Square to Integrate

An integral with a quadratic denominator, like ∫ dx/(x² + 4x + 13), blocks the standard arctan or arcsin formulas until you rewrite that quadratic. Completing the square integration solves this: it turns the quadratic into (x + p)² + q², which matches the form 1/(u² + a²) or 1/√(a² − u²). You then substitute u = x + p and apply the arctangent or arcsine rule directly. OpenStax Calculus Vol. 2 covers this in section 3.3 before trigonometric substitution. The rewrite adds (b/2)² and subtracts it, adjusting the constant, and takes under a minute with practice.

When to Complete the Square in an Integral

Complete the square when the integrand contains a quadratic that does not factor into real linear terms, especially in a denominator or inside a square root. The most common errors happen when a ≠ 1: factor out the leading coefficient a before adding (b/2)² inside the parentheses, or the constant term will be wrong. For an integral like ∫ dx/(3x² + 6x + 10), factor the 3 out first: 3(x² + 2x) + 10, then complete the square on x² + 2x. The vertex form a(x − h)² + k with h = −b/(2a) and k = c − b²/(4a) is the target. Use this technique when the discriminant b² − 4ac is negative, so the quadratic is irreducible over the reals.

Pattern 1: 1/(u² + a²) → Arctan Integral

The integral ∫ du/(u² + a²) equals (1/a) arctan(u/a) + C, a result listed in Appendix A of OpenStax Calculus Vol. 2. After completing the square, set u equal to the linear term (x + b/2) and a equal to the square root of the adjusted constant. For ∫ dx/(x² + 4x + 13), the result is (1/3) arctan((x + 2)/3) + C. The failure case: if 4c − b² is not positive, the constant factor becomes imaginary, and you need a different method or partial fractions with complex numbers. Check 4c − b² > 0 before applying the arctangent formula.

Pattern 2: 1/√(a² − u²) → Arcsin Integral

The integral ∫ du/√(a² − u²) equals arcsin(u/a) + C, also from the integral table. This pattern appears when the quadratic appears under a square root after completing the square and the coefficient of the squared term is negative. For ∫ dx/√(x² + 2x + 5), the result is arcsinh((x + 1)/2) + C (the hyperbolic arcsine form, since a² − u² requires a negative sign before u²). A common mistake: applying the arcsine formula to a form that should use arctan. Test whether the integrand has √(something) in the denominator and whether the squared term inside the root is negative. If it is negative, use arctan; if positive, use arctan or a hyperbolic substitution.

Worked Examples of Completing the Square Integration

Example 1: ∫ dx/(x² − 6x + 10)

Complete the square: x² − 6x + 10 = (x − 3)² + 1. The integral becomes ∫ dx/((x − 3)² + 1). Substitute u = x − 3, du = dx. Result: ∫ du/(u² + 1) = arctan(u) + C = arctan(x − 3) + C. OpenStax Vol. 2 section 3.3 confirms this.

Example 2: ∫ dx/√(x² + 6x + 10)

Complete the square: x² + 6x + 10 = (x + 3)² + 1. The integral is ∫ dx/√((x + 3)² + 1). This matches the form for arcsinh: the result arcsinh(x + 3) + C.

Example 3: ∫ dx/(x² + 2x + 2)

Complete the square: x² + 2x + 2 = (x + 1)² + 1. The integral equals ∫ du/(u² + 1) with u = x + 1, giving arctan(x + 1) + C.

Failure case: odd b coefficient

For x² + 3x + 2, the square is (x + 3/2)² − 1/4. The integral becomes ∫ dx/((x + 3/2)² − 1/4). Here 4c − b² = 4(2) − 9 = −1, which is negative. The arctan form does not apply directly; use partial fractions or a different substitution. This is the most common failure mode for students.

Linking to Trigonometric Substitution and Partial Fractions

Completing the square is the first step before trigonometric substitution, as section 3.3 of OpenStax shows. After rewriting the quadratic as a(x − h)² + k, substitute a trigonometric function: for √(a² − u²), use u = a sin θ; for √(a² + u²), use u = a tan θ. Partial fractions handle the case where the quadratic factors over the reals, when the discriminant is non-negative, but completing the square is faster for irreducible quadratics. If the denominator has repeated factors or higher-degree polynomials, combine completing the square with partial fraction decomposition.

Pattern Table for Quick Reference

Use this table to match the completed square form to the correct integral formula. The values come from the integral table in Appendix A of OpenStax Calculus Vol. 2.

Completed Square Form and Corresponding Integral
Denominator FormCompleted SquareSubstitutionResult
1/(x² + bx + c)(x + p)² + q²u = x + p, a = q(1/q) arctan(u/q) + C
1/√(x² + bx + c)(x + p)² + q²u = x + p, a = qarcsinh(u/q) + C
1/√(a² − (x + p)²)(x + p)² = a² − u²u = x + p, a constantarcsin(u/a) + C
1/((x + p)² − q²)(x + p)² − q²u = x + p, a = q(1/(2q)) ln|(u−q)/(u+q)| + C or arctanh

Who This Technique Suits and Who Should Skip It

This technique is for first-year calculus students who need to evaluate integrals with quadratic denominators, and for tutors who want a textbook-aligned reference. It suits students who have already learned the basic arctan and arcsin formulas and need to handle quadratics that do not fit those forms directly. Skip this section if you need a refresher on how to complete the square step by step; that is a separate topic. Also skip if your integral has a cubic denominator or uses partial fractions with linear factors only; those are different methods. The one thing that most often goes wrong: forgetting to factor out the leading coefficient when a ≠ 1, which shifts the vertex's y-coordinate and produces a wrong constant under the arctan.

Common Questions

How do I complete the square for an integral with an odd b coefficient?

Halve the odd b: for x² + 3x, b/2 = 3/2. Square it to get 9/4. Add and subtract 9/4 inside the parentheses. The fraction (3/2)² is exact; do not convert to a decimal. x² + 3x + 2 becomes (x + 3/2)² − 1/4.

What do I do when 4c − b² is negative after completing the square?

The arctan formula requires 4c − b² > 0. If it is negative, the quadratic factors over the reals. Use partial fractions: factor the quadratic into (x − r₁)(x − r₂) and decompose. This is a failure mode for the arctan approach.

Can I use completing the square for integrals with a linear numerator?

Yes. If the numerator is linear (e.g., (3x+5)/(x²+4x+13)), split the integral: write the numerator as a derivative of the denominator plus a constant. The derivative of x²+4x+13 is 2x+4; adjust coefficients. The arctan part handles the constant term after completing the square.

Why does OpenStax Vol. 2 use arcsinh instead of arctan for some integrals?

arcsinh appears when the completed square inside a square root has a positive constant: √(u² + a²) matches the form for hyperbolic substitution. Use the integral table in Appendix A to confirm which form applies.