Products of logarithms under the integral sign

He we derive the result for $N=2$. We assume that $A \in {\mathbb R}$, $B \in {\mathbb R}$ and $C \in {\mathbb R}$. Then we also take $x_1 \in {\mathbb R}$ and $x_2 \in {\mathbb R}$ such that $max(A,B,C) \le x_1 < x_2$.

We note an identity: \begin{equation} u v=\frac{1}{4} \left[ (u+v)^2 - (u-v)^2\right] \quad (i) \end{equation} and we also note the following anti-derivative: \begin{equation} \int\frac{\log[u]^n}{u+A} du = \sum\limits_{p=1}^{n+1} (-1)^p \binom{n}{p-1} (p-1)! Li_p(-\frac{u}{A}) \log[u]^{n-p+1} \quad (ii) \end{equation} Let us define: \begin{equation} {\mathfrak I}_A^{(B,C)}:=\int\limits_{x_1}^{x_2} \frac{\log(x-B)\log(x-C)}{x-A} dx \end{equation} then we have: \begin{eqnarray} &&{\mathfrak I}_A^{(B,C)}=\\ &&\frac{1}{4} \left( \int\limits_{x_1}^{x_2} \frac{[\log[(x-B)(x-C)]]^2}{x-A} dx- \int\limits_{x_1}^{x_2} \frac{[\log[\frac{x-B}{x-C}]]^2}{x-A} dx \right)=\\ &&\frac{1}{4} \left( \int\limits_{x_1-B}^{x_2-B} \frac{\log[u]^2}{u+B-A} du + + 2 {\mathfrak I}_A^{(B,C)}+ \int\limits_{x_1-C}^{x_2-C} \frac{\log[u]^2}{u+C-A} du- \int\limits_{\frac{x_1-B}{x_1-C}}^{\frac{x_2-B}{x_2-C}} \left( \frac{1}{1-u} + \frac{1}{u+\frac{A-B}{C-A}}\right) \log[u]^2 du \right) \end{eqnarray} In the first line we took $(u,v):=(\log(x-B),\log(x-C))$ and we used the identity $(i)$ and in the second line we substituted for $u=(x-B)/(x-C)$ in the second integral and we expanded the numerator in the first integral into three terms and substituted accordingly. At this point it was essential to assume that $max(A,B,C)<x_1<x_2$ since otherwise the argument of the logarithm may jump by $\pm 2 \pi$.

Therefore we have: \begin{eqnarray} &&{\mathfrak I}_A^{(B,C)}= \frac{1}{2} \left(\right.\\ &&\left. \left. \sum\limits_{p=1}^3 (-1)^p \binom{2}{p-1} (p-1)! Li_p (\frac{x}{A-B}) \log[x]^{3-p} \right|_{x_1-B}^{x_2-B} +\right.\\ &&\left. \left. \sum\limits_{p=1}^3 (-1)^p \binom{2}{p-1} (p-1)! Li_p (\frac{x}{A-C}) \log[x]^{3-p} \right|_{x_1-C}^{x_2-C} +\right.\\ &&\left. \left. \sum\limits_{p=1}^3 (-1)^p \binom{2}{p-1} (p-1)! Li_p (x) \log[x]^{3-p} \right|_{\frac{x_1-B}{x_1-C}}^{\frac{x_2-B}{x_2-C}} -\right.\\ &&\left. \left. \sum\limits_{p=1}^3 (-1)^p \binom{2}{p-1} (p-1)! Li_p (x \frac{A-C}{A-B}) \log[x]^{3-p} \right|_{\frac{x_1-B}{x_1-C}}^{\frac{x_2-B}{x_2-C}}\right.\\ &&\left. \right) \end{eqnarray} where we used the anti-derivative $(ii)$.

In[3396]:= {x1, x2} = 
  Sort[RandomReal[{-10, 10}, 2, WorkingPrecision -> 50]];
{A, B, CC} = RandomReal[{-20, x1}, 3, WorkingPrecision -> 50];
Delta[f_, a_, b_] := f[b] - f[a]; n = 2;

 NIntegrate[(Log[(x - B)] Log[(x - CC)])/(x - A), {x, x1, x2}, 
 WorkingPrecision -> 20]
1/2 (Delta[
    Sum[(-1)^p Binomial[n, p - 1] (p - 1)! PolyLog[
        p, #/(A - B)]  Log[#]^(n - p + 1), {p, 1, n + 1}] &, x1 - B, 
    x2 - B] + 
   Delta[Sum[(-1)^p Binomial[n, p - 1] (p - 1)! PolyLog[
        p, #/(A - CC)]  Log[#]^(n - p + 1), {p, 1, n + 1}] &, x1 - CC,
     x2 - CC] +
   Delta[Sum[(-1)^p Binomial[n, p - 1] (p - 1)! PolyLog[
        p, #]  Log[#]^(n - p + 1), {p, 1, n + 1}] &, (x1 - B)/(
    x1 - CC), (x2 - B)/(x2 - CC)] - 
   Delta[Sum[(-1)^p Binomial[n, p - 1] (p - 1)! PolyLog[
        p, # ((A - CC)/(A - B))]  Log[#]^(n - p + 1), {p, 1, 
       n + 1}] &, (x1 - B)/(x1 - CC), (x2 - B)/(x2 - CC)])

Out[3399]= 0.97636054602843021192

Out[3400]= 0.9763605460284302119212052702582348188593322097