(1) Trig substitution. Notice x2+4, so we should make use of the identity tan2θ+1=sec2θ.

Pick x=2tanθ and thus dx=2sec2θdθ.

Then:

x2+44tan2θ+44(tan2θ+1)4sec2θ

Plug in:

dxx2+42sec2θ4sec2θdθsecθdθ

(We assume that secθ>0 for the relevant values of θ.)


(2) Perform integration.

Either recall from memory, or multiply above and below by secθ+tanθ, and obtain:

secθdθln|tanθ+secθ|+C

(3) To convert to x we need secθ given that tanθ=x/2.

Draw triangle expressing tanθ=x2:

center

Therefore secθ=x2+42. We already know tanθ=x2. Thus:

secθdθln|x2+x2+42|+C

(4) Simplify with log rules:

ln|x2+x2+42|+Cln12|x+x2+4|+Cln12+ln|x+x2+4|+Cln|x+x2+4|+C