Trig sub in quadratic - completing the square
Compute the integral:
Solution
(1) Complete the square to obtain Pythagorean form:
Add and subtract to get desired constant term:
(2) Perform shift substitution:
Set
Infer
(3) Trig sub with

Use substitution
Infer
(4) Integrate using ad hoc memorized formula:
(5) Convert trig back to
First in terms of
Then in terms of
(6) Simplify using log rules:
The common denominator
The new term
So we write our final answer thus: