Difficulty: Intermediate | Prerequisites: Trigonometric substitution (the three standard forms), completing the square from algebra.
Many integrals in Calculus 2 contain quadratic expressions that do not obviously match the three standard trig sub forms. When you see something like x² + 2x + 5 or 8 − 2x − x² under a radical (or in a denominator), it will not respond to trig sub as written. Completing the square rewrites the quadratic into a shifted perfect square plus or minus a constant, which then matches one of the three forms. This is the bridge between messy quadratics and the trig sub method you already know. Exam problems frequently test both skills together.
Complete the square to rewrite a general quadratic as (x + d)² ± e². Then substitute u = x + d to shift the variable, and apply standard trig sub to the resulting integral. The extra algebra at the start saves you from staring at an integral that looks impossible.
Completing the square
The algebraic process of rewriting x² + bx + c as (x + b/2)² + (c − b²/4). Think of it as forcing a quadratic into a form where a perfect square is visible, so that trig sub can recognise it.
Standard form (for trig sub)
One of the three radical patterns: √(u² + a²), √(a² − u²), or √(u² − a²). After completing the square, your job is to match one of these by identifying u and a.
Shift substitution
The intermediate step u = x + d that recentres the quadratic at zero after completing the square. In simple terms, you move the variable so the squared term has no linear part left.
For any quadratic x² + bx + c:
x² + bx + c = (x + b/2)² + (c − b²/4)
The sign of (c − b²/4) determines which trig sub form you will use:
Positive remainder → form √(u² + a²), use u = a tan(θ)
Negative remainder and the quadratic is under a radical with constant first → form √(a² − u²), use u = a sin(θ)
Negative remainder and the quadratic is under a radical with variable first → form √(u² − a²), use u = a sec(θ)
Rewrite the quadratic by completing the square
Identify u = x + b/2 and a² = |c − b²/4|
Match to one of the three standard trig sub forms
Apply trig sub as normal (substitute u, compute du, simplify the radical)
Integrate in θ
Back-substitute: first from θ to u, then from u to x
Complete the square: x² − 6x + 5 = (x − 3)² + 5 − 9 = (x − 3)² − 4
Now u = x − 3 and a² = 4, so the form is √(u² − 4)
This matches Form 3: substitute u = 2 sec(θ)
Complete the square: x² + 2x + 5 = (x + 1)² + 4
Let u = x + 1, so du = dx, and a² = 4
The integral becomes ∫ du / (u² + 4)
Apply trig sub: u = 2 tan(θ), du = 2 sec²(θ) dθ
The integrand simplifies: ∫ 2 sec²(θ) / (4 tan²(θ) + 4) dθ = ∫ 2 sec²(θ) / (4 sec²(θ)) dθ = ∫ (1/2) dθ
Result: (1/2)θ + C = (1/2) tan⁻¹(u/2) + C = (1/2) tan⁻¹((x + 1)/2) + C
x² + bx + c = (x + b/2)² + (c − b²/4)
For a negative leading coefficient: −x² + bx + c = −[(x − b/2)² − (c + b²/4)] which rearranges to −(x − b/2)² + (c + b²/4).
Complete the square: x² − 5x + 7 = (x − 5/2)² + 7 − 25/4 = (x − 5/2)² + 3/4
Let u = x − 5/2, a² = 3/4, so a = √3/2
This is Form 1: u = (√3/2) tan(θ)
After substitution and simplification: ∫ dθ · (2/√3) · sec²(θ) / sec(θ) = (2/√3) ∫ dθ · (no, let's redo)
The integral reduces to (2/√3) θ + C
Back-substitute: θ = tan⁻¹(u/a) = tan⁻¹(2(x − 5/2)/√3)
Final answer: (2/√3) tan⁻¹(2(x − 5/2)/√3) + C
Complete the square: x² + x − 2 = (x + 1/2)² − 9/4
Let u = x + 1/2, a² = 9/4, so a = 3/2
This is Form 3: u = (3/2) sec(θ), du = (3/2) sec(θ) tan(θ) dθ
The radical becomes (3/2) tan(θ)
The integral simplifies to ∫ sec(θ) dθ = ln|sec(θ) + tan(θ)| + C
Back-substitute: sec(θ) = 2u/3 = 2(x + 1/2)/3, tan(θ) = √(4u² − 9)/3 = √(4(x + 1/2)² − 9)/3
Final answer: ln|2(x + 1/2)/3 + √(4(x + 1/2)² − 9)/3| + C
Rewrite: −x² − 2x + 8 = −(x² + 2x − 8) = −[(x + 1)² − 9] = 9 − (x + 1)²
Let u = x + 1, a² = 9, so a = 3
This is Form 2: u = 3 sin(θ), du = 3 cos(θ) dθ
The radical becomes 3 cos(θ)
The integral simplifies to ∫ (1/3) sec(θ) dθ = (1/3) ln|sec(θ) + tan(θ)| + C
Back-substitute using: sin(θ) = u/3, sec(θ) = 3/√(9 − u²), tan(θ) = u/√(9 − u²)
Final answer: (1/3) ln|3/√(9 − (x+1)²) + (x+1)/√(9 − (x+1)²)| + C
Completing the square with trig sub appears in probability and statistics when evaluating Gaussian integrals and normalising probability distributions. In electrical engineering, these integrals arise when analysing RLC circuits with non-standard component values, where the characteristic equation produces a quadratic under a radical.
Students often forget to account for the shift when back-substituting. After completing the square with u = x + d, the final answer must be in terms of x, not u. Leaving u in the answer is a common point deduction.
Students sometimes complete the square incorrectly by mishandling the sign of b. Double-check by expanding your completed square to verify it matches the original quadratic.
Students occasionally apply trig sub before completing the square, trying to force x² + bx + c into a standard form directly. This does not work. The linear term must be eliminated first.
When the leading coefficient is negative (as in −x² − 2x + 8), students often lose track of signs. Factor out the negative first, then complete the square inside the brackets.
⚠️ Completing the square combined with trig sub is a favourite exam combination. Be prepared to handle both steps in a single problem.
⚠️ Watch for problems that disguise the quadratic: expressions like 8 − 2x − x² require rearranging before you can complete the square.
⚠️ The back-substitution at the end involves two layers (θ to u, then u to x). Show both steps clearly for full marks.
Fill in the blank: x² + 6x + 13 = (x + ___)² + ___.
Answer: (x + 3)² + 4.
True or False: After completing the square, you always get a form √(u² + a²).
Answer: False. You can get any of the three forms depending on the sign of the remainder.
Fill in the blank: For −x² − 4x + 5, factor out the negative to get −(x² + 4x − 5), then complete the square to get ___ .
Answer: −(x + 2)² + 9, i.e. 9 − (x + 2)².
True or False: When completing the square for trig sub, you can skip the shift substitution u = x + d and substitute directly.
Answer: False. The shift substitution is necessary to centre the variable before applying trig sub.
Q: Complete the square for x² − 8x + 20 and identify which trig sub form applies.
A: x² − 8x + 20 = (x − 4)² + 4. This is Form 1: √(u² + a²) with u = x − 4 and a = 2.
Q: Evaluate ∫ dx / (x² + 4x + 8).
A: Complete the square: (x + 2)² + 4. Let u = x + 2, then ∫ du/(u² + 4). Trig sub u = 2 tan(θ) gives (1/2) tan⁻¹((x + 2)/2) + C.
Q: Set up the trig substitution for ∫ dx / √(5 + 4x − x²). Do not evaluate.
A: Rewrite: −(x² − 4x − 5) = −[(x − 2)² − 9] = 9 − (x − 2)². Let u = x − 2, a = 3. Form 2: substitute u = 3 sin(θ), du = 3 cos(θ) dθ.
Q: After completing the square, you have ∫ du / √(u² − 16). What is the trig substitution and the simplified integrand?
A: Form 3 with a = 4. Substitute u = 4 sec(θ), du = 4 sec(θ) tan(θ) dθ. The radical becomes 4 tan(θ). The integrand simplifies to ∫ sec(θ) dθ.
Completing the square is a prerequisite for partial fraction decomposition when the denominator has irreducible quadratic factors. The same algebraic move appears in Laplace transforms (Calculus 3 or Differential Equations) when inverting transforms that contain quadratics in the s-domain.
This also links to the study of conic sections: completing the square is how you convert the general second-degree equation into standard form for ellipses, hyperbolas, and parabolas, and trig sub is the natural integration tool for arc length and area calculations on those curves.
Completing the square, trig sub with quadratics, quadratic under radical, shift substitution, u-substitution with trig sub, irreducible quadratic, standard form conversion, Calc 2 integration, M408L, UT Austin, integral calculus, inverse tangent integral, arcsin integral, arcsec integral, negative leading coefficient, factoring out negatives