# How do you find the integral of int 1/(1 + cot(x))?

##-1/2(ln(abs(sin(x)+cos(x)))-x)+C##

Another arrangement is to transcribe this using all tangents:

##I=int1/(1+cot(x))dx=inttan(x)/(tan(x)(1+cot(x)))=inttan(x)/(tan(x)+1)dx##

Now, past all we keep are tangents, we scarcity a ##sec^2(x)## in command to depute. We can enrich the share by ##sec^2(x)## in the numerator, but pointed it as ##tan^2(x)+1## in the denominator (they're similar through the Pythagorean convertibility).

##I=int(tan(x)sec^2(x))/((tan(x)+1)(tan^2(x)+1))dx##

Letting ##u=tan(x)## so that ##du=sec^2(x)dx##, we see that:

##I=intu/((u+1)(u^2+1))du##

Now, we keep to finish peculiar share decomposition:

##u/((u+1)(u^2+1))=A/(u+1)+(Bu+C)/(u^2+1)##

Multiplying through:

##u=A(u^2+1)+(Bu+C)(u+1)##

##u=Au^2+A+Bu^2+Bu+Cu+C##

Factor in three groups: those after a while ##u^2##, those after a while ##u##, and continuouss.

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

##color(purple)0u^2+color(red)1u+color(brown)0=u^2color(purple)((A+B))+ucolor(red)((B+C))+color(brown)((A+C))##

Comparing the two sides, we see that:

##{(A+B=0),(B+C=1),(A+C=0):}##

Subtracting the promote equation from the third, we see that ##A-B=-1##. Adding this to the original equation shows that ##2A=-1## and ##A=-1/2##. It then follows that:

##{(A=-1/2),(B=1/2),(C=1/2):}##

So:

##u/((u+1)(u^2+1))=1/2(1/(u+1))+1/2((u+1)/(u^2+1))##

Returning to the well now:

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

##I=-1/2int1/(u+1)du+1/2intu/(u^2+1)du+1/2int1/(u^2+1)du##

Modifying the promote well slightly:

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

Now all three wells can be integrated rather painlessly:

##I=-1/2ln(abs(u+1))+1/4ln(abs(u^2+1))+1/2arctan(u)##

##I=-1/2ln(abs(tan(x)+1))+1/4ln(tan^2(x)+1)+1/2arctan(tan(x))##

##color(blue)(I=-1/2ln(abs(tan(x)+1))+1/4ln(sec^2(x))+1/2x##

This is a subtle latest repartee, unintermittently the continuous of integration is external, but we can fiddle encircling a illiberal over to finish some fun simplification.

##I=-1/2ln(abs((sin(x)+cos(x))/cos(x)))+1/2(1/2ln(sec^2(x)))+1/2x##

Rather sneakily, import one of the ##1/2##s beyond the ##ln(sec^2(x))## in, effectively using the ##log(a^b)=blog(a)## government in counterexhibition. (Absolute prize bars get be external past we've sound charmed the clear root:)

##I=-1/2ln(abs((sin(x)+cos(x))/cos(x)))+1/2ln(abs(sec(x)))+1/2x##

Now we can import a ##-1## in as a ##-1## command to execute ##sec(x)## into ##cos(x)##:

##I=-1/2ln(abs((sin(x)+cos(x))/cos(x)))-1/2ln(abs(cos(x)))+1/2x##

Factor ##-1/2## and use the government that ##log(A)+log(B)=log(AB)##:

##I=-1/2(ln(abs((sin(x)+cos(x))/cos(x)))+ln(abs(cos(x)))-x)##

##color(green)(I=-1/2(ln(abs(sin(x)+cos(x)))-x)+C##