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$

My coleague showed me the following integral yesterday

\begin{equation} I=\sum_{n=2}^{\infty}\int_0^{\pi/2}\sqrt{\frac{(1-\sin x)^{n-2}}{(1+\sin x)^{n+2}}}\log\left(\!\frac{1-\sin x}{1+\sin x}\!\right)\ dx=\frac{5}{4}-\frac{\pi^2}{3}\tag1 \end{equation}

He also claimed the following closed-form:

\begin{equation} 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=-\frac{4}{3}\tag2 \end{equation}

$(1)$ and $(2)$ seem difficult to deal with, but I believe there are some tricks that I can use but I'm not able to spot it yet. Using substitution $x\mapsto\frac\pi2-x$, one gets \begin{equation} I=\sum_{n=2}^{\infty}\int_0^{\pi/2}\sqrt{\frac{(1-\cos x)^{n-2}}{(1+\cos x)^{n+2}}}\log\left(\!\frac{1-\cos x}{1+\cos x}\!\right)\ dx\tag3 \end{equation} and \begin{equation} J=\int_{2}^{\infty}\int_0^{\pi/2}\sqrt{\frac{(1-\cos x)^{y-2}}{(1+\cos x)^{y+2}}}\log\left(\!\frac{1-\cos x}{1+\cos x}\!\right)\ dx\ dy\tag4 \end{equation} but I don't know how to use $(3)$ and $(4)$ to evaluate $(1)$ and $(2)$. I'm quite sure that the main problem here is to evaluate \begin{equation} K=\int_0^{\pi/2}\sqrt{\frac{(1-\sin x)^{n-2}}{(1+\sin x)^{n+2}}}\log\left(\!\frac{1-\sin x}{1+\sin x}\!\right)\ dx \end{equation} How does one prove $(1)$ and $(2)$?


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. $$