Integral ${\large\int}_0^1\ln^3\!\left(1+x+x^2\right)dx$

A Recurrence Relation

I will use the notation $$\mathcal{A}_n=\int^1_0\ln^n(1+x+x^2)\ {\rm d}x\ \ \ , \ \ \ \mathcal{B}_n=\int^\frac{\pi}{3}_\frac{\pi}{6}\ln^n\left(\frac{3}{4\cos^2{x}}\right)\ {\rm d}x$$ Integrating by parts and applying the substitution $\displaystyle x+\frac{1}{2}\mapsto \frac{\sqrt{3}}{2}\tan{x}$, it is evident that $$\mathcal{A}_n=n\sqrt{3}\mathcal{B}_{n-1}-2n\mathcal{A}_{n-1}+\frac{3}{2}(\ln{3})^n$$ We may use this recurrence to compute $\mathcal{A}_n$ for small positive integer values of $n$.


Evaluation of $\mathcal{A}_1$

We immediately have $$\mathcal{A}_1=1\times\sqrt{3}\times\frac{\pi}{6}-2\times 1\times 1+\frac{3}{2}\ln{3}=\frac{\pi}{2\sqrt{3}}+\frac{3}{2}\ln{3}-2$$


Evaluation of $\mathcal{A}_2$

We first compute $\mathcal{B}_1$ by exploiting a Fourier series. \begin{align} \mathcal{B}_1 &=\frac{\pi}{6}\ln{3}-2\int^\frac{\pi}{3}_\frac{\pi}{6}\ln(2\cos{x})\ {\rm d}x\\ &=\frac{\pi}{6}\ln{3}+2\sum^\infty_{n=1}\frac{(-1)^n}{n}\int^\frac{\pi}{3}_\frac{\pi}{6}\cos(2nx)\ {\rm d}x\\ &=\frac{\pi}{6}\ln{3}+\sum^\infty_{n=1}\frac{(-1)^n}{n^2}\left(\sin\left(\frac{2n\pi}{3}\right)-\sin\left(\frac{n\pi}{3}\right)\right)\\ &=\frac{\pi}{6}\ln{3}-\frac{1}{12\sqrt{3}}\sum^\infty_{n=0}\left[\frac{1}{\left(n+\frac{1}{3}\right)^2}-\frac{1}{\left(n+\frac{2}{3}\right)^2}\right]\\ &=-\frac{1}{6\sqrt{3}}\psi_1\left(\frac{1}{3}\right)+\frac{\pi^2}{9\sqrt{3}}+\frac{\pi}{6}\ln{3} \end{align} Therefore, \begin{align} \mathcal{A}_2 &=2\sqrt{3}\left(-\frac{1}{6\sqrt{3}}\psi_1\left(\frac{1}{3}\right)+\frac{\pi^2}{9\sqrt{3}}+\frac{\pi}{6}\ln{3}\right)-4\left(\frac{\pi}{2\sqrt{3}}+\frac{3}{2}\ln{3}-2\right)+\frac{3}{2}\ln^2{3}\\ &=-\frac{1}{3}\psi_1\left(\frac{1}{3}\right)+\frac{2\pi^2}{9}+\frac{\pi}{\sqrt{3}}\ln{3}+\frac{3}{2}\ln^2{3}-\frac{2\pi}{\sqrt{3}}-6\ln{3}+8 \end{align}


Simplification of Some ${\rm Li}_2,\ {\rm Li}_3$ Terms

I will simplify the terms $$\color{red}{{\rm Li}_2(e^{-\pi i/3})},\ \color{blue}{{\rm Li}_2(1-e^{2\pi i/3})},\ \color{green}{\Im{\rm Li}_3(e^{\pi i/3})},\ \color{purple}{\Im{\rm Li}_3(e^{-\pi i/3})},\ \color{brown}{\Im{\rm Li}_3(e^{2\pi i/3})}$$ The identities (for $0<\theta<2\pi$), \begin{align} \sum^\infty_{n=1}\frac{\cos(n\theta)}{n^2}&=\frac{\theta^2}{4}-\frac{\pi\theta}{2}+\frac{\pi^2}{6}\\ \sum^\infty_{n=1}\frac{\sin(n\theta)}{n^3}&=\frac{\theta^3}{12}-\frac{\pi\theta^2}{4}+\frac{\pi^2\theta}{6}\\ \end{align} (which can be derived by considering $\Im\ln(1-e^{i\theta})$ and integrating), give us \begin{align} \Im{\rm Li}_3(e^{\pm\pi i/3}) =&\pm\frac{5\pi^3}{162}\\ \Im{\rm Li}_3(e^{2\pi i/3}) &=\frac{2\pi^3}{81}\\ {\rm Li}_2(e^{-\pi i/3}) &=\frac{\pi^2}{36}-i\sum^\infty_{n=1}\frac{\sin(n\pi/3)}{n^2}\\ &=\frac{\pi^2}{36}-\frac{i\sqrt{3}}{2}\sum^\infty_{n=0}\left[\frac{1}{(6n+1)^2}+\frac{1}{(6n+2)^2}-\frac{1}{(6n+4)^2}-\frac{1}{(6n+5)^2}\right]\\ &=\frac{\pi^2}{36}-\frac{i}{24\sqrt{3}}\left(\psi_1\left(\frac{1}{6}\right)+\psi_1\left(\frac{1}{3}\right)-\psi_1\left(\frac{2}{3}\right)-\psi_1\left(\frac{5}{6}\right)\right)\\ &=\frac{\pi^2}{36}-i\left(\frac{1}{2\sqrt{3}}\psi_1\left(\frac{1}{3}\right)-\frac{\pi^2}{3\sqrt{3}}\right) \end{align} Furthermore, the dilogarithm reflection formula states $${\rm Li}_2(z)+{\rm Li}_2(1-z)=\frac{\pi^2}{6}-\ln{z}\ln(1-z)$$ Hence \begin{align} {\rm Li}_2(1-e^{2\pi i/3}) &=\frac{\pi^2}{6}-\frac{2\pi i}{3}\left(\frac{\ln{3}}{2}-\frac{\pi i}{6}\right)-\left(-\frac{\pi^2}{18}+i\sum^\infty_{n=1}\frac{\sin(2n\pi/3)}{n^2}\right)\\ &=\frac{\pi^2}{6}-\frac{2\pi i}{3}\left(\frac{\ln{3}}{2}-\frac{\pi i}{6}\right)-\left(-\frac{\pi^2}{18}+\frac{i\sqrt{3}}{2}\sum^\infty_{n=0}\left[\frac{1}{(3n+1)^2}-\frac{1}{(3n+2)^2}\right]\right)\\ &=\frac{\pi^2}{9}-i\left(\frac{1}{3\sqrt{3}}\psi_1\left(\frac{1}{3}\right)-\frac{2\pi^2}{9\sqrt{3}}+\frac{\pi}{3}\ln{3}\right) \end{align}


Evaluation of $\mathcal{A}_3$

Similarly, we start with the evaluation of $\mathcal{B}_2$. \begin{align} \mathcal{B}_2 &=\int^\frac{\pi}{3}_\frac{\pi}{6}\ln^2{3}-4\ln{3}\ln(2\cos{x})+4x^2+4\operatorname{Re}\ln^2(1+e^{2ix})\ {\rm d}x\\ &=-\frac{\ln{3}}{3\sqrt{3}}\psi_1\left(\frac{1}{3}\right)+\frac{7\pi^3}{162}+\frac{2\pi^2}{9\sqrt{3}}\ln{3}+\frac{\pi}{6}\ln^2{3}+8\Re\sum^\infty_{n=1}\frac{(-1)^{n}H_{n-1}}{n}\int^\frac{\pi}{3}_\frac{\pi}{6}e^{2inx}\ {\rm d}x\\ &=-\frac{\ln{3}}{3\sqrt{3}}\psi_1\left(\frac{1}{3}\right)+\frac{7\pi^3}{162}+\frac{2\pi^2}{9\sqrt{3}}\ln{3}+\frac{\pi}{6}\ln^2{3}-4\sum^\infty_{n=1}\frac{1}{n^3}\left(\sin\left(\frac{2\pi n}{3}\right)-\sin\left(\frac{\pi n}{3}\right)\right)\\ &\ \ \ \ \ +4\Im\sum^\infty_{n=1}\frac{H_{n}}{n^2}\left(e^{2\pi in/3}-e^{\pi in/3}\right)\\ &=-\frac{\ln{3}}{3\sqrt{3}}\psi_1\left(\frac{1}{3}\right)+\frac{11\pi^3}{162}+\frac{2\pi^2}{9\sqrt{3}}\ln{3}+\frac{\pi}{6}\ln^2{3}\\ &\ \ \ \ \ +4\Im\left[{\rm Li}_3(z)-{\rm Li}_3(1-z)+{\rm Li}_2(1-z)\ln(1-z)+\frac{1}{2}\ln{z}\ln^2(1-z)+\zeta(3)\right]^{e^{2\pi i/3}}_{e^{\pi i/3}} \end{align} where I used the generating function of $\dfrac{H_n}{n^2}$. Using results derived in the previous section, \begin{align} &\ \ \ \ \Im\left[{\rm Li}_3(z)-{\rm Li}_3(1-z)+{\rm Li}_2(1-z)\ln(1-z)+\frac{1}{2}\ln{z}\ln^2(1-z)+\zeta(3)\right]^{e^{2\pi i/3}}_{e^{\pi i/3}}\\ &=\color{brown}{\frac{2\pi^3}{81}}-\color{green}{\frac{5\pi^3}{162}}+\color{purple}{\left(-\frac{5\pi^3}{162}\right)}-\Im{\rm Li}_3(1-e^{2\pi i/3})\\ &\ \ \ \ +\Im\color{blue}{\left(\frac{\pi^2}{9}-i\left(\frac{1}{3\sqrt{3}}\psi_1\left(\frac{1}{3}\right)-\frac{2\pi^2}{9\sqrt{3}}+\frac{\pi}{3}\ln{3}\right)\right)}\left(\frac{\ln{3}}{2}-\frac{\pi i}{6}\right)\\ &\ \ \ \ -\Im\color{red}{\left(\frac{\pi^2}{36}-i\left(\frac{1}{2\sqrt{3}}\psi_1\left(\frac{1}{3}\right)-\frac{\pi^2}{3\sqrt{3}}\right)\right)}\left(-\frac{\pi i}{3}\right)+\frac{\pi^3}{108}+\frac{\pi}{12}\ln^2{3}\\ &=-\Im{\rm Li}_3(1-e^{2\pi i/3})-\frac{\ln{3}}{6\sqrt{3}}\psi_1\left(\frac{1}{3}\right)-\frac{\pi^3}{27}+\frac{\pi^2}{9\sqrt{3}}\ln{3}-\frac{\pi}{12}\ln^2{3} \end{align} Therefore \begin{align} \mathcal{B}_2 &=-4\Im{\rm Li}_3(1-e^{2\pi i/3})-\frac{\ln{3}}{\sqrt{3}}\psi_1\left(\frac{1}{3}\right)-\frac{13\pi^3}{162}+\frac{2\pi^2}{3\sqrt{3}}\ln{3}-\frac{\pi}{6}\ln^2{3} \end{align} and finally, \begin{align} \mathcal{A}_3 &=3\sqrt{3}\left(-4\Im{\rm Li}_3(1-e^{2\pi i/3})-\frac{\ln{3}}{\sqrt{3}}\psi_1\left(\frac{1}{3}\right)-\frac{13\pi^3}{162}+\frac{2\pi^2}{3\sqrt{3}}\ln{3}-\frac{\pi}{6}\ln^2{3}\right)\\ &\ \ \ \ -6\left(-\frac{1}{3}\psi_1\left(\frac{1}{3}\right)+\frac{2\pi^2}{9}+\frac{\pi}{\sqrt{3}}\ln{3}+\frac{3}{2}\ln^2{3}-\frac{2\pi}{\sqrt{3}}-6\ln{3}+8\right)+\frac{3}{2}\ln^3{3}\\ &=\color{darkorange}{-12\sqrt{3}\Im{\rm Li}_3(1-e^{2\pi i/3})+(2-3\ln{3})\psi_1\left(\frac{1}{3}\right)+\frac{3}{2}\ln^3{3}-\left(\frac{\sqrt{3}\pi}{2}+9\right)\ln^2{3}}\\ &\ \ \ \ \color{darkorange}{+(2\pi^2-2\sqrt{3}\pi)\ln{3}-\left(\frac{13\sqrt{3}\pi^3}{54}+\frac{4\pi^2}{3}-4\sqrt{3}\pi-36\ln{3}+48\right)} \end{align}


I found the antiderivative: $$\begin{align}\int\ln^3\!\left(1+x+x^2\right)dx&=\xi\,\sqrt3\,\Big[\alpha^3-6\alpha^2+24\alpha-48\Big]\\&-\beta\,\sqrt3\,\Big[4\beta^2-3\alpha\ln3+6\alpha-24+6\ln3\Big]\phantom{\Huge|}\\&+6\,\sqrt3\,\Im\Big[(\alpha-2-2\beta\,i)\,\operatorname{Li}_2(\gamma)-2\,\operatorname{Li}_3(\gamma)\Big]\phantom{\Huge|}\end{align}$$ where $$\begin{align}&\color{maroon}{\alpha=\ln\!\left(1+x+x^2\right)}\\&\color{orange}{\beta=\arctan(2\,\xi)}\phantom{\Huge|}\\&\color{green}{\gamma=\frac12-i\,\xi}\phantom{\Huge|}\\&\color{blue}{\xi=\frac{1+2x}{2\sqrt3}}\phantom{\Huge|}\end{align}$$

It is valid and continuous at least for $x\ge0$, so it is good for our purposes.

Unfortunately, I cannot demonstrate any systematic approach that leads to this result, I got it with a series of lucky guesses and applications of PSLQ algorithm to determine rational coefficients, and finally proved its correctness using differentiation.

It yields the conjectured result modulo several polylogarithm identities that I'm still trying to prove.