Trig sub in quadratic - completing the square

Compute the integral:

∫dxx2−6x+11

Solution

(1) Complete the square to obtain Pythagorean form:

x2−6x+(−62)2≫≫x2−6x+9=(x−3)2

Add and subtract to get desired constant term:

x2−6x+11≫≫x2−6x+9−9+11≫≫(x−3)2+2

(2) Perform shift substitution:

Set u=x−3 as inside the square:

(x−3)2+2=u2+2

Infer du=dx. Plug into integrand:

∫dxx2−6x+11≫≫∫duu2+2

(3) Trig sub with tan⁡θ:

center

Use substitution u=2tan⁡θ. (From triangle or memorized tip.)

Infer du=2sec2⁡θdθ. Plug in data:

∫duu2+2≫≫∫sec2⁡θsec⁡θdθ=∫sec⁡θdθ

(4) Integrate using ad hoc memorized formula:

∫sec⁡θdθ≫≫ln⁡|tan⁡θ+sec⁡θ|+C

(5) Convert trig back to x:

First in terms of u, referring to the triangle:

tan⁡θ=u2,sec⁡θ=u2+22

Then in terms of x using u=x−3. Plug everything in:

ln⁡|tan⁡θ+sec⁡θ|+C≫≫ln⁡|x−32+(x−3)2+22|+C

(6) Simplify using log rules:

ln⁡f(x)a≫≫ln⁡f(x)−ln⁡a

The common denominator 12 can be pulled outside as −ln⁡2.

The new term −ln⁡2 can be “absorbed into the constant” (redefine C).

So we write our final answer thus:

ln⁡|x−3+(x−3)2+2|+C