$$\int \cos 2\theta \ln\left(\dfrac{\cos \theta+\sin\theta}{\cos\theta-\sin\theta}\right)\mathop{}\!\mathrm{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{\mathop{}\!\mathrm{d}t}{\mathop{}\!\mathrm{d}\theta}$$
$$\dfrac{2}{\cos2\theta}=\dfrac{\mathop{}\!\mathrm{d}t}{\mathop{}\!\mathrm{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$$
\begin{align} \cos2\theta & = \dfrac{1-\tan^2\theta}{1+\tan^2\theta}\\ & = \dfrac{(e^t+1)^2-(e^t-1)^2}{(e^t+1)^2+(e^t-1)^2}\\ & = \dfrac{4e^t}{2(e^{2t}+1)}\\ & = \dfrac{2e^t}{e^{2t}+1}\tag{2}\\ \end{align}
So integral will be
$$\dfrac{1}{2}\cdot\int \left(\dfrac{2e^t}{e^{2t}+1}\right)^2\mathop{}\!\mathrm{d}t$$ $$=\int \dfrac{2e^{2t}}{(1+e^{2t})^2}\mathop{}\!\mathrm{d}t$$
Let $1+e^{2t}=y$ we have $$2e^{2t}=\dfrac{\mathop{}\!\mathrm{d}y}{\mathop{}\!\mathrm{d}t}$$ $$2e^{2t}\mathop{}\!\mathrm{d}t=\mathop{}\!\mathrm{d}y$$
\begin{align} \int \dfrac{\mathop{}\!\mathrm{d}y}{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'\\ \end{align}
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?