How to integrate #int1/(sinx+tanx)dx#?

1 Answer

# int \ 1/(sinx + tanx) \ dx = 1/4 ln|(cosx-1)/(cosx+1)| -1/2 1/(cosx+1) +C #

Explanation:

Let:

# I = int \ 1/(sinx + tanx) \ dx #

Which we can write as follows:

# I = int \ 1/(sinx + sinx/cosx) \ dx #
# \ \ = int \ 1/((sinxcosx + sinx)/cosx) \ dx #
# \ \ = int \ cosx/(sinx(cosx + 1)) \ dx #
# \ \ = int \ (sinxcosx)/(sin^2x(1+cosx)) \ dx #
# \ \ = int \ (sinxcosx)/((1-cos^2x)(1+cosx)) \ dx #
# \ \ = int \ (sinxcosx)/((1-cosx)(1+cosx)(1+cosx)) \ dx #
# \ \ = int \ (sinxcosx)/((1-cosx)(1+cosx)^2) \ dx #

Now we can perform a trig substitution; Let

# u=cosx => (du)/dx=-sinx #

Substituting into our integral we get:

# I = int \ ((-1)(u))/((1-u)(u+1)^2) \ du #
# \ \ = int \ (u)/((u-1)(u+1)^2) \ du #

Which we can decompose into partial fraction; as:

# (u)/((u-1)(u+1)^2) -= A/(u-1) + B/(u+1)+C/(u+1)^2 #
# " " = (A(u+1)^2 + B(u-1)(u+1)+C(u-1))/((u-1)(u+1)^2) #

Leading to:

# u = A(u+1)^2 + B(u-1)(u+1)+C(u-1)#

Put #u=1 => 1=4A => A=1/4#
Put #u=-1 => -1=-2C=>C=1/2#

Comparing Coefficients:

# "Coeff"(u^2) => 0=A+B=>B=-1/4#

Hence the partial fraction decomposition gives us:

# I = int \ (1/4)/(u-1) - (1/4)/(u+1)+(1/2)/(u+1)^2 \ du #
# \ \ = 1/4 \ int \ 1/(u-1) \ du - 1/4 \ int 1/(u+1) \ du +1/2 \ int 1/(u+1)^2 \ du #
# \ \ = 1/4 ln|u-1| - 1/4 ln|u+1| +1/2 (-1)/(u+1) +C #
# \ \ = 1/4 ln|(u-1)/(u+1)| -1/2 1/(u+1) +C #

Restoring the substitution we get:

# I = 1/4 ln|(cosx-1)/(cosx+1)| -1/2 1/(cosx+1) +C #