Finding the value of $\int_{-\pi/4}^{\pi/4}\frac{(\pi-4\theta)\tan\theta}{1-\tan\theta}\,d\theta$. It is given that $$
I=\int_{-\pi/4}^{\pi/4}\frac{(\pi-4\theta)\tan\theta}{1-\tan\theta}\,d\theta=\pi\ln k-\frac{\pi^2}{w}
$$ and was asked to find the value $kw$. Here is my try on it:
Substituting $\theta = \dfrac{\pi}{4}+x$, we get
$$\begin{equation} \label{eq1}
\begin{split}
I &= \displaystyle\int_{-\frac{\pi}{2}}^0\dfrac{(-4x) \tan (\frac{\pi}{4}+x)}{1-\tan (\frac{\pi}{4}+x)} \, dx \\
  &= -4\displaystyle\int_{-\frac{\pi}{2}}^0\dfrac{x.\dfrac{1+ \tan x}{1- \tan x}}{1- \dfrac{1+ \tan x}{1- \tan x}} \, dx \\
&= 2 \displaystyle\int_{-\frac{\pi}{2}}^0\dfrac{x(1+\tan x)}{\tan x} \, dx
\end{split}
\end{equation}$$
From here I am stuck on this, I don't know how to proceed from here to get answer in terms of $\pi \ln k-\frac{\pi^2}{w}$
Thank you for any help.
 A: Note that
\begin{align}
\int_0^{\pi/2}\frac x{\tan x}dx 
=&\int_0^{\pi/2}\int_0^1 \frac1{1+y^2\tan^2 x}dy \ dx
=\frac\pi2\int_0^1\frac1{1+y}dy=\frac\pi2\ln2
\end{align}
and
\begin{split}
I= &\ 2 \int_{-\frac{\pi}{2}}^0\dfrac{x(1+\tan x)}{\tan x} \, dx
= 2 \int^{\frac{\pi}{2}}_0\left(\frac x{\tan x}- x\right) dx
= \pi \ln2 -\frac{\pi^2}4
\end{split}
A: HINT: Expand the $(1+\tan x)$. Then you have an integral of $$\frac{x}{\tan x}=x\frac{\cos x}{\sin x}=x(\ln(\sin x))'$$You integrate this by parts. Use this approach  for the integral of $\ln(\sin x)$. The other integral is $\int x dx$.
EDIT: - just in case the link above is not working:
Let $$S=\int_0^{\frac\pi2}\ln(\sin x)dx$$
Then with $t=\frac\pi 2-x$ one gets $$S= \int_0^{\frac\pi2}\ln(\cos t)dt$$
Summing the two:
$$2S=\int_0^{\frac\pi2}[\ln(\sin x)+\ln(\cos x)]dx\\=\int_0^{\frac\pi2}\ln(\frac12\sin 2x)dx\\=\ln\frac12\int_0^{\frac\pi2}dx+\int_0^{\frac\pi4}\ln(\sin 2x)dx+\int_{\frac\pi4}^{\frac\pi2}\ln(\sin 2x)dx$$
For the middle integral use the substitution $t=2x$, for the last one $t=2x-\frac\pi 2$, and you will get
$$2S=-\frac\pi 2\ln 2+\frac12S+\frac12S$$
So $$S=-\frac\pi 2\ln 2$$
A: letting $\theta=\frac{\pi}{4}-x$ changes the integral into
$$
I=2 \int_0^{\frac{\pi}{2}} \frac{x(1-\tan x)}{\tan x} d x
$$
$$
\begin{aligned}
\int_0^{\frac{\pi}{2}} \frac{x}{\tan x} d x &=\int_0^{\frac{\pi}{2}} x d(\ln (\sin x)) \\
&= \left[x \ln (\sin x) \right] _0^{\frac{\pi}{2}}-\int_0^{\frac{\pi}{2}} \ln (\sin x) d x\\
&=\frac{\pi}{2} \ln 2
\end{aligned}
$$
where the last integral using the result: $\int_0^{\frac{\pi}{2}} \ln (\sin x) d x=-\frac{\pi}{2} \ln 2$.
Hence $$\boxed{\int_{-\pi/4}^{\pi/4}\frac{(\pi-4\theta)\tan\theta}{1-\tan\theta}\,d\theta =\pi \ln 2-\frac{\pi^2}{4}}
$$
