In general trigonometric substitutions are useful to solve the integrals of algebraic functions containing radicals in the form #sqrt(x^2+-a^2)# or #sqrt(a^2+-x^2)#. Consider the different cases:
A. Let #f(x)# be a rational function of #x# and #sqrt(x^2+a^2)#:
#int f(x)dx = int R(x, sqrt(x^2+a^2))dx#
Substitute: #x = atant#, #dx = asec^2tdt# with #t in (-pi/2,pi/2)# and use the trigonometric identity:
#1+tan^2t = sec^2t#
Considering that for #t in (-pi/2,pi/2)# the secant is positive:
#sqrt(x^2+a^2)= sqrt(a^2tan^2t+a^2)#
#sqrt(x^2+a^2)=asqrt(tan^2t+1) = asect#
Then:
#int f(x)dx = int R(atant, asect)sec^2t dt#
B. Let #f(x)# be a rational function of #x# and #sqrt(x^2-a^2)#:
#int f(x)dx = int R(x, sqrt(x^2-a^2))dx#
Restrict the function to #x in (a,+oo)# and substitute: #x = asect#, #dx = asect tantdt# with #t in (0,pi/2)# and use the trigonometric identity:
#sec^2t-1 = tan^2t#
Considering that for #t in (0,pi/2)# the tangent is positive:
#sqrt(x^2-a^2)= sqrt(a^2sec^2t-a^2)#
#sqrt(x^2-a^2)=asqrt(sec^2t-1) = atant#
Then:
#int f(x)dx = int R(asect, atant)sect tant dt#
Normally you can see by differentiation that the solution that is found is valid also for #x in (-oo, -a)#
C. Let #f(x)# be a rational function of #x# and #sqrt(a^2-x^2)#:
#int f(x)dx = int R(x, sqrt(a^2-x^2))dx#
Substitute: #x = a sint#, #dx = a cost # with #t in (-pi/2,pi/2)# and use the trigonometric identity:
#1-sin^2t = cos^2t#
Considering that for #t in (-pi/2,pi/2)# the cosine is positive:
#sqrt(a^2-x^2)= sqrt(a^2-a^2sin^2t)#
#sqrt(a^2-x^2)=a sqrt(1-sin^2t) = acost#
Then:
#int f(x)dx = int R(asint, acost)cost dt#