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 Integration By Completing the Square — rewriting the quadratic inside the square root to use standard trigonometric substitution forms.
First, complete the square:
x2+4x−5=(x+2)2−9
So the integral becomes ∫(x+2)2−9dx.
Let u=x+2, then du=dx, and we have ∫u2−9du. This matches the standard form ∫u2−a2du with a=3.
The integral ∫x2+4x−5dx is solved by completing the square to get (x+2)2−9, then using the standard trigonometric substitution x+2=3secθ. The final result is 2x+2x2+4x−5−29logx+2+x2+4x−5+C.
Why Completing the Square Works
When you see a quadratic inside a square root, your first instinct might be to try a u-substitution. But x2+4x−5 isn't a perfect square — it has a linear term that blocks a clean substitution. Completing the square rewrites it as (x+2)2−9, which is a difference of squares. That form screams for a trigonometric substitution, because expressions like u2−a2 are tailor-made for secant or hyperbolic cosine substitutions.
The core idea: turn the messy quadratic into a recognizable Pythagorean form, then let trigonometry handle the rest.
Step-by-Step Solution
1. Complete the square inside the radical.
Take x2+4x−5. Half of 4 is 2, square it to get 4. Add and subtract 4:
x2+4x−5=(x2+4x+4)−4−5=(x+2)2−9
So the integral becomes:
∫(x+2)2−9dx
Tip
Always check: (x+2)2−9=x2+4x+4−9=x2+4x−5 — correct. This step is just algebraic rearrangement, no calculus yet.
2. Choose a substitution that eliminates the square root.
We have u2−a2 with u=x+2 and a=3. The standard trick: set u=asecθ, because sec2θ−1=tan2θ.
Let x+2=3secθ. Then dx=3secθtanθdθ.
Now substitute:
(x+2)2−9=9sec2θ−9=9(sec2θ−1)=3tan2θ=3∣tanθ∣
For the indefinite integral, we assume the principal branch where θ∈[0,π/2)∪(π/2,π], so tanθ≥0 when secθ≥1 (which matches x+2≥3). We'll take tanθ≥0 and drop the absolute value, keeping in mind the domain.
Watch out
Forgetting the absolute value on tan2θ is a common mistake. In definite integrals, you must consider the sign of tanθ over the interval. For indefinite integrals, we typically work on a branch where the sign is positive.
3. Rewrite the integral in terms of θ.
∫(x+2)2−9dx=∫(3tanθ)⋅(3secθtanθdθ)=9∫secθtan2θdθ
4. Simplify tan2θ using the Pythagorean identity.
Recall tan2θ=sec2θ−1. So:
9∫secθ(sec2θ−1)dθ=9∫(sec3θ−secθ)dθ
Now we need two standard integrals: ∫sec3θdθ and ∫secθdθ.
Method: Complete the square, then use a standard formula
To integrate quadratic, rewrite the quadratic as (x+p)2±a2 or a2−(x+p)2 by completing the square, substitute t=x+p, and quote the matching standard integral.
Steps
Step 1: Complete the square on the quadratic under the root, so it becomes (x+p)2+k for some constant k.
Step 2: Substitute t=x+p (so dt=dx); the integral becomes ∫t2±a2dt or ∫a2−t2dt.