$\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove armada]{\displaystyle{#1}}\,}
\newcommand{\llaves}[1]{\left\lbrace\,{#1}\,\right\rbrace}
\newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
\newcommand{\dd}{\mathrm{d}}
\newcommand{\ds}[1]{\displaystyle{#1}}
\newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
\newcommand{\ic}{\mathrm{i}}
\newcommand{\mc}[1]{\mathcal{#1}}
\newcommand{\mrm}[1]{\mathrm{#1}}
\newcommand{\pars}[1]{\left(\,{#1}\,\right)}
\newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\parcial #3^{#1}}}
\newcommand{\raíz}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
\newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
\newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
Voy a asumir el $\ds{\ln}$-argumento es 'encerrado' en un valor absoluto !!!.
\begin{align}
&\int_{0}^{\pi/2}x\cos\pars{8x}
\ln\pars{\verts{1 + \tan\pars{x} \over 1 - \tan\pars{x}}}\,\dd x =
\int_{0}^{\pi/2}x\cos\pars{8x}
\ln\pars{\verts{\tan\pars{x + {\pi \over 4}}}}\,\dd x
\\[5mm] = &\
-\int_{-\pi/4}^{\pi/4}\pars{x + {\pi \over 4}}\cos\pars{8x}
\ln\pars{\verts{\tan\pars{x}}}\,\dd x =
-\,{\pi \over 2}\int_{0}^{\pi/4}\cos\pars{8x}
\ln\pars{\verts{\tan\pars{x}}}\,\dd x
\\[5mm] = &\
{\pi \over 16}\int_{0}^{\pi/4}\sin\pars{8x}
{\sec^{2}\pars{x} \over \tan\pars{x}}\,\dd x =
{\pi \over 8}\int_{0}^{\pi/4}{\sin\pars{8x} \over \sin\pars{2x}}\,\dd x =
{\pi \over 16}\,\Im\int_{0}^{\pi/2}{\expo{4\ic x} \over \sin\pars{x}}\,\dd x
\\[5mm] = &\
\left.{\pi \over 16}\,\Im\int_{x\ =\ 0}^{x\ =\ \pi/2}
{z^{4} \over \pars{1 - z^{2}}\ic/\pars{2z}}
\,{\dd z \over \ic z}\,\right\vert_{\ z\ =\ \exp\pars{\ic x}} =
\left.-\,{\pi \over 8}\,\Im\int_{x\ =\ 0}^{x\ =\ \pi/2}{z^{4} \over 1 - z^{2}}
\,\dd z\,\right\vert_{\ z\ =\ \exp\pars{\ic x}}
\\[5mm] \stackrel{\mrm{as}\ \epsilon\ \to\ 0^{+}}{\sim}&\
{\pi \over 8}\,\Im\int_{1}^{0}{y^{4} \over 1 + y^{2}}\,\ic\,\dd y\ +\
\underbrace{%
{\pi \over 8}\,\Im\int_{0}^{1 - \epsilon}{x^{4} \over 1 - x^{2}}\,\dd x}
_{\ds{=\ 0}}\ +\
{\pi \over 8}\,\Im\int_{\pi}^{\pi/2}{\epsilon\expo{\ic\theta}\ic\,\dd\theta \over \pars{-\epsilon\expo{\ic\theta}}\pars{2}}
\\[5mm] \stackrel{\mrm{as}\ \epsilon\ \to\ 0^{+}}{\to} &
-\,\ \underbrace{{\pi \over 8}\int_{0}^{1}{y^{4} \over y^{2} + 1}\,\dd y}
_{\ds{{\pi^{2} \over 32} - {\pi \over 12}}} + {\pi^{2} \over 32} =
\bbx{\ds{\pi \over 12}}
\end{align}