Evaluate $\int_{0}^{\pi\over 4}{\ln(\tan(x))\over \cos^{2n}(x)}\mathrm dx$ $$\int_{0}^{\pi\over 4}{\ln(\tan(x))\over \cos^{2n}(x)}\mathrm dx=F(n)\tag1$$
$n\ge1$
$F(1)=-1$
$F(2)=-{10\over 9}$
$F(3)=-{284\over 225}$
How do we evaluate the closed form for $(1)$?

$u=\tan(x)$ then $\cos^2{(x)}\mathrm du=\mathrm dx$
$$\int_{0}^{1}{\ln(u)\over \cos^{2n-2}(x)}\mathrm du\tag2$$
$\sec^2(x)=1+\tan^2(x)$ 
$\sec^{2n-2}(x)=(1+\tan^2(x))^{n-1}$
$\sec^{2n-2}(x)=(1+u^2)^{n-1}$
$$\int_{0}^{1}(1+u^2)^{n-1}\ln(u)\mathrm du\tag3$$
 A: One may write, for $n\ge 1$,
$$
\begin{align}
\int_{0}^{\pi\over 4}{\ln(\tan(x))\over \cos^{2n}(x)}\mathrm dx&=\int_{0}^{1}\left(1+u^2\right)^{n-1}\ln u\:\mathrm du,\qquad (u=\tan x)
\\\\&=\sum_{k=0}^{n-1}\binom {n-1}k\int_{0}^{1}u^{2k}\ln u\:\mathrm du \quad (\text{binomial expansion})
\\\\&=-\sum_{k=0}^{n-1}\frac{\binom {n-1}k}{(2k+1)^2},
\end{align}
$$ using the standard evaluation
$$
\int_{0}^{1}u^{s}\ln u\:\mathrm du=-\frac1{(s+1)^2},\qquad s\ne-1.
$$
A: Start with integration by parts:
$u = \ln(\tan x) \to du = \frac{1}{\tan x} \sec^2 x dx$,
$dv = (\sec^2 x)^n = \sec^2 x(1 + \tan^2 x)^{n-1}$.
Before continuing, we'll need to compute $v = \int dv$, and for this we'll use the substitution
$w = \tan x \to dw = \sec^2x dx$. Then by the binomial theorem,
\begin{align*}v &= \int(1 + w^2)^{n-1}dw\\ &= \int\sum_{k=0}^{n-1}\binom{n-1}{k}w^{2k}dw\\ &= \sum_{k=1}^{n-1}\binom{n-1}{k}\frac{w^{2k+1}}{2k+1} \\ &= \sum_{k=0}^{n-1}\binom{n-1}{k}\frac{\tan^{2k+1}(x)}{2k+1}\end{align*}
Now our original integral is
\begin{align*} \int_{0}^{\pi/4} udv &= \left.uv\right]_0^{\pi/4} - \int_{0}^{\pi/4}vdu\\
&= \left.\ln(\tan x)\sum_{k=0}^{n-1}\binom{n-1}{k}\frac{\tan^{2k+1}(x)}{2k+1}\right]_0^{\pi/4} - \int_{0}^{\pi/4}\left(\sum_{k=0}^{n-1}\binom{n-1}{k}\frac{\tan^{2k}(x)}{2k+1}\right)\sec^2x dx\end{align*}.
The first term requires us to take a limit as $x \to 0^+$, but this limit is, mercifully, $0$ (try breaking-off a power of $\tan x$ from the sum, then use L'Hospital's rule on $\ln(\tan x) \cdot \tan x$ as $x \to 0^+$). The remaining integral can be evaluated by making a final substitution of $y = \tan x$ to get
\begin{align*}- \int_{0}^{\pi/4}\left(\sum_{k=0}^{n-1}\binom{n-1}{k}\frac{\tan^{2k}(x)}{2k+1}\right)\sec^2x dx &= -\int_0^1 \sum_{k=0}^{n-1}\binom{n-1}{k}\frac{y^{2k}}{2k+1}dy\\
&= -\left.\sum_{k=0}^{n-1}\binom{n-1}{k}\frac{y^{2k+1}}{(2k+1)^2}\right]_0^1\\
&= -\sum_{k=0}^{n-1}\binom{n-1}{k}\frac{1}{(2k+1)^2}.\end{align*}
