We need
#cos^2x=1-sin^2x#
Therefore,
#int(tanxdx)/(1-sinx)=int(sinxdx)/(cosx(1-sinx))#
#=int(sinxcosxdx)/(cos^2x(1-sinx))#
#=int(sinxcosxdx)/((1-sin^2x)(1-sinx))#
#=int(sinxcosxdx)/((1+sinx)(1-sinx)^2)#
Perform the substitution
#u=sinx#, #=>#, #du=cosxdx#
Therefore,
#int(tanxdx)/(1-sinx)=int(udu)/((1+u)(1-u)^2)#
Perform the decomposition into partial fractions
#u/((1+u)(1-u)^2)=A/(1+u)+B/(1-u)^2+C/(1-u)#
#=(A(1-u)^2+B(1+u)+C(1+u)(1-u))/(((1+u)(1-u)^2))#
The denominators are the same, compare the numerators
#u=A(1-u)^2+B(1+u)+C(1+u)(1-u)#
Let #u=-1#, #=>#, #-1=4A#, #=>#, #A=-1/4#
Let #u=1#, #=>#, #1=2B#, #=>#, #B=1/2#
Coefficients of #u^2#
#0=A-C#, #=>#, #C=A=-1/4#
Therefore,
#u/((1+u)(1-u)^2)=(-1/4)/(1+u)+(1/2)/(1-u)^2+(-1/4)/(1-u)#
So,
#int(tanxdx)/(1-sinx)=int(-1/4du)/(1+u)+int(1/2du)/(1-u)^2+int(-1/4du)/(1-u)#
#=-1/4ln(1+u)-1/2*1/(1-u)+1/4ln(1-u)#
#=-1/4ln(1+sinx)-1/(2(1-sinx))+1/4ln(1-sinx)+C#