$$\int \cos 2\theta \ln\left(\dfrac{\cos \theta+\sin\theta}{\cos\theta-\sin\theta}\right)d\theta$$
My attempt is as follows:-
$$\ln\left(\dfrac{\cos \theta+\sin\theta}{\cos\theta-\sin\theta}\right)=t\tag{1}$$ $$\dfrac{\cos\theta-\sin\theta}{\cos\theta+\sin\theta}\cdot\dfrac{\left(\cos\theta-\sin\theta\right)^2-(-\sin\theta-\cos\theta)(\cos\theta+\sin\theta)}{(\cos\theta-\sin\theta)^2}=\dfrac{dt}{d\theta}$$
$$\dfrac{2}{\cos2\theta}=\dfrac{dt}{d\theta}$$
Let's calculate $\cos2\theta$ from equation $1$
$$\dfrac{\cos \theta+\sin\theta}{\cos\theta-\sin\theta}=e^t$$ $$\dfrac{1+\tan\theta}{1-\tan\theta}=e^t$$
Applying componendo and dividendo
$$\dfrac{2}{2\tan\theta}=\dfrac{e^t+1}{e^t-1}$$ $$\dfrac{e^t-1}{e^t+1}=\tan\theta$$
$$\cos2\theta=\dfrac{1-\tan^2\theta}{1+\tan^2\theta}$$ $$\cos2\theta=\dfrac{(e^t+1)^2-(e^t-1)^2}{(e^t+1)^2+(e^t-1)^2}$$ $$\cos2\theta=\dfrac{4e^t}{2(e^{2t}+1)}$$ $$\cos2\theta=\dfrac{2e^t}{e^{2t}+1}\tag{2}$$
So integral will be
$$\dfrac{1}{2}\cdot\int \left(\dfrac{2e^t}{e^{2t}+1}\right)^2dt$$ $$\dfrac{1}{2}\cdot\int \dfrac{4e^{2t}}{(1+e^{2t})^2}$$
$$e^{2t}+1=y$$ $$2e^{2t}=\dfrac{dy}{dt}$$ $$2e^{2t}dt=dy
$$\int \dfrac{dy}{y^2}$$ $$-\dfrac{1}{y}+C$$ $$-\dfrac{1}{1+e^{2t}}+C$$ $$-\dfrac{1}{1+e^{\ln\left(\dfrac{\cos\theta+\sin\theta}{\cos\theta-\sin\theta}\right)^2}}+C$$
$$-\dfrac{1}{1+\dfrac{1+\sin2\theta}{1-\sin2\theta}}+C$$ $$-\dfrac{1-\sin2\theta}{2}+C$$ $$\dfrac{\sin2\theta}{2}+C'$$
And this should be actually wrong because if we differentiate the result, it will give $\cos2\theta$, but integrand is $\cos 2\theta \ln\left(\dfrac{\cos \theta+\sin\theta}{\cos\theta-\sin\theta}\right)$
What am I missing here, checked multiple times, but not able to get the mistake. Any directions?