I have been taught that the indefinite integration of $$\int\frac{f'(x)}{f(x)}\,dx = \log |f(x)|$$
But this question was asked in AIEEE 2004:
$$\int\frac{dx}{\cos x - \sin x}$$
We may easily get that the answer is $$\text{My answer: }\frac{1}{\sqrt{2}}\log \left| \tan \left(\frac{\pi}{8}-\frac{x}{2}\right)\right| +c$$
But the options are
$$(i)\ \ \ \frac{1}{\sqrt{2}}\log \left| \tan \left(\frac{x}{2}-\frac{\pi}{8}\right)\right| +c$$ and $$(ii)\ \ \ \frac{1}{\sqrt{2}}\log \left| \tan \left(\frac{x}{2}+\frac{3\pi}{8}\right)\right| +c$$
and both are correct according to me. Am I missing something? What have I done wrong?
I am even not able to derive the second option from the first but you may differentiate both my answer and the last option to get the answer. You wont get the answer by differentiating the first option but theoretically the first option is the same as my answer.
EDIT More explanation
The differentiation of $$\frac{d}{dx}\left(\log\left|\tan \frac{x}{2}\right|\right) = \frac{1}{\sin x}$$
So option (i)'s differentiation is $$\frac{1}{\sin x - \cos x}$$
While my answer's and option (ii)'s differentiation is $$\frac{1}{\cos x - \sin x}$$
Your answer and option 1 both are equal and incorrect while only option 2 is correct. I think you have mistaken and assumed that log|tanx|= log|cotx| which is incorrect and the correct one is log|tanx|= -log|cotx|.