Generating function for cubes of Harmonic numbers

By generalizing the approach in Integral involving a dilogarithm versus an Euler sum. meaning by using the integral representation of the harmonic numbers and by computing a three dimensional integral over a unit cube analytically we have found the generating function of cubes of harmonic numbers. We have: \begin{eqnarray} &&S^{(3)}(x) := \sum\limits_{n=1}^\infty H_n^3 x^n = \frac{-18 \text{Li}_3\left(1-\frac{1}{x}\right)+6 \text{Li}_3\left(\frac{1}{x}\right)-18 \text{Li}_3(x)}{6(1-x)}+ \frac{6 \log ^3(1-x)-9 \log (x) \log ^2(1-x)+3 \left(3 \log ^2(x)+\pi ^2\right) \log (1-x)}{6(x-1)}+\frac{-\log (x) \left(2 \log ^2(x)+ 3 i \pi \log (x)+5 \pi ^2\right)}{6 (x-1)} \end{eqnarray} Clearly some of the terms on the right hand side are complex even though the whole expression is of course real. The first two terms in the first fraction on the rhs are complex and the middle term in the last fraction is complex. My question is how do I simplify the right hand side to get rid of the complex terms?


By using the functional equations for the trilogarithm we simplified the result as follows: \begin{eqnarray} &&S^{(3)}(x)= \\ &&\frac{ \text{Li}_3(x)}{(1-x)}+ 3\frac{\text{Li}_3(1-x)-\zeta (3)}{(1-x)}+ \log(1-x)\frac{ \left(-2 \log ^2(1-x)+3 \log (x) \log(1-x)-\pi ^2 \right)}{2 (1-x)} \end{eqnarray}

For a sanity check we expand each of the terms in the formula in a Taylor series about zero we have: \begin{eqnarray} &&\frac{Li_3(x)}{1-x} =\\ && x+\frac{9 x^2}{8}+\frac{251 x^3}{216} + O(x^4) \\ &&3\frac{\text{Li}_3(1-x)-\zeta (3)}{(1-x)} =\\ &&-\frac{\pi ^2 x}{2}+\frac{9 x^2}{4}-\frac{3}{2} x^2 \log (x)-\frac{3 \pi ^2 x^2}{4}-\frac{11 \pi ^2 x^3}{12}+4 x^3-3 x^3 \log (x) + O(x^4) \\ &&\log(1-x)\frac{ \left(-2 \log ^2(1-x)+3 \log (x) \log(1-x)-\pi ^2 \right)}{2 (1-x)} =\\ && \frac{\pi ^2 x}{2}+\frac{3 \pi ^2 x^2}{4}+\frac{3}{2} x^2 \log (x) +\frac{11 \pi ^2 x^3}{12}+x^3+3 x^3 \log (x)+ O(x^4) \end{eqnarray}

As we can see the terms proportional to $\log(x)$being present in the second and the third term exactly cancel each other. The formula is correct.


Here we provide a closed form for another related sum. We have: \begin{eqnarray} &&\sum\limits_{n=1}^\infty \frac{H_n^3}{n} \cdot x^n =\\ &&3 \zeta(4)-3 \text{Li}_4(1-x)+3 \text{Li}_3(1-x) \log (1-x)+\log (x) \log ^3(1-x)+\\ &&\text{Li}_2(x){}^2-2 \text{Li}_4(x)-3 \text{Li}_4\left(\frac{x}{x-1}\right)+\frac{3}{2} \left(\text{Li}_2(x)-\frac{\pi ^2}{6}\right) \log ^2(1-x)+2 \text{Li}_3(x) \log (1-x)+\frac{1}{8} \log ^4(1-x) \end{eqnarray} We obtained this formula by dividing the right hand side in the question above by $x$ and then integrating.