How do you find the integral of #int tan^n(x)# if n is an integer?

3 Answers
Sep 28, 2015

See the explanation section below.

Explanation:

For #n >= 3#, use Integration by substitution to decrease the exponent on #tanx#

#int tan^nx dx = int tan^(n-2) tan^2x dx#

# = int tan^(n-2) (sec^2x - 1) dx#

# = int tan^(n-2) sec^2x dx - int tan^(n-2) x dx#

The first integral is #int u^(n-2) du#, so we get

#int tan^nx dx = 1/(n+1) tan^(n-1) x - int tan^(n-2) x dx#

The second integral is of the same form as the first. So, repaet the process until you arrive at

(for #n# even): #int tan^2 x dx = int (sec^2x -1) dx = tanx - x +C#

or

(for #n# odd): #int tan x dx = int (sinx/cosx) dx = ln abs(secx) +C#.

Sep 28, 2015

The general formula is too difficult for elementary calculus classes.

Click for "Answer"

You have to determine these the hard way, sorry. I will do the first three.

#int tanxdx#

Multiply by #secx/secx#:

#= int (secxtanx)/secxdx#

Let:
#u = secx#
#du = secxtanxdx#

#=> int 1/udu#

#= ln|u|#

#= color(blue)(ln|secx| + C)#

Ironically, the second degree #tan# is easier to differentiate.

#int tan^2xdx#

Use trig identity and follow up:

#= int sec^2x - 1dx#

#= color(blue)(tanx - x + C)#

And the third:

#int tan^3xdx#

Split into familiar first and second-degree #tan# terms:

#= int tan^2x tanx dx#

Use trig identity:

#= int tanx(sec^2x - 1)dx#

#= inttanxsec^2x - tanxdx#

Split into familiar #u# and #du# pairs:

#= int secxtanx*secx - tanxdx#

Let:
#u = secx#
#du = secxtanxdx#

#=> int udu - inttanxdx#

Recall the first-degree #tan# solution and re-use it.

#= color(blue)(sec^2x/2 - ln|secx| + C)#

Hopefully that gave you the general techniques you can use to approach higher degree problems.

Sep 28, 2015

See the explanation.

Explanation:

Maybe this helps:

Let #n=2k+1#, then:

#int tan^nxdx= int tan^(2k+1)xdx=int (tan^2x)^k tanxdx=I#

#tan^2x=t => 2tanxsec^2xdx=dt => tanxdx=dt/(2(t+1))#

since: #sec^2x=tan^2x+1#

#I=1/2 int t^k/(t+1)dt#

Dividing polynomial #t^k# with #t+1# gives us following result:

#t^k:(t+1)=t^(k-1)-t^(k-2)+t^(k-3)-t^(k-4)+...#

and reminder

#1/(t+1)#

which sign depends on #k# (if #k# is even it's positive and vice versa)

Hence,

#t^k/(t+1)=sum_(i=1)^k (-1)^(i+1) t^(k-i) + (-1)^k 1/(t+1)#

#I=1/2 int (sum_(i=1)^k (-1)^(i+1) t^(k-i) + (-1)^k 1/(t+1)) dt#

#I=1/2 (sum_(i=1)^k (-1)^(i+1) int t^(k-i)dt+(-1)^k int dt/(t+1))#

#I=1/2 (sum_(i=1)^k (-1)^(i+1) t^(k-i+1)/(k-i+1) + (-1)^k ln(t+1))#

#I=1/2 (sum_(i=1)^k (-1)^(i+1) (tan^2x)^(k-i+1)/(k-i+1) + (-1)^k ln(tan^2x+1))#

#I=1/2 (sum_(i=1)^k (-1)^(i+1) (tan^2x)^(k-i+1)/(k-i+1) + (-1)^k lnsec^2x)#

When #n=2k#:

#int tan^nxdx= int tan^(2k)xdx = I#

#tanx=t => sec^2xdx=dt => dx=dt/(t^2+1)#

And hence:

#I=int t^(2k)/(t^2+1)dt#

#t^(2k)/(t^2+1)=sum_(i=1)^k (-1)^(i+1) t^(2(k-i)) + (-1)^k 1/(t^2+1)#

Hence,

#I=int ( sum_(i=1)^k (-1)^(i+1) t^(2(k-i)) + (-1)^k 1/(t^2+1) ) dt#

#I= sum_(i=1)^k (-1)^(i+1) int t^(2(k-i)) dt + (-1)^k int 1/(t^2+1) dt#

#I= sum_(i=1)^k (-1)^(i+1) t^(2(k-i)+1)/(2(k-i)+1) + (-1)^k arctant#

#I= sum_(i=1)^k (-1)^(i+1) (tanx)^(2(k-i)+1)/(2(k-i)+1) + (-1)^k arctan(tanx)#

#I= sum_(i=1)^k (-1)^(i+1) (tanx)^(2(k-i)+1)/(2(k-i)+1) + (-1)^k x#