Daunting series of integrals: $\sum_{n=2}^\infty\int_0^{\pi/2}\sqrt{\frac{(1-\sin x)^{n-2}}{(1+\sin x)^{n+2}}}\log(\frac{1-\sin x}{1+\sin x})dx$

Let's employ the weirdo substitution taught by my brother: $\sin x=\tanh t$. Doing so, one will get \begin{align} K&=\int_0^{\infty}\sqrt{\frac{(1-\tanh t)^{n-2}}{(1+\tanh t)^{n+2}}}\ln\left(\frac{1-\tanh t}{1+\tanh t}\right)\ \frac{dt}{\cosh t}\\[10pt] &=\int_0^{\infty}\sqrt{\left(\frac{\cosh t-\sinh t}{\cosh t+\sinh t}\right)^{n-2}}\frac{\cosh t}{(\cosh t+\sinh t)^2}\ \ln\left(\frac{\cosh t-\sinh t}{\cosh t+\sinh t}\right)\ dt\\[10pt] &=-\int_0^{\infty} e^{-(n-2)t}\left(e^{-t}+e^{-3t}\right)\ t\ dt\\[10pt] &=-\frac{1}{n^2+1}-\frac{1}{n^2-1} \end{align} Thus, evaluating $I$ and $J$ are easy-peasy-lemon-squeezy.


Hint.

  1. One may evaluate $(1)$ with the following steps. From the geometric series evaluation $$ \sum_{n=2}^{\infty}\sqrt{\frac{(1-\sin x)^{n-2}}{(1+\sin x)^{n+2}}}=\frac{1}{(1+\sin x)^2}\frac1{1-\sqrt{\frac{1-\sin x}{1+\sin x}}},\quad 0<x<\frac{\pi}2, $$ one may write $$ I=\int_0^{\pi/2}\frac{1}{(1+\sin x)^2}\frac1{1-\sqrt{\frac{1-\sin x}{1+\sin x}}}\log\left( \frac{1-\sin x}{1+\sin x}\right)dx. $$ By the change of variable $u=\frac{1-\tan (x/2)}{1+\tan (x/2)}$ we obtain a standard integral:

    $$ I=\int_0^1\frac{1+u^2}{1-u}\:\log u \:du=\frac{5}{4}-\frac{\pi^2}{3}. $$

  2. One may evaluate $(2)$ by first integrating with respect to $y$ : $$ J=\int_{2}^{\infty}\!\sqrt{\frac{(1-\sin x)^{y-2}}{(1+\sin x)^{y+2}}} dy=-\frac2{(1+\sin x)^2\log\left( \frac{1-\sin x}{1+\sin x}\right)},\quad 0<x<\frac{\pi}2,$$ then integrating with respect to $x$ one gets a standard integral: $$ J=\int_{2}^{\infty}\!\!\int_0^{\pi/2}\sqrt{\frac{(1-\sin x)^{y-2}}{(1+\sin x)^{y+2}}}\log\left(\!\frac{1-\sin x}{1+\sin x}\!\right)\ dx\ dy=-\int_0^{\pi/2}\frac{2\:dx}{(1+\sin x)^2} $$ which gives

    $$ J=-\frac43. $$