Concept understanding — Integration By Completing Square
Integration by Completing the Square
You can integrate x2+11 or x2−a21 on sight. But a quadratic denominator such as x2+4x+5 fits neither standard form directly. The fix is to rewrite the quadratic as a perfect square plus (or minus) a constant, turning it into a form you already know.
The move
For x2+bx+c, add and subtract (2b)2:
x2+bx+c=(x+2b)2+(c−4b2).
After substituting u=x+2b the integral collapses to ∫u2+k2du or ∫u2−k2du.
Case A — leads to inverse tangent
∫x2+4x+5dx.
Complete the square: x2+4x+5=(x+2)2+1. With u=x+2,
∫u2+1du=tan−1u+C=tan−1(x+2)+C.
Tip
∫u2+a2du=a1tan−1au+C is the workhorse when the constant left over is positive.
Case B — leads to a logarithm
∫x2−6x+5dx.
Here x2−6x+5=(x−3)2−4. With u=x−3 the denominator u2−4 factors, so use partial fractions:
The key idea is to rewrite the integrand in a form that matches the standard formula for ∫a2+x2dx, using completing the square (here, the square is already complete).
First, simplify the square root:
1+9x2=99+x2=31x2+9.
Now integrate:
∫1+9x2dx=31∫x2+9dx.
Use the standard formula ∫x2+a2dx=2xx2+a2+2a2sinh−1ax+C (or the equivalent logarithmic form). Here a=3, so: …
We integrate 1+9x2 by rewriting it as 31x2+9, then using the standard trigonometric substitution x=3tanθ. The final result is 6x1+9x2+23sinh−1(3x)+C, or equivalently 6x1+9x2+23logx+x2+9+C.
The expression 1+9x2 looks like it came straight from a right triangle. When you see 1+(something)2 under a square root, your mind should immediately go to one of two places: either a trigonometric substitution (like x=atanθ) or a hyperbolic substitution (like x=asinht). Both work; the choice is a matter of taste.
The key insight: the constant 1 and the fraction 9x2 are not in the simplest form for substitution. Factor out the 91 first.
Simplify the integrand algebraically
1+9x2=99+x2=3x2+9
So the integral becomes:
I=∫1+9x2dx=31∫x2+9dx
Now we have a clean x2+a2 form with a=3.
Choose the substitution
For x2+a2, the standard trigonometric substitution is x=atanθ. Why? Because 1+tan2θ=sec2θ, which turns the square root into something simple.
Let x=3tanθ. Then dx=3sec2θdθ.
Watch out
A common mistake: forgetting to also change dx when substituting. The dx is not dθ — you must multiply by the derivative.
Rewrite the integrand in θ
x2+9=9tan2θ+9=9(tan2θ+1)=3sec2θ=3∣secθ∣
For the principal range of θ=tan−1(x/3), we have θ∈(−π/2,π/2), where secθ>0. So we can drop the absolute value: x2+9=3secθ.
Therefore:
I=31∫(3secθ)⋅(3sec2θdθ)=31∫9sec3θdθ=3∫sec3θdθ
Integrate sec3θ
This is a classic integral. The trick: write sec3θ=secθ⋅sec2θ and integrate by parts.
Let u=secθ, dv=sec2θdθ. Then du=secθtanθdθ, v=tanθ.
∫sec3θdθ=secθtanθ−∫secθtan2θdθ
Now use tan2θ=sec2θ−1:
∫sec3θdθ=secθtanθ−∫secθ(sec2θ−1)dθ
=secθtanθ−∫sec3θdθ+∫secθdθ
Bring the ∫sec3θ term to the left:
2∫sec3θdθ=secθtanθ+∫secθdθ
And ∫secθdθ=log∣secθ+tanθ∣+C.
So:
∫sec3θdθ=21secθtanθ+21log∣secθ+tanθ∣+C
Tip
Memorise the result for ∫sec3θdθ — it appears often in integrals involving x2+a2.
Method: Factor out the constant, then use a standard t2+a2 formula
When the quadratic under the root has a fractional or non-unit coefficient, e.g. 1+9x2, pull the constant out of the root to expose a clean x2+a2 form.
Steps
Step 1: Combine into a single fraction under the root.