<s>[INST] An integral involving a the dilogarithmic function Consider a following definite integral:
\begin{equation}
\phi_a(x):=\int\limits_0^x \frac{Li_2(\xi)}{\xi+a} d \xi
\end{equation}
By using the integral representation of the dilogarithmic function and swapping the integration order we have shown that our integral satisfies the following functional equation:
\begin{equation}
\phi_a(x)=
\text{Li}_3\left(\frac{a+x}{a+1}\right)-\text{Li}_3\left(\frac{a}{a+1}\right)
-2 \text{Li}_3\left(\frac{1}{a+1}\right)+2 \text{Li}_2\left(\frac{1}{a+1}\right) \log
   \left(\frac{1}{a+1}\right)+
\text{Li}_2(-a) \log \left(\frac{a+x}{a}\right)+\text{Li}_2\left(\frac{a}{a+1}\right) \log \left(\frac{1}{a+1}\right)+\log \left(\frac{a}{a+1}\right) \log ^2\left(\frac{1}{a+1}\right)+2 \zeta (3)
-\phi_{-\frac{a+x}{a}}(\frac{x+a}{1+a})
\end{equation}
Now, the question is how do we solve this equation?
 [/INST] Here we are computing the antiderivative in closed form rather than solving the functional equation above. In our calculations we will be transforming the integrand by adding and subtracting terms to it in order to -- at every step-- extract terms which are full derivatives. In here we are using the following identity:
\begin{equation}
\left[Li_3(f(x)) - \log(f(x)) Li_2(f(x))\right]^{'} =
\log(1-f(x)) \log(f(x)) \cdot \frac{f^{'}(x)}{f(x)}
\end{equation}
valid for any function $f(x)$ that is smooth enough.
We define ${\mathcal I}_a(x) := Li_2(x)/(x+a)$ and
\begin{eqnarray}
{\mathcal J}_0(x) &:=& \log(x+a) \\
{\mathcal J}_1(x) &:=& Li_3(1-x) + \log(\frac{x+a}{a-a x}) Li_2(1-x)\\
{\mathcal J}_2(x) &:=& \log(\frac{x+a}{a})^2 - \log(\frac{a-a x}{x+a})^2\\
{\mathcal J}_3(x) &:=& Li_3\left(\frac{x+a}{a-a x}\right)-\log(\frac{x+a}{a-a x}) Li_2\left(\frac{x+a}{a-a x}\right)\\
{\mathcal J}_4(x) &:=& Li_3\left(\frac{x+a}{-1+ x}\right)-\log(\frac{x+a}{a-a x}) Li_2\left(\frac{x+a}{-1+ x}\right)\\
{\mathcal J}_5(x) &:=& Li_3\left(\frac{x+a}{a}\right) -  \log(\frac{x+a}{a})Li_2\left(\frac{x+a}{a}\right)
\end{eqnarray}
Now we start from Euler's reflection formula for the dilogarithmic function:
\begin{eqnarray}
{\mathcal I}_a(x) &=& -\frac{\log(1-x) \log(x)}{x+a}-\frac{Li_2(1-x)}{x+a} + \frac{\pi^2}{6} \frac{1}{x+a} \\
&=& 
-\frac{\log(1-x) \log(x)}{x+a} + \frac{\log(x) \log(\frac{x+a}{a-a x})}{1-x} - {\mathcal J}_1^{'}(x)+ \frac{\pi^2}{6} {\mathcal J}_0^{'}(x)
\end{eqnarray}
In here we have just added and subtracted the second term on the right hand side and then we have recognized that the $Li_2$ term along with the subtracted term form a full derivative. Now we have:
\begin{eqnarray}
&&{\mathcal I}_a(x)=\\
&&\log(-\frac{1}{a}) 
\left(-\frac{(1+a)\log(\frac{a- a x}{a+x})}{(x+a)(1-x)} -\frac{\log(\frac{x+a}{a})}{x+a}
+\frac{\log(\frac{x+a}{a})}{x+a}
+\frac{(1+a)\log(\frac{a- a x}{a+x})}{(x+a)(1-x)}\right)\\
&&
-\frac{\log(1-x) \log(x)}{x+a} + \frac{\log(x) \log(\frac{x+a}{a-a x})}{1-x} - {\mathcal J}_1^{'}(x)+ \frac{\pi^2}{6} {\mathcal J}_0^{'}(x)
\end{eqnarray}
Note that the last two terms in the parentheses on the right hand side form a full derivative. Therefore we have:
\begin{eqnarray}
&&{\mathcal I}_a(x)=\\
&&\log(-\frac{1}{a}) 
\left(-\frac{(1+a)\log(\frac{a- a x}{a+x})}{(x+a)(1-x)} -\frac{\log(\frac{x+a}{a})}{x+a}
\right)+
\frac{1}{2}\log(-\frac{1}{a})
{\mathcal J}^{'}_2(x)\\
&&
-\frac{\log(1-x) \log(x)}{x+a} + \frac{\log(x) \log(\frac{x+a}{a-a x})}{1-x} - {\mathcal J}_1^{'}(x)+ \frac{\pi^2}{6} {\mathcal J}_0^{'}(x)
\end{eqnarray}
At this stage we intuitively know what to do. To each of the logarithms in the parentheses on the right hand side we need to attach "a reflected log" meaning that we end up with a product of logs of arguments that sum up to one. If we achieve that we end up with another full derivative (see the first line from the top). We skip the tedious, but straightforward, intermediate calculations and we state the result:
\begin{eqnarray}
&&{\mathcal I}_a(x)=\\
&&
\frac{\log \left(\frac{a+x}{a-a x}\right) \log \left(1-\
\frac{a+x}{a-a x}\right)}{\frac{x+a}{a-a x}} \frac{1+a}{a(x-1)^2}
-
\frac{ \log \left(\frac{a+1}{1-x}\right) \log \
\left(\frac{a+x}{a-a x}\right)}{\frac{x+a}{a-a x}} \frac{1+a}{a(x-1)^2}
-
\frac{\log \left(-\frac{x}{a}\right) \log \left(\frac{x}{a}+1\right)}{\frac{a+x}{a}} \frac{1}{a}
- {\mathcal J}_1^{'}(x)+ \frac{\pi^2}{6} {\mathcal J}_0^{'}(x)+\frac{1}{2}\log(-\frac{1}{a})
{\mathcal J}^{'}_2(x)
\end{eqnarray}
Note that the only thing we did in here was to rewrite the terms which are not yet full derivatives . Now clearly the first and the third term on the right hand side are clearly full derivatives . The second term needs to be manipulated a bit but is conceivable that it can be transformed into a full derivative as well. Therefore we have:
\begin{eqnarray}
&&{\mathcal I}_a(x)=\\
&&{\mathcal J}_3^{'}(x)- {\mathcal J}_4^{'}(x)-{\mathcal J}_5^{'}(x)- {\mathcal J}_1^{'}(x)+ \frac{\pi^2}{6} {\mathcal J}_0^{'}(x)+\frac{1}{2}\log(-\frac{1}{a})
{\mathcal J}^{'}_2(x)
\end{eqnarray}
Now integrating the above we get the final result:
\begin{eqnarray}
&&\phi_a(x)=\\
&&{\mathcal J}_3(x)- {\mathcal J}_4(x)-{\mathcal J}_5(x)- {\mathcal J}_1(x)+ \frac{\pi^2}{6} {\mathcal J}_0(x)+\frac{1}{2}\log(-\frac{1}{a})
{\mathcal J}_2(x) +\\
&& Li_3(-a) + Li_3(1) - \log(a) \frac{\pi^2}{6}
\end{eqnarray}
</s>