Alternative method of solving $\int_0^{\pi/2} {\sin^2{x} \ln{\tan x} \,dx}$ Solve the integral:
$$\int_0^{\pi/2} {\sin^2{x} \ln{\tan x} \,dx}$$
I have already found the answer to be $\frac{\pi}{4}$ by the method explained below, but I would like to know whether there is another way.
--- My method ---
Use a $u$-sub: $u=\tan x, \,du=\sec^2x \,dx$
$$\int_0^{\pi/2} {\sin^2{x} \ln{\tan x} \,dx}=\int_0^{\pi/2} {\frac{\tan^2{x}}{\sec^2{x}} \ln{\tan x} \,dx}=\int_0^{\pi/2} {\frac{\tan^2{x}}{\sec^4{x}} \ln{\left(\tan x\right)} \sec^2x \,dx}=\int_0^{\infty} {\frac{u^2}{\left(1+u^2\right)^2} \ln{u} \,du}$$
Now, just 'pull your luckiest rabbit out of your hat':
$$I(a) = \int_0^{\infty} {\frac{u^a \ln{u}}{\left(1+u^a\right)^2} \,du}$$
And use a 'reverse Feynman method':
$$\int{I(a) \,da} = \int_0^{\infty} {\int{ \left( \frac{u^a \ln{u}}{\left(1+u^a\right)^2} \,da\right)}\,du} = -\int_0^{\infty} {\frac{\,du}{1+u^a}} = -\frac{\pi}{a} \csc{\left(\frac{\pi}{a}\right)}$$
Now, $I(a)$ is just the derivative of the last expression:
$$I(a) = \frac{\,d}{\,da} {\left[ -\frac{\pi}{a} \csc{\left(\frac{\pi}{a}\right)} \right]} = \frac{1}{a} \left(\frac{\pi}{a}\csc{\left(\frac{\pi}{a}\right)}\right) \left(1-\frac{\pi}{a}\cot{\left(\frac{\pi}{a}\right)}\right) $$
Of course, the original integral was equivalent to $I(2)$, so:
$$\boxed{\int_0^{\pi/2} {\sin^2{x} \ln{\tan x} \,dx}=\frac{\pi}{4}}$$
 A: Using Integration by Parts
$$
\begin{align}
&\int_0^{\pi/2}\sin^2(x)\log(\tan(x))\,\mathrm{d}x\tag{1}\\
&=\int_0^{\pi/2}\sin^2(x)\log(\sin(x))\,\mathrm{d}x
-\int_0^{\pi/2}\sin^2(x)\log(\cos(x))\,\mathrm{d}x\tag{2}\\
&=\int_0^{\pi/2}\cos^2(x)\log(\cos(x))\,\mathrm{d}x
-\int_0^{\pi/2}\sin^2(x)\log(\cos(x))\,\mathrm{d}x\tag{3}\\
&=\int_0^{\pi/2}\cos(2x)\log(\cos(x))\,\mathrm{d}x\tag{4}\\
&=\frac12\int_0^{\pi/2}\log(\cos(x))\,\mathrm{d}\sin(2x)\tag{5}\\
&=\frac12\int_0^{\pi/2}\sin(2x)\tan(x)\,\mathrm{d}x\tag{6}\\
&=\int_0^{\pi/2}\sin^2(x)\,\mathrm{d}x\tag{7}\\
&=\int_0^{\pi/2}\cos^2(x)\,\mathrm{d}x\tag{8}\\[3pt]
&=\frac\pi4\tag{9}
\end{align}
$$
Explanation:
$(2)$: $\log(\tan(x))=\log(\sin(x))-\log(\cos(x))$
$(3)$: substitute $x\mapsto\frac\pi2-x$ in first integral
$(4)$: $\cos(2x)=\cos^2(x)-\sin^2(x)$
$(5)$: prepare to integrate by parts
$(6)$: integrate by parts
$(7)$: $\frac12\sin(2x)\tan(x)=\sin^2(x)$
$(8)$: substitute $x\mapsto\frac\pi2-x$
$(9)$: average $(7)$ and $(8)$

Using the Trigonometric Series for $\boldsymbol{\log(\cos(x))}$
Using the series for $\log(1+x)$,
$$
\begin{align}
\log(2\cos(x))
&=\log\left(e^{ix}+e^{-ix}\right)\\
&=ix+\log\left(1+e^{-2ix}\right)\\
&=-ix+\log\left(1+e^{2ix}\right)\\
&=\sum_{k=1}^\infty\frac{(-1)^{k-1}}k\cos(2kx)
\end{align}
$$
Thus, using the orthogonality of $\{\cos(kx)\}$
$$
\begin{align}
&\int_0^{\pi/2}\sin^2(x)\log(\tan(x))\,\mathrm{d}x\\
&=\int_0^{\pi/2}\sin^2(x)\log(2\sin(x))\,\mathrm{d}x
-\int_0^{\pi/2}\sin^2(x)\log(2\cos(x))\,\mathrm{d}x\\
&=\int_0^{\pi/2}\cos^2(x)\log(2\cos(x))\,\mathrm{d}x
-\int_0^{\pi/2}\sin^2(x)\log(2\cos(x))\,\mathrm{d}x\\
&=\int_0^{\pi/2}\cos(2x)\log(2\cos(x))\,\mathrm{d}x\\
&=\int_0^{\pi/2}\cos(2x)\sum_{k=1}^\infty\frac{(-1)^{k-1}}k\cos(2kx)\,\mathrm{d}x\\
&=\sum_{k=1}^\infty\frac{(-1)^{k-1}}{4k}\int_{-\pi}^\pi\cos(x)\cos(kx)\,\mathrm{d}x\\[3pt]
&=\frac\pi4
\end{align}
$$
A: This is not an answer but it is put for your curiosity.
Surprizing or not, the antiderivative can be computed. Considering $$I=\int {\sin^2(x)} \ln(\tan (x)) \,dx$$ a CAS led to $$8I=4 i \text{Li}_2\left(e^{2 i x}\right)-i \text{Li}_2\left(e^{4 i x}\right)-2 \sin (2
   x) \log (\tan (x))+4 x \left(2 \tanh ^{-1}\left(e^{2 i x}\right)+\log (\tan
   (x))+1\right)$$ where appears the polylogarithm function.


*

*For $x=0$, the above expression leads to $I=\frac{i \pi ^2}{16}$

*For $x=\frac \pi 2$, the above expression leads to $I=\frac{\pi }{4}+\frac{i \pi ^2}{16}$ and hence the result for the integral between $0$ and $\frac\pi 2$

*For $x=\frac \pi 4$, the above expression leads to $I=-\frac{C}{2}+\frac{\pi }{8}+\frac{i \pi ^2}{16}$ and hence another "interesting" result
$$\int_0^{\frac\pi 4} {\sin^2(x)} \ln(\tan (x)) \,dx=\frac{\pi }{8}-\frac{C}{2}$$ where appears Catalan number.

*For small values of $\epsilon$, Taylor expansion of $I$ gives
$$\int_0^{\epsilon} {\sin^2(x)} \ln(\tan (x)) \,dx=\frac{1}{9}  (3 \log (\epsilon)-1)\,\epsilon^3+\frac{1}{75} (6-5 \log
   (\epsilon))\, \epsilon^5+ \left(\frac{2 \log (\epsilon)}{315}-\frac{5}{882}\right)\,\epsilon^7+O\left(\epsilon^9\right)$$

A: Hint for an alternative method:
1) Substitute $t=\frac{\pi}{2}-x$ to get
$$I=\int_0^{\pi/2}\sin^2 x\log(\tan x) dx=-\int_0^{\pi/2}\cos^2 x\log(\tan x) dx$$
2) Write $2I$ as:
$$2I=\int_0^{\pi/2}(\sin^2 x-\cos^2 x)\log(\tan x)dx=x-\sin x \cos x \log(\tan x)\big|_{x=0}^{x=\pi/2}=\frac{\pi}{2}$$
3) So $I=\frac{\pi}{4}$
A: $\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[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}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\int_{0}^{\pi/2}\sin^{2}\pars{x}\ln\pars{\tan\pars{x}}\,\dd x =
\left.\totald{}{\mu}\int_{0}^{\pi/2}\sin^{2}\pars{x}\tan^{\mu}\pars{x}\,\dd x
\,\right\vert_{\ \mu\ =\ 0}
\\[5mm] = &\
\left.\totald{}{\mu}\int_{0}^{\pi/2}\sin^{\mu + 2}\pars{x}
\bracks{1 - \sin^{2}\pars{x}}^{-\pars{\mu + 1}/2}\,\cos\pars{x}\,\dd x
\,\right\vert_{\ \mu\ =\ 0}
\\[5mm] \stackrel{t\ \equiv\ \sin\pars{x}}{=} &\,\,\,
\left.\totald{}{\mu}\int_{0}^{1}t^{\mu + 2}
\pars{1 - t^{2}}^{-\pars{\mu + 1}/2}\,\dd t
\,\right\vert_{\ \mu\ =\ 0}
\,\,\,\stackrel{t^{2}\ \mapsto\ t}{=}
\left.{1 \over 2}\totald{}{\mu}\int_{0}^{1}t^{\mu/2 + 1/2}
\pars{1 - t}^{-\pars{\mu + 1}/2}\,\dd t
\,\right\vert_{\ \mu\ =\ 0}
\\[5mm] = &\
\left.{1 \over 2}\totald{}{\mu}
{\Gamma\pars{\mu/2 + 3/2}\Gamma\pars{-\mu/2 + 1/2} \over \Gamma\pars{2}}
\,\right\vert_{\ \mu\ =\ 0}
\\[5mm] = &\
{1 \over 2}\totald{}{\mu}\bracks{%
{\mu + 1 \over 2}\,\Gamma\pars{\mu + 1 \over 2}\Gamma\pars{1 - \mu \over 2}}
_{\ \mu\ =\ 0}
\\[5mm] = &\
{1 \over 4}\totald{}{\mu}\bracks{%
\pars{\mu + 1}{\pi \over \sin\pars{\pi\bracks{\mu + 1}/2}}}_{\ \mu\ =\ 0} =
{\pi \over 4}\totald{}{\mu}\bracks{%
{\mu + 1 \over \cos\pars{\pi\mu/2}}}_{\ \mu\ =\ 0} = \bbx{\ds{\pi \over 4}}
\end{align}
