I did not get cos(x)+sin(x)=1.
I just made the subs. That's all.
This problem is actually very easy. I don't think you're seeing it quite yet.
Let me start from the top.
\(\displaystyle \int\frac{1+tan(x)}{1-tan(x)}dx\)
Make the identity change \(\displaystyle tan(x)=\frac{sin(x)}{cos(x)}\)
\(\displaystyle \int\frac{1+\frac{sin(x)}{cos(x)}}{1-\frac{sin(x)}{cos(x)}}dx\)
Cross multiply the top and get \(\displaystyle 1+\frac{sin(x)}{cos(x)}=\frac{cos(x)+sin(x)}{cos(x)}\)
The bottom is then \(\displaystyle 1-\frac{sin(x)}{cos(x)}=\frac{cos(x)-sin(x)}{cos(x)}\)
So, we have:
\(\displaystyle \int\frac{\frac{cos(x)+sin(x)}{cos(x)}}{\frac{cos(x)-sin(x)}{cos(x)}}dx\)
\(\displaystyle \int\frac{cos(x)+sin(x)}{cos(x)}\cdot \frac{cos(x)}{cos(x)-sin(x)}dx\)
\(\displaystyle \int\frac{cos(x)+sin(x)}{cos(x)-sin(x)}dx\)
Now, make the sub \(\displaystyle u=cos(x)-sin(x), \;\ du=-(cos(x)+sin(x))dx\)
See?. The denominator is u and the numerator is the -du.
Your integral then becomes:
\(\displaystyle \int\frac{-du}{u}\) or \(\displaystyle -\int\frac{1}{u}du\)...however you want to write it.
Integrate:
\(\displaystyle -ln(u)+C\)
Resub:
\(\displaystyle -ln(cos(x)-sin(x))+C\)
That's it....
