<s>[INST] evaluation of $\int \cos (2x)\cdot \ln \left(\frac{\cos x+\sin x}{\cos x-\sin x}\right)dx$ 
Compute the indefinite integral
  $$
\int \cos (2x)\cdot \ln \left(\frac{\cos x+\sin x}{\cos x-\sin x}\right)\,dx
$$

My Attempt:
First, convert
$$
\frac{\cos x+\sin x}{\cos x-\sin x} = \frac{1+\tan x}{1-\tan x} = \tan \left(\frac{\pi}{4}+x\right)
$$
This changes the integral to
$$
\int \cos (2x)\cdot \ln \left(\tan \left(\frac{\pi}{4}+x\right)\right)\,dx
$$
Now let $t=\left(\frac{\pi}{4}+x\right)$ such that $dx = dt$. Then the integral with changed variables becomes
$$
\begin{align}
\int \cos \left(2t-\frac{\pi}{2}\right)\cdot \ln (\tan t)dt &= \int \sin (2t)\cdot \ln (\tan t)dt\\
&= -\ln(\tan t)\cdot \frac{\cos (2t)}{2}+\frac{1}{2}\int \frac{\sec^2(t)}{\tan t}\cdot \cos (2t)\\
&= -\ln(\tan t)\cdot \frac{\cos (2t)}{2}+\frac{1}{2}\int \cot (2t)dt\\
&= -\ln(\tan t)\cdot \frac{\cos (2t)}{2}+\frac{1}{2}\ln \left|\sin (2t)\right|
\end{align}
$$
where $t=\displaystyle \left(\frac{\pi}{4}+x\right)$.
Is this solution correct? Is there another method for finding the solution?
 [/INST] Let
\begin{equation*}
I=\int \cos 2x\cdot\ln \left|\frac{\cos x+\sin x}{\cos x-\sin x}\right|\,dx.
\end{equation*}
Using the following identity 
\begin{equation*}
\cos 2x=2\cos ^{2}x-1
\end{equation*}
and the substitution
\begin{equation*}
u=\cos x,
\end{equation*}
we get
\begin{equation*}
I=\int \frac{1-2u^{2}}{\sqrt{1-u^{2}}}\cdot\ln \left|\frac{u+\sqrt{1-u^{2}}}{u-\sqrt{1-u^{2}}}\right|\,du.
\end{equation*}
$I$ is integrable by parts, differentiating the factor $\ln \left|\frac{u+\sqrt{1-u^{2}}}{u-\sqrt{1-u^{2}}}\right|$ and integrating the factor $\frac{1-2u^{2}}{\sqrt{1-u^{2}}}$. After simplifying, we obtain
\begin{eqnarray*}
I &=&u\sqrt{1-u^{2}}\cdot\ln \left|\frac{u+\sqrt{1-u^{2}}}{u-\sqrt{1-u^{2}}}\right|+2\int 
\frac{u}{2u^{2}-1}du \\[2ex]
&=&u\sqrt{1-u^{2}}\cdot\ln \left|\frac{u+\sqrt{1-u^{2}}}{u-\sqrt{1-u^{2}}}\right|+\frac{1}{2}
\ln \left| 2u^{2}-1\right| +C \\[2ex]
&=&\left( \cos x\cdot\sin x\right)\cdot \ln \left|\frac{\cos x+\sin x}{\cos x-\sin x}\right|+\frac{1
}{2}\ln \left| 2\cos ^{2}x-1\right| +C\\[2ex]
&=&\frac{\sin 2x
}{2} \ln \left|\frac{\cos x+\sin x}{\cos x-\sin x}\right|+\frac{\ln \left| \cos 2x\right|
}{2} +C.
\end{eqnarray*}
</s>