I am high school student and found a question in NCERT Class 12 book.
The question is:
$$\int\frac{1}{1-\tan(x)}dx$$
After simplifying the question, I got:
$$\frac{1}{2}\left(\int\frac{\cos(x)+\sin(x)}{\cos(x)-\sin(x)}+1\right)dx$$
I then used substitution method.
$$\cos(x)-\sin(x)=t$$
$$dx=\frac{-1}{\cos(x)+\sin(x)}\cdot dt$$
After solving, I got
$$\frac{1}{2}(\cos(x)-\sin(x))-\frac{1}{2}(\ln(|\cos(x)-\sin(x|))+C$$
But the answer in the book is different:
$$\frac{x}{2}-\frac{1}{2}\ln(|\cos(x)-\sin(x)|+C$$
I think that the textbook answer is different because they integrated 1 with respect to x whereas I integrated 1 with respect to t. What's the right way to integrate?