To solve $\int \tan (x) \log \left(\cos ^2(x)\right) dx$ one may use the identity:
$\int f'(x)[f(x)]^n dx = \frac{[f(x)]^{n+1}}{n+1}\, n\neq-1$ resulting in $-\frac{1}{4} \log ^2\left(\cos ^2(z)\right)$
Specifically I would like to use the contour method for principle value $\int_0^{\pi} \tan (x) \log \left(\cos ^2(x)\right) dx =0$
I would like to also find if possible the more difficult principle value $\int_0^{\frac{2\pi}{3}} \tan (x) \log \left(\cos ^2(x)\right) dx =-\frac{1}{4} \log ^2(4)$
I am trying to use contour integration however there is discontinuity.
The first steps I tried was to find the residues and work out a suitable contour.
I would be grateful if these steps could be shown as in this similar question answered by @dustin here, the function is modified to use the contour method. I also note a similar method was shown on page 160-1 of “Complex Analysis” by Ahlfors, this time using a rectangle.