The question says
Find $$\int \left\{\log \left(\frac{1+\sin2x}{1-\sin2x}\right)^{\cos^2x} +\log\left(\frac{\cos2x}{1+\sin2x}\right)\right\}dx$$
Among many methods which i have tried, the method which i think i should show is:
$$I=\int \left\{\log \left(\frac{1+\sin2x}{1-\sin2x}\right)^{\cos^2x} +\log\left(\frac{\cos2x}{1+\sin2x}\right)\right\}dx$$ $$=\int \left\{\log \left(\frac{\sin x+\cos x }{-\sin x +\cos x}\right)^{1-\sin^2x} -\log\left(\frac{\sin x+\cos x }{-\sin x +\cos x}\right)\right\}dx$$ $$=\int \left\{\log \left(\frac{\sin x+\cos x }{-\sin x +\cos x}\right)-\sin^2x.\log \left(\frac{\sin x+\cos x }{-\sin x +\cos x}\right) -\log\left(\frac{\sin x+\cos x }{-\sin x +\cos x}\right)\right\}dx$$ $$=\int \left\{-\sin^2x.\log\left(\frac{\sin x+\cos x }{-\sin x +\cos x}\right)\right\}dx$$
now using integration by parts:
$$-I=\log\left(\frac{\sin x+\cos x }{-\sin x +\cos x}\right).\int \sin^2xdx-\int\left(\frac{2}{\cos 2x}\int \sin^2xdx\right)dx$$ $$=\log\left(\frac{\sin x+\cos x }{-\sin x +\cos x}\right).\left(\frac x2-\frac{\sin 2x}{4}\right)-\int \frac{x-(\sin2x)/2}{\cos 2x}$$ $$\log\left(\frac{\sin x+\cos x }{-\sin x +\cos x}\right).\left(\frac x2-\frac{\sin 2x}{4}\right)+\frac 12.\int \tan 2x dx-\int x\sec x dx$$
see everything is fine except for the last term of -I which i am not able to evaluate.
is there the integration of $\int x\sec x dx$ even possible? if not, what approach should i adopt?
ANSWER: $$\frac{\sin 2x}{2}.\log\left(\frac{\cos x+\sin x}{\cos x-\sin x}\right)+\frac 12 \log|\cos 2x| +c$$