How can I compute this integral in closed form : $\int_0^{\frac{π}{4}}\ln^2(\tan x)dx$ How can I compute this integral in closed form :
$$\displaystyle\int_{0}^{\displaystyle \tfrac{π}{4}}\ln^{2}\left(\tan x\right)dx$$
How can use Fourier series here ?
$$-2\displaystyle \sum_{n=0}^{\infty}\frac{\cos((4n+2)x)}{2n+1}$$
$$=\ln\left(\tan x\right)$$
And what's about if
$\displaystyle\int_0^{\displaystyle \tfrac{π}{4}}\ln^2(\cot x)dx$
Please give me ideas or hints

An elementary solution. Utilize
$$ J=\int_0^\infty \frac{(x^2-1)\ln y }{(y+x^2)(y+1)}
\overset{y\to \frac{x^2}y}{dy}=\int_0^\infty \frac{(x^2-1)\ln (x^2) }{(y+x^2)(y+1)}dy- J= {2\ln^2 x}$$
and $x=\tan t $
\begin{align}
&\int_0^{\pi/4}\ln^2(\tan t)\ dt\\
=& \int_0^1\frac{\ln^2x}{1+x^2}\overset{x\to 1/x}{dx}
=\int_1^\infty\frac{\ln^2x}{1+x^2} dx= \frac12\int_0^\infty\frac{\ln^2x}{1+x^2}dx\\
=&\ \frac14\int_0^\infty\int_0^\infty\frac1{1+x^2}\frac{(x^2-1)\ln y}{(y+x^2)(y+1)}\ dy \ dx\\
 =& \ \frac14\int_0^\infty\int_0^\infty
\frac{\ln y}{(y+x^2)(y-1)}-\frac{2\ln y}{(1+x^2)(y^2-1)}\ dx \ dy\\
=& \ \frac\pi8 \int_0^\infty \frac{\ln y}{\sqrt y(y-1)} \overset{y\to y^2}{dy}- \frac\pi4 \int_0^\infty \frac{\ln y}{y^2-1}\ dy
=\frac\pi4 \int_0^\infty \frac{\ln y}{y^2-1}\ dy\\
 =& \ \frac\pi4 \int_0^\infty \int_0^1 \frac{x}{1+(y^2-1)x^2}dx\>dy
= \frac{\pi^2}8\int_0^1 \frac1{\sqrt{1-x^2}}dx=\frac{\pi^3}{16}
\end{align}
