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?
 A: Integrate by parts: $\int udv=uv-\int v du$, where
$$u=\ln\frac{\cos x+\sin x}{\cos x-\sin x}\Rightarrow du=\frac{\frac{(\cos x-\sin x)(-\sin x+\cos x)-(\cos x+\sin x)(-\sin x +\cos x)  }{(\cos x-\sin x)^2}}{\frac{\cos x+\sin x}{\cos x-\sin x}}=...=\frac{2}{\cos 2x}dx$$
and
$$ dv=\cos 2x dx \Rightarrow v=\frac{1}{2}\sin 2x.$$
Then,
$$\int \cos 2x \ln(\frac{\cos x+\sin x}{\cos x-\sin x}) dx=\frac{1}{2}\sin 2x \ln\frac{\cos x+\sin x}{\cos x-\sin x}-\int \frac{1}{2}\sin 2x \frac{2}{\cos 2x} dx=$$
$$=\frac{1}{2}\sin 2x\ln \frac{\cos x+\sin x}{\cos x-\sin x}-\int \tan 2x dx= $$
$$=\frac{1}{2}\sin 2x \cdot\ln\left(\frac{\cos x+\sin x}{\cos x-\sin x}\right)-\frac{1}{2}\ln|\sec 2x|+c. $$
A: \begin{array}{l}
\displaystyle \quad \int \cos 2 x \ln \left(\frac{\cos x+\sin x}{\cos x-\sin x}\right) d x
\\=\displaystyle \int \cos 2 x \ln \left(\tan \left(x+\frac{\pi}{4}\right)\right) d x \\
\displaystyle =\frac{1}{2} \int \ln \left(\tan \left(x+\frac{\pi}{4}\right)\right) d(\sin 2 x) \\
\displaystyle =\frac{1}{2} \sin 2 x \ln \left(\tan \left(x+\frac{\pi}{4}\right)\right)-\frac{1}{2} \int \frac{\sin 2 x \sec ^{2}\left(x+\frac{\pi}{4}\right) d x}{\tan \left(x+\frac{\pi}{4}\right)} \\
\displaystyle =\frac{1}{2} \sin 2 x \ln (\tan \left(x+\frac{\pi}{4}\right))-\frac{1}{2} \int \frac{\sin 2 x d x}{\sin \left(x+\frac{\pi}{4}\right) \cos \left(x+\frac{\pi}{4}\right)} \\
\displaystyle =\frac{1}{2} \sin 2 x \ln \left(\frac{\cos x+\sin x}{\cos x-\sin x}\right)-\int \frac{\sin 2 x}{\sin \left(2 x+\frac{\pi}{2}\right)} d x\\\displaystyle  =\frac{1}{2} \sin 2 x \ln \left(\frac{\cos x+\sin x}{\cos x-\sin x}\right)+\frac{1}{2} \int \frac{d(\cos 2 x)}{\cos 2 x} \\
\displaystyle =\frac{1}{2} \sin 2 x \ln \left(\frac{\cos x+\sin x}{\cos x-\sin x}\right)+\frac{1}{2} \ln |\cos 2 x|+C
\end{array}
A: Let's recall the definition of the Inverse Hyperbolic Tangent:
$$\begin{cases}\operatorname{arctanh}(x)=\frac{1}{2}\ln\left(\frac{1+x}{1-x}\right)\\\frac{d}{dx}\operatorname{arctanh}(x)=\frac{1}{1-x^2}\end{cases}; x\in(-1,1)$$
So, the integral can be rewritten as:
$$\require{cancel}\begin{align}\int\cos(2x)\log\left(\frac{\cos(x)+\sin(x)}{\cos(x)-\sin(x)}\right)dx &=\color{red}{2}\int\cos(2x)\color{red}{\frac{1}{2}}\log\left(\frac{\cancel{\cos(x)}}{\cancel{\cos(x)}}\left(\frac{1+\frac{\sin(x)}{\cos(x)}}{1-\frac{\sin(x)}{\cos(x)}}\right)\right)dx\\&=2\int\cos(2x)\operatorname{arctanh}\left(\tan(x)\right)dx\\&= \sin(2x)\operatorname{arctanh}\left(\tan(x)\right)-\int\frac{\sin(2x)}{1-\tan^2(x)}\sec^2(x)dx\\&= \sin(2x)\operatorname{arctanh}\left(\tan(x)\right)-\int\frac{\sin(2x)\cancel{\cos^2(x)}\cancel{\sec^2(x)}}{\underbrace{\cos^2(x)-\sin^2(x)}_{\cos(2x)}}dx\\&= \sin(2x)\operatorname{arctanh}\left(\tan(x)\right)+\frac{\log\left|\cos(2x)\right|}{2}+C\end{align}$$
A: $$
\begin{aligned}
I&=\frac{1}{2} \int \cos 2 x \ln \left(\frac{\cos x+\sin x}{\cos x-\sin x}\right)^{2} d x \\
&=\frac{1}{2} \int \cos 2 x \ln \left(\frac{1+\sin 2 x}{1-\sin 2 x}\right) d x \\
& =\frac{1}{4} \int \ln \left(\frac{1+y}{1-y}\right) d y, \text { where } y=\sin 2 x\\
&\stackrel{y=\sin 2x}{=} \frac{1}{4}\left[y \ln \left(\frac{1+y}{1-y}\right)+\int \frac{2 y}{y^{2}-1} d y\right] \\
&=\frac{1}{4}\left[y \ln \left(\frac{1+y}{1-y}\right)+\ln \left|y^{2}-1\right|\right]+C
\end{aligned}$$
Now we can conclude that
$$
I=\frac{1}{2} \sin 2 x \ln \left(\frac{\cos x+\sin x}{\cos x-\sin x}\right)+\frac{1}{2} \ln |\cos 2 x|+C
$$
A: Substitute $t= \sin2x$
\begin{align}
&\int \cos 2x\ln \frac{\cos x+\sin x}{\cos x-\sin x}dx\\
=&\>\frac12\int \tanh^{-1}t\>dt\overset{ibp}=\frac12
t \tanh^{-1}t+\frac14\ln(1-t^2)+C
\end{align}
A: 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*}
