How to compute $I_n= \int_{0}^{\pi/4} x\tan^{2n}x\, \mathrm{d}x $ Consider the following integral
$$I_n= \int_{0}^{\pi/4} x\tan^{2n}x \, \mathrm{d}x $$
Then compute $I_n + I_{n+1}$ as a function of $n$ $\forall n\geq0$.
 A: Hint:
$$
\tan^{2n}(x)+\tan^{2n+2}(x)=\tan^{2n}(x)\sec^2(x)
$$
and
$$
\frac{\mathrm{d}}{\mathrm{d}x}\tan(x)=\sec^2(x)
$$
Try integrating by parts.
A: First, notice that
$$\begin{align}
I_n + I_{n+1} &= \int_{0}^{\pi/4} x \left( \tan^{2n}x +\tan^{2n+2}x \right) \, \mathrm{d}x \\
&= \int_{0}^{\pi/4} x\tan^{2n}x \left(1+ \tan^2 x\right) \, \mathrm{d}x \\
&= \int_{0}^{\pi/4} x\tan^{2n}x \, \sec^2 x \, \mathrm{d}x \\
&= \dfrac{1}{2n+1} x \tan^{2n+1} x |_{0}^{\pi/4} - \dfrac{1}{2n+1} \int_{0}^{\pi/4} \tan^{2n+1}x \, \mathrm{d}x \\
&= \dfrac{1}{2n+1} \left( \dfrac{\pi}{4} - \int_{0}^{\pi/4} \tan^{2n+1}x \, \mathrm{d}x \right) \\
&\equiv \dfrac{1}{2n+1} \left( \dfrac{\pi}{4} - J_n \right)
\end{align}$$
and for computing $J_n$ I refer you to this post. For the sake of completeness, I just mention the final result
$$\begin{align}
J_n &=\int_{0}^{\pi/4} \tan x ^{2n+1} \mathrm dx \\
&= \left[ \sum_{k=0}^{n-1} \frac{(-1)^k}{2(n-k)}\tan x ^{2(n-k)}+(-1)^{n+1}\ln \cos x \right]_{0}^{\pi/4} \\
&= \sum_{k=0}^{n-1} \frac{(-1)^k}{2(n-k)}+\frac{(-1)^n}{2}\ln2
\end{align}$$
and hence
$$\boxed{
I_n + I_{n+1} = \dfrac{1}{2n+1} \left( \dfrac{\pi}{4} - \sum_{k=0}^{n-1} \frac{(-1)^k}{2(n-k)}-\frac{(-1)^n}{2}\ln2 \right)
}$$
