Single-Variable-Calculus · Unit 22 · Video 3 · Interactive Practice

Completing the Square for Trig Substitution

IKey Formulas

Square rootSubstituteThe root becomes
A2−x2\sqrt{A^2 - x^2}x=Asin⁡θx = A\sin\theta (or Acos⁡θA\cos\theta)Acos⁡θA\cos\theta (or Asin⁡θA\sin\theta)
A2+x2\sqrt{A^2 + x^2}x=Atan⁡θx = A\tan\thetaAsec⁡θA\sec\theta
x2−A2\sqrt{x^2 - A^2}x=Asec⁡θx = A\sec\thetaAtan⁡θA\tan\theta
x2+bx=(x+b2)2−b24x^2 + bx = \left(x + \tfrac{b}{2}\right)^2 - \tfrac{b^2}{4}Completing the squareRemoves the middle term

Key Insight: A square root of a quadratic with a middle term matches no row of the table until the square is completed; then u=x+b2u = x + \tfrac{b}{2} brings it to a row. For example, ∫dxx2+4x=ln⁡∣x+2+x2+4x∣+c~\displaystyle\int \frac{dx}{\sqrt{x^2 + 4x}} = \ln\left|x + 2 + \sqrt{x^2 + 4x}\right| + \tilde c.

IIVisualization 1 — Why It Is Called Completing the Square

A square of side xx plus two strips of area b2x\tfrac{b}{2}x is a square of side x+b2x + \tfrac{b}{2} missing one corner.

IIIVisualization 2 — From Any Quadratic to a Row of the Table

The sign of x2x^2 and the constant left after completing the square decide which row, and which substitution, applies.

IVVisualization 3 — One Formula for Both Pieces

With the absolute value, ln⁡∣x+2+x2+4x∣\ln\left|x + 2 + \sqrt{x^2 + 4x}\right| has slope 1/x2+4x1/\sqrt{x^2 + 4x} for x>0x > 0 and for x<−4x < -4.

VQuiz Questions

Problem 1 · Complete the Square

Write x2−6x+5x^2 - 6x + 5 in the form (x+h)2+k(x + h)^2 + k.

✅ Correct! (x−3)2=x2−6x+9(x - 3)^2 = x^2 - 6x + 9, which has 44 too many: x2−6x+5=(x−3)2−4x^2 - 6x + 5 = (x - 3)^2 - 4.
❌ Check the sign. (x+3)2=x2+6x+9(x + 3)^2 = x^2 + 6x + 9 has middle term +6x+6x; to get −6x-6x you need (x−3)2(x - 3)^2.
❌ Not quite. (x−3)2(x - 3)^2 already contains +9+9, so you must subtract it: (x−3)2−9+5(x - 3)^2 - 9 + 5.
❌ Not quite. The middle term of (x+h)2(x + h)^2 is 2hx2hx, so hh is half the coefficient: 2h=−62h = -6 gives h=−3h = -3.
❌ Not quite. Match the middle term with 2hx2hx, then fix the constant.
Show solution

(x+h)2=x2+2hx+h2(x + h)^2 = x^2 + 2hx + h^2. Matching 2hx=−6x2hx = -6x gives h=−3h = -3, and (x−3)2=x2−6x+9(x - 3)^2 = x^2 - 6x + 9. That has 99 where we need 55, so subtract 44:

x2−6x+5=(x−3)2−4.x^2 - 6x + 5 = (x - 3)^2 - 4.

Problem 2 · Which Substitution?

Given: ∫dxx2+2x+10\displaystyle\int \frac{dx}{\sqrt{x^2 + 2x + 10}} — find the trig substitution that removes the square root.

✅ Correct! x2+2x+10=(x+1)2+9x^2 + 2x + 10 = (x + 1)^2 + 9, the row A2+u2\sqrt{A^2 + u^2} with u=x+1u = x + 1 and A=3A = 3.
❌ Not quite. The constant is added: (x+1)2+9(x + 1)^2 + 9. The secant row is for u2−A2u^2 - A^2; a plus sign calls for the tangent, since 1+tan⁡2θ=sec⁡2θ1 + \tan^2\theta = \sec^2\theta.
❌ Close, but… 9=A29 = A^2, so A=3A = 3, not 99. With u=9tan⁡θu = 9\tan\theta, u2+9u^2 + 9 is not a multiple of sec⁡2θ\sec^2\theta.
❌ Not quite. x=3tan⁡θx = 3\tan\theta leaves the middle term 2x2x in place. Complete the square first and substitute for x+1x + 1.
❌ Not quite. Complete the square, then match the result to a row of the table.
Show solution

x2+2x+10=(x+1)2+9x^2 + 2x + 10 = (x + 1)^2 + 9. With u=x+1u = x + 1 the root is u2+32\sqrt{u^2 + 3^2}, the tangent row with A=3A = 3:

u=3tan⁡θ  ⇒  u2+9=9(tan⁡2θ+1)=9sec⁡2θ,u2+9=3sec⁡θ.u = 3\tan\theta \;\Rightarrow\; u^2 + 9 = 9(\tan^2\theta + 1) = 9\sec^2\theta,\qquad \sqrt{u^2 + 9} = 3\sec\theta.

Problem 3 · All the Way Back to xx

Find ∫dxx2−6x+13\displaystyle\int \frac{dx}{\sqrt{x^2 - 6x + 13}}.

✅ Correct! (x−3)2+4(x - 3)^2 + 4, then x−3=2tan⁡θx - 3 = 2\tan\theta leaves ∫sec⁡θ dθ\int\sec\theta\,d\theta, and the ln⁡2\ln 2 is absorbed into the constant.
❌ Not quite. The arcsine comes from A2−u2\sqrt{A^2 - u^2}. Here the constant is added, (x−3)2+4(x - 3)^2 + 4, so the tangent row applies.
❌ Check the sign. x2−6x+13=(x−3)2+4x^2 - 6x + 13 = (x - 3)^2 + 4, so u=x−3u = x - 3, and uu is what appears next to the square root.
❌ Not quite. dx=2sec⁡2θ dθdx = 2\sec^2\theta\,d\theta and u2+4=2sec⁡θ\sqrt{u^2 + 4} = 2\sec\theta: the twos cancel, leaving ∫sec⁡θ dθ\int \sec\theta\,d\theta with coefficient 11.
❌ Not quite. Complete the square, substitute u=x−3=2tan⁡θu = x - 3 = 2\tan\theta, integrate sec⁡θ\sec\theta, and undo both substitutions.
Show solution

Complete the square: x2−6x+13=(x−3)2+4x^2 - 6x + 13 = (x - 3)^2 + 4. Let u=x−3u = x - 3, du=dxdu = dx.

Trig substitution: u=2tan⁡θu = 2\tan\theta, du=2sec⁡2θ dθdu = 2\sec^2\theta\,d\theta, u2+4=2sec⁡θ\sqrt{u^2 + 4} = 2\sec\theta:

∫duu2+4=∫2sec⁡2θ dθ2sec⁡θ=∫sec⁡θ dθ=ln⁡∣sec⁡θ+tan⁡θ∣+c.\int \frac{du}{\sqrt{u^2 + 4}} = \int \frac{2\sec^2\theta\,d\theta}{2\sec\theta} = \int \sec\theta\,d\theta = \ln|\sec\theta + \tan\theta| + c.

Undo: tan⁡θ=u2\tan\theta = \dfrac{u}{2} and sec⁡θ=u2+42\sec\theta = \dfrac{\sqrt{u^2 + 4}}{2}, so the answer is ln⁡∣u+u2+42∣+c=ln⁡∣u+u2+4∣−ln⁡2+c\ln\left|\dfrac{u + \sqrt{u^2 + 4}}{2}\right| + c = \ln\left|u + \sqrt{u^2 + 4}\right| - \ln 2 + c. Absorb −ln⁡2-\ln 2 into the constant and put u=x−3u = x - 3:

∫dxx2−6x+13=ln⁡∣x−3+x2−6x+13∣+c~.\int \frac{dx}{\sqrt{x^2 - 6x + 13}} = \ln\left|x - 3 + \sqrt{x^2 - 6x + 13}\right| + \tilde c.

Problem 4 · A Negative x2x^2

Find ∫dx6x−x2\displaystyle\int \frac{dx}{\sqrt{6x - x^2}} on 0<x<60 < x < 6.

✅ Correct! 6x−x2=9−(x−3)26x - x^2 = 9 - (x - 3)^2; with x−3=3sin⁡θx - 3 = 3\sin\theta the integral is ∫dθ=θ\int d\theta = \theta.
❌ Check the sign. −(x−3)2=−x2+6x−9-(x - 3)^2 = -x^2 + 6x - 9 gives the +6x+6x; (x+3)2(x + 3)^2 would give −6x-6x.
❌ Close, but… A2=9A^2 = 9, so A=3A = 3 and sin⁡θ=x−33\sin\theta = \dfrac{x - 3}{3}.
❌ Not quite. Because x2x^2 enters with a minus sign, the completed square is 9−(x−3)29 - (x - 3)^2: the row A2−u2\sqrt{A^2 - u^2}, which uses the sine.
❌ Not quite. Write 6x−x2=9−(x−3)26x - x^2 = 9 - (x - 3)^2 and use the sine row.
Show solution

6x−x2=−(x2−6x)=−((x−3)2−9)=9−(x−3)26x - x^2 = -(x^2 - 6x) = -\big((x - 3)^2 - 9\big) = 9 - (x - 3)^2. Let u=x−3u = x - 3; then u=3sin⁡θu = 3\sin\theta with −π2<θ<π2-\tfrac{\pi}{2} < \theta < \tfrac{\pi}{2}, du=3cos⁡θ dθdu = 3\cos\theta\,d\theta and 9−u2=3cos⁡θ\sqrt{9 - u^2} = 3\cos\theta:

∫dx6x−x2=∫3cos⁡θ dθ3cos⁡θ=θ+c=arcsin⁡x−33+c.\int \frac{dx}{\sqrt{6x - x^2}} = \int \frac{3\cos\theta\,d\theta}{3\cos\theta} = \theta + c = \arcsin\frac{x - 3}{3} + c.

Check: ddxarcsin⁡x−33=1/31−(x−3)2/9=19−(x−3)2=16x−x2\dfrac{d}{dx}\arcsin\dfrac{x - 3}{3} = \dfrac{1/3}{\sqrt{1 - (x - 3)^2/9}} = \dfrac{1}{\sqrt{9 - (x - 3)^2}} = \dfrac{1}{\sqrt{6x - x^2}}.

Solved: 0 / 4