How to evaluate$J(k) = \int_{0}^{1} \frac{\ln^2x\ln\left ( \frac{1-x}{1+x} \right ) }{(x-1)^2-k^2(x+1)^2}\text{d}x$

I am not sure that a closed form is possible. However the problem can be made a bit nicer letting $$x=\frac{1-t}{1+t}\implies J(k)=-\frac 12\int_0^1 \frac {\log(t)}{k^2-t^2}\log ^2\left(\frac{1-t}{1+t}\right)\,dt$$ Now, using series expansion $$\frac{\log ^2\left(\frac{1-t}{1+t}\right)}{k^2-t^2}=\sum_{n=1}^\infty a_n\, k^{-2n}\,t^{2n}$$ with $$a_1=4 \qquad \text{and}\qquad a_n-a_{n-1}=4\,\frac{b_n}{c_n}\, k^{2n}$$ where the $b_n$ and $c_n$ correspond respectively to sequence $A002428$ and $A071968$ in $OEIS$ (use the absolute values for the $c_n$).

In fact, $\frac{b_n}{c_n}$ are the coefficients of the Taylor series of $\tanh ^{-1}(u)^2$.

Now, using integration by parts, $$\int_0^1 t^{2n} \, \log(t)\,dt=-\frac{1}{(2 n+1)^2}$$

From a programming point of view, the above seem to make things rather simple (except that the convergence is quite slow).

For example, for $k=2$ and using $1000$ terms in the summation, we have $J(2)\sim 0.092559$ while numerical integration lead to $J(2)=0.092561$.

Edit

Without any change of variable, we have, using the series expansion of $\log \left(\frac{1-x}{x+1}\right)$ and partial fraction decomposition

$$J(k)=\int_0^1\sum_{n=0}^\infty -\frac{2 \left(\frac{-k-1}{4 k ((k+1) x+k-1)}+\frac{k-1}{4 k ((k-1) x+k+1)}\right) x^{2 n+1} \log ^2(x)}{2 n+1}$$ which gives $$J(k)=\frac 1 k \sum_{n=0}^\infty \frac{\Phi \left(\frac{1-k}{1+k},3,2 n+1\right)-\Phi \left(\frac{1+k}{1-k},3,2 n+1\right)}{2 n+1}$$ where appears the Lerch transcendentfunction.

Now, we have a fast convergence. For $k=2$, the partial sums (up to $p$) are $$\left( \begin{array}{cc} p & \text{summation} \\ 0 & 0.0895113 \\ 1 & 0.0920160 \\ 2 & 0.0923839 \\ 3 & 0.0924835 \\ 4 & 0.0925206 \\ 5 & 0.0925374 \\ 6 & 0.0925460 \\ 7 & 0.0925509 \\ 8 & 0.0925539 \\ 9 & 0.0925558 \\ 10 & 0.0925570 \end{array} \right)$$ Using $a=\frac{1-k}{1+k}$, the summand $$b_n=\Phi \left(a,3,2 n+1\right)-\Phi \left(\frac1 a,3,2n+1\right)$$ and $$\Phi \left(a,3,2 n+1\right)=\frac 1{a^{2n+1}}\Bigg[\text{Li}_3(a)-\sum_{k=1}^{2n} \frac{a^k}{k^3} \Bigg]$$

Unfortunately, I was unable to reach the nice expression given by the OP in his/her edit.


Let us define $$J(n,k) = \int_{0}^{1} \frac{\ln(x)^n\ln\left ( \frac{1-x}{1+x} \right ) }{(x-1)^2-k^2(x+1)^2}\text{d}x$$. We had a generalization: $$ J(4,k) =-\frac{\pi^6}{60k} -\frac{6}{k}\left ( \operatorname{Li}_6\left ( \frac{k-1}{k+1} \right ) -\operatorname{Li}_6\left (- \frac{k-1}{k+1} \right ) \right )-\frac{\pi^2}{k}\left ( \operatorname{Li}_4\left ( \frac{k-1}{k+1} \right ) -\operatorname{Li}_4\left (- \frac{k-1}{k+1} \right ) \right )-\frac{3\pi^2}{k} \operatorname{Li}_4\left (- \frac{k-1}{k+1} \right ) +\frac{7\pi^4}{60k} \left ( \operatorname{Li}_2\left ( \frac{1}{k} \right ) -\operatorname{Li}_2\left ( -\frac{1}{k} \right ) \right ) -\frac{\pi^4}{4k} \operatorname{Li}_2\left (- \frac{k-1}{k+1} \right ) +\frac{\pi^2\ln k}{6k} \ln^3\left ( \frac{k-1}{k+1} \right ) +\frac{\ln k}{20k} \ln^5\left ( \frac{k-1}{k+1} \right ) $$


A higher example: $$J(10,k)=-\frac{2555 \pi ^{10} \text{Li}_2\left(\frac{1}{k^2}\right)}{264 k}+\frac{2555 \pi ^{10} \text{Li}_2\left(\frac{1}{k}\right)}{66 k}+\frac{907200 \text{Li}_{12}\left(\frac{2}{k+1}-1\right)}{k}-\frac{192 \pi ^8 \text{Li}_4\left(\frac{2}{k+1}-1\right)}{k}-\frac{1860 \pi ^6 \text{Li}_6\left(\frac{k-1}{k+1}\right)}{k}-\frac{1920 \pi ^6 \text{Li}_6\left(\frac{2}{k+1}-1\right)}{k}-\frac{17640 \pi ^4 \text{Li}_8\left(\frac{k-1}{k+1}\right)}{k}-\frac{20160 \pi ^4 \text{Li}_8\left(\frac{2}{k+1}-1\right)}{k}-\frac{151200 \pi ^2 \text{Li}_{10}\left(\frac{k-1}{k+1}\right)}{k}-\frac{302400 \pi ^2 \text{Li}_{10}\left(\frac{2}{k+1}-1\right)}{k}-\frac{907200 \text{Li}_{12}\left(\frac{k-1}{k+1}\right)}{k}-\frac{381 \pi ^8 \text{Li}_4\left(\frac{k-1}{k+1}\right)}{2 k}-\frac{155 \pi ^{10} \text{Li}_2\left(\frac{2}{k+1}-1\right)}{4 k}-\frac{3037 \pi ^{12}}{1056 k}-\frac{512 \log (k) \coth ^{-1}(k)^{11}}{11 k}-\frac{640 \pi ^2 \log (k) \coth ^{-1}(k)^9}{3 k}-\frac{448 \pi ^4 \log (k) \coth ^{-1}(k)^7}{k}-\frac{496 \pi ^6 \log (k) \coth ^{-1}(k)^5}{k}-\frac{254 \pi ^8 \log (k) \coth ^{-1}(k)^3}{k}$$ For instance, $$\int_{0}^{1} \frac{\ln(x)^{10}\ln\left ( \frac{1-x}{1+x} \right ) }{(x-1)^2-4(x+1)^2} \text{d} x =453600 \left(\text{Li}_{12}\left(-\frac{1}{3}\right)-\text{Li}_{12}\left(\frac{1}{3}\right)\right)-\frac{7}{4} \pi ^4 \left(45 \left(\text{Li}_8\left(\frac{1}{9}\right)-16 \text{Li}_8\left(\frac{1}{3}\right)\right)+\log (2) \log ^7(3)\right)+\pi ^6 \left(30 \left(\text{Li}_6\left(\frac{1}{3}\right)-\text{Li}_6\left(\frac{1}{9}\right)\right)-\frac{31}{4} \log (2) \log ^5(3)\right)-\frac{1}{8} \pi ^8 \left(-6 \text{Li}_4\left(\frac{1}{3}\right)+96 \text{Li}_4\left(\frac{1}{9}\right)+127 \log (2) \log ^3(3)\right)-\frac{5}{528} \pi ^{10} \left(2046 \text{Li}_2\left(-\frac{1}{3}\right)+511 \text{Li}_2\left(\frac{1}{4}\right)+1022 \log ^2(2)\right)-\frac{80}{3} \pi ^2 \left(2835 \left(\text{Li}_{10}\left(\frac{1}{3}\right)+2 \text{Li}_{10}\left(-\frac{1}{3}\right)\right)+\log (16) \coth ^{-1}(2)^9\right)+\frac{1109 \pi ^{12}}{6336}-\frac{1}{88} \log (2) \log ^{11}(3)$$


I wrote a Mathematica code to evaluate all $J(n,k)$ when $n/2\in\mathbb{N},n\ge0$.For examples, $$\small{J(14,k)=\frac{57337 \pi ^{14} \text{Li}_2\left(\frac{1}{k}\right)}{12 k}+\frac{21794572800 \text{Li}_{16}\left(-\frac{k-1}{k+1}\right)}{k}-\frac{465010 \pi ^{10} \text{Li}_6\left(\frac{k-1}{k+1}\right)}{k}-\frac{465920 \pi ^{10} \text{Li}_6\left(-\frac{k-1}{k+1}\right)}{k}-\frac{4576572 \pi ^8 \text{Li}_8\left(\frac{k-1}{k+1}\right)}{k}-\frac{4612608 \pi ^8 \text{Li}_8\left(-\frac{k-1}{k+1}\right)}{k}-\frac{44684640 \pi ^6 \text{Li}_{10}\left(\frac{k-1}{k+1}\right)}{k}-\frac{46126080 \pi ^6 \text{Li}_{10}\left(-\frac{k-1}{k+1}\right)}{k}-\frac{423783360 \pi ^4 \text{Li}_{12}\left(\frac{k-1}{k+1}\right)}{k}-\frac{484323840 \pi ^4 \text{Li}_{12}\left(-\frac{k-1}{k+1}\right)}{k}-\frac{3632428800 \pi ^2 \text{Li}_{14}\left(\frac{k-1}{k+1}\right)}{k}-\frac{7264857600 \pi ^2 \text{Li}_{14}\left(-\frac{k-1}{k+1}\right)}{k}-\frac{21794572800 \text{Li}_{16}\left(\frac{k-1}{k+1}\right)}{k}-\frac{38227 \pi ^{14} \text{Li}_2\left(-\frac{k-1}{k+1}\right)}{4 k}-\frac{57337 \pi ^{14} \text{Li}_2\left(-\frac{1}{k}\right)}{12 k}-\frac{707584 \pi ^{12} \text{Li}_4\left(-\frac{k-1}{k+1}\right)}{15 k}-\frac{1414477 \pi ^{12} \text{Li}_4\left(\frac{k-1}{k+1}\right)}{30 k}-\frac{454637 \pi ^{16}}{640 k}-\frac{8192 \log (k) \tanh ^{-1}\left(\frac{1}{k}\right)^{15}}{15 k}-\frac{14336 \pi ^2 \log (k) \tanh ^{-1}\left(\frac{1}{k}\right)^{13}}{3 k}-\frac{326144 \pi ^4 \log (k) \tanh ^{-1}\left(\frac{1}{k}\right)^{11}}{15 k}-\frac{567424 \pi ^6 \log (k) \tanh ^{-1}\left(\frac{1}{k}\right)^9}{9 k}-\frac{581152 \pi ^8 \log (k) \tanh ^{-1}\left(\frac{1}{k}\right)^7}{5 k}-\frac{372008 \pi ^{10} \log (k) \tanh ^{-1}\left(\frac{1}{k}\right)^5}{3 k}-\frac{2828954 \pi ^{12} \log (k) \tanh ^{-1}\left(\frac{1}{k}\right)^3}{45 k}}$$ $$\small{J(20,k)= \frac{91546277357 \pi ^{20} \text{Li}_2\left(\frac{1}{k}\right)}{660 k}+\frac{608225502044160000 \text{Li}_{22}\left(-\frac{k-1}{k+1}\right)}{k}-\frac{13511079246 \pi ^{16} \text{Li}_6\left(\frac{k-1}{k+1}\right)}{k}-\frac{13511491584 \pi ^{16} \text{Li}_6\left(-\frac{k-1}{k+1}\right)}{k}-\frac{133342927200 \pi ^{14} \text{Li}_8\left(\frac{k-1}{k+1}\right)}{k}-\frac{133359206400 \pi ^{14} \text{Li}_8\left(-\frac{k-1}{k+1}\right)}{k}-\frac{1315803084480 \pi ^{12} \text{Li}_{10}\left(\frac{k-1}{k+1}\right)}{k}-\frac{1316445880320 \pi ^{12} \text{Li}_{10}\left(-\frac{k-1}{k+1}\right)}{k}-\frac{12977127072000 \pi ^{10} \text{Li}_{12}\left(\frac{k-1}{k+1}\right)}{k}-\frac{13002522624000 \pi ^{10} \text{Li}_{12}\left(-\frac{k-1}{k+1}\right)}{k}-\frac{127719310118400 \pi ^8 \text{Li}_{14}\left(\frac{k-1}{k+1}\right)}{k}-\frac{128724973977600 \pi ^8 \text{Li}_{14}\left(-\frac{k-1}{k+1}\right)}{k}-\frac{1247023185408000 \pi ^6 \text{Li}_{16}\left(\frac{k-1}{k+1}\right)}{k}-\frac{1287249739776000 \pi ^6 \text{Li}_{16}\left(-\frac{k-1}{k+1}\right)}{k}-\frac{11826606984192000 \pi ^4 \text{Li}_{18}\left(\frac{k-1}{k+1}\right)}{k}-\frac{13516122267648000 \pi ^4 \text{Li}_{18}\left(-\frac{k-1}{k+1}\right)}{k}-\frac{101370917007360000 \pi ^2 \text{Li}_{20}\left(\frac{k-1}{k+1}\right)}{k}-\frac{202741834014720000 \pi ^2 \text{Li}_{20}\left(-\frac{k-1}{k+1}\right)}{k}-\frac{608225502044160000 \text{Li}_{22}\left(\frac{k-1}{k+1}\right)}{k}-\frac{1109652905 \pi ^{20} \text{Li}_2\left(-\frac{k-1}{k+1}\right)}{4 k}-\frac{28748457785 \pi ^{18} \text{Li}_4\left(\frac{k-1}{k+1}\right)}{21 k}-\frac{28748677120 \pi ^{18} \text{Li}_4\left(-\frac{k-1}{k+1}\right)}{21 k}-\frac{91546277357 \pi ^{20} \text{Li}_2\left(-\frac{1}{k}\right)}{660 k}-\frac{95276883211 \pi ^{22}}{4620 k}-\frac{524288 \log (k) \tanh ^{-1}\left(\frac{1}{k}\right)^{21}}{21 k}-\frac{1310720 \pi ^2 \log (k) \tanh ^{-1}\left(\frac{1}{k}\right)^{19}}{3 k}-\frac{4358144 \pi ^4 \log (k) \tanh ^{-1}\left(\frac{1}{k}\right)^{17}}{k}-\frac{656211968 \pi ^6 \log (k) \tanh ^{-1}\left(\frac{1}{k}\right)^{15}}{21 k}-\frac{168022016 \pi ^8 \log (k) \tanh ^{-1}\left(\frac{1}{k}\right)^{13}}{k}-\frac{21971855360 \pi ^{10} \log (k) \tanh ^{-1}\left(\frac{1}{k}\right)^{11}}{33 k}-\frac{116960274176 \pi ^{12} \log (k) \tanh ^{-1}\left(\frac{1}{k}\right)^9}{63 k}-\frac{3386487040 \pi ^{14} \log (k) \tanh ^{-1}\left(\frac{1}{k}\right)^7}{k}-\frac{18014772328 \pi ^{16} \log (k) \tanh ^{-1}\left(\frac{1}{k}\right)^5}{5 k}-\frac{114993831140 \pi ^{18} \log (k) \tanh ^{-1}\left(\frac{1}{k}\right)^3}{63 k}}$$


A solution idea of calculating the integral by Cornel Ioan Valean

The post is extremely short since I have no time, but once you know what to do, all is trivial. So, what do to? Observe that any $J(2n,k)$ is half the real part of the integral over the positive real line. $$\int_{0}^{1} \frac{\log(x)^{2n}\log\left(\frac{1-x}{1+x}\right)}{(x-1)^2-k^2(x+1)^2}\text{d}x=\frac{1}{2}\Re\biggr\{\int_{0}^{\infty} \frac{\log(x)^{2n}\log\left ( \frac{1-x}{1+x} \right ) }{(x-1)^2-k^2(x+1)^2}\text{d}x\biggr\},$$ which is easy to reach by also using a simple substiution.

Once you have reached this point, exploit multiple integrals involving PV integrals as in the calculations of $J(s)$ here https://math.stackexchange.com/q/3488566.

The rest is easy, boring work to do.

End of story