Integrand size = 21, antiderivative size = 311 \[ \int \frac {x^2 \log \left (1+x+x^2\right )}{2+3 x+x^2} \, dx=-2 x+\sqrt {3} \arctan \left (\frac {1+2 x}{\sqrt {3}}\right )-\log (2+2 x) \log \left (-\frac {1-i \sqrt {3}+2 x}{1+i \sqrt {3}}\right )+4 \log (4+2 x) \log \left (-\frac {1-i \sqrt {3}+2 x}{3+i \sqrt {3}}\right )-\log (2+2 x) \log \left (-\frac {1+i \sqrt {3}+2 x}{1-i \sqrt {3}}\right )+4 \log (4+2 x) \log \left (-\frac {1+i \sqrt {3}+2 x}{3-i \sqrt {3}}\right )+\frac {1}{2} \log \left (1+x+x^2\right )+x \log \left (1+x+x^2\right )+\log (2+2 x) \log \left (1+x+x^2\right )-4 \log (4+2 x) \log \left (1+x+x^2\right )-\operatorname {PolyLog}\left (2,\frac {2 (1+x)}{1-i \sqrt {3}}\right )-\operatorname {PolyLog}\left (2,\frac {2 (1+x)}{1+i \sqrt {3}}\right )+4 \operatorname {PolyLog}\left (2,\frac {2 (2+x)}{3-i \sqrt {3}}\right )+4 \operatorname {PolyLog}\left (2,\frac {2 (2+x)}{3+i \sqrt {3}}\right ) \]
[Out]
Time = 0.33 (sec) , antiderivative size = 311, normalized size of antiderivative = 1.00, number of steps used = 28, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.571, Rules used = {2608, 2603, 787, 648, 632, 210, 642, 2604, 2465, 2441, 2440, 2438} \[ \int \frac {x^2 \log \left (1+x+x^2\right )}{2+3 x+x^2} \, dx=\sqrt {3} \arctan \left (\frac {2 x+1}{\sqrt {3}}\right )-\operatorname {PolyLog}\left (2,\frac {2 (x+1)}{1-i \sqrt {3}}\right )-\operatorname {PolyLog}\left (2,\frac {2 (x+1)}{1+i \sqrt {3}}\right )+4 \operatorname {PolyLog}\left (2,\frac {2 (x+2)}{3-i \sqrt {3}}\right )+4 \operatorname {PolyLog}\left (2,\frac {2 (x+2)}{3+i \sqrt {3}}\right )+x \log \left (x^2+x+1\right )+\log (2 x+2) \log \left (x^2+x+1\right )-4 \log (2 x+4) \log \left (x^2+x+1\right )+\frac {1}{2} \log \left (x^2+x+1\right )-2 x-\log (2 x+2) \log \left (-\frac {2 x-i \sqrt {3}+1}{1+i \sqrt {3}}\right )+4 \log (2 x+4) \log \left (-\frac {2 x-i \sqrt {3}+1}{3+i \sqrt {3}}\right )-\log (2 x+2) \log \left (-\frac {2 x+i \sqrt {3}+1}{1-i \sqrt {3}}\right )+4 \log (2 x+4) \log \left (-\frac {2 x+i \sqrt {3}+1}{3-i \sqrt {3}}\right ) \]
[In]
[Out]
Rule 210
Rule 632
Rule 642
Rule 648
Rule 787
Rule 2438
Rule 2440
Rule 2441
Rule 2465
Rule 2603
Rule 2604
Rule 2608
Rubi steps \begin{align*} \text {integral}& = \int \left (\log \left (1+x+x^2\right )-\frac {(2+3 x) \log \left (1+x+x^2\right )}{2+3 x+x^2}\right ) \, dx \\ & = \int \log \left (1+x+x^2\right ) \, dx-\int \frac {(2+3 x) \log \left (1+x+x^2\right )}{2+3 x+x^2} \, dx \\ & = x \log \left (1+x+x^2\right )-\int \frac {x (1+2 x)}{1+x+x^2} \, dx-\int \left (-\frac {2 \log \left (1+x+x^2\right )}{2+2 x}+\frac {8 \log \left (1+x+x^2\right )}{4+2 x}\right ) \, dx \\ & = -2 x+x \log \left (1+x+x^2\right )+2 \int \frac {\log \left (1+x+x^2\right )}{2+2 x} \, dx-8 \int \frac {\log \left (1+x+x^2\right )}{4+2 x} \, dx-\int \frac {-2-x}{1+x+x^2} \, dx \\ & = -2 x+x \log \left (1+x+x^2\right )+\log (2+2 x) \log \left (1+x+x^2\right )-4 \log (4+2 x) \log \left (1+x+x^2\right )+\frac {1}{2} \int \frac {1+2 x}{1+x+x^2} \, dx+\frac {3}{2} \int \frac {1}{1+x+x^2} \, dx+4 \int \frac {(1+2 x) \log (4+2 x)}{1+x+x^2} \, dx-\int \frac {(1+2 x) \log (2+2 x)}{1+x+x^2} \, dx \\ & = -2 x+\frac {1}{2} \log \left (1+x+x^2\right )+x \log \left (1+x+x^2\right )+\log (2+2 x) \log \left (1+x+x^2\right )-4 \log (4+2 x) \log \left (1+x+x^2\right )-3 \text {Subst}\left (\int \frac {1}{-3-x^2} \, dx,x,1+2 x\right )+4 \int \left (\frac {2 \log (4+2 x)}{1-i \sqrt {3}+2 x}+\frac {2 \log (4+2 x)}{1+i \sqrt {3}+2 x}\right ) \, dx-\int \left (\frac {2 \log (2+2 x)}{1-i \sqrt {3}+2 x}+\frac {2 \log (2+2 x)}{1+i \sqrt {3}+2 x}\right ) \, dx \\ & = -2 x+\sqrt {3} \tan ^{-1}\left (\frac {1+2 x}{\sqrt {3}}\right )+\frac {1}{2} \log \left (1+x+x^2\right )+x \log \left (1+x+x^2\right )+\log (2+2 x) \log \left (1+x+x^2\right )-4 \log (4+2 x) \log \left (1+x+x^2\right )-2 \int \frac {\log (2+2 x)}{1-i \sqrt {3}+2 x} \, dx-2 \int \frac {\log (2+2 x)}{1+i \sqrt {3}+2 x} \, dx+8 \int \frac {\log (4+2 x)}{1-i \sqrt {3}+2 x} \, dx+8 \int \frac {\log (4+2 x)}{1+i \sqrt {3}+2 x} \, dx \\ & = -2 x+\sqrt {3} \tan ^{-1}\left (\frac {1+2 x}{\sqrt {3}}\right )-\log (2+2 x) \log \left (-\frac {1-i \sqrt {3}+2 x}{1+i \sqrt {3}}\right )+4 \log (4+2 x) \log \left (-\frac {1-i \sqrt {3}+2 x}{3+i \sqrt {3}}\right )-\log (2+2 x) \log \left (-\frac {1+i \sqrt {3}+2 x}{1-i \sqrt {3}}\right )+4 \log (4+2 x) \log \left (-\frac {1+i \sqrt {3}+2 x}{3-i \sqrt {3}}\right )+\frac {1}{2} \log \left (1+x+x^2\right )+x \log \left (1+x+x^2\right )+\log (2+2 x) \log \left (1+x+x^2\right )-4 \log (4+2 x) \log \left (1+x+x^2\right )+2 \int \frac {\log \left (\frac {2 \left (1-i \sqrt {3}+2 x\right )}{-4+2 \left (1-i \sqrt {3}\right )}\right )}{2+2 x} \, dx+2 \int \frac {\log \left (\frac {2 \left (1+i \sqrt {3}+2 x\right )}{-4+2 \left (1+i \sqrt {3}\right )}\right )}{2+2 x} \, dx-8 \int \frac {\log \left (\frac {2 \left (1-i \sqrt {3}+2 x\right )}{-8+2 \left (1-i \sqrt {3}\right )}\right )}{4+2 x} \, dx-8 \int \frac {\log \left (\frac {2 \left (1+i \sqrt {3}+2 x\right )}{-8+2 \left (1+i \sqrt {3}\right )}\right )}{4+2 x} \, dx \\ & = -2 x+\sqrt {3} \tan ^{-1}\left (\frac {1+2 x}{\sqrt {3}}\right )-\log (2+2 x) \log \left (-\frac {1-i \sqrt {3}+2 x}{1+i \sqrt {3}}\right )+4 \log (4+2 x) \log \left (-\frac {1-i \sqrt {3}+2 x}{3+i \sqrt {3}}\right )-\log (2+2 x) \log \left (-\frac {1+i \sqrt {3}+2 x}{1-i \sqrt {3}}\right )+4 \log (4+2 x) \log \left (-\frac {1+i \sqrt {3}+2 x}{3-i \sqrt {3}}\right )+\frac {1}{2} \log \left (1+x+x^2\right )+x \log \left (1+x+x^2\right )+\log (2+2 x) \log \left (1+x+x^2\right )-4 \log (4+2 x) \log \left (1+x+x^2\right )-4 \text {Subst}\left (\int \frac {\log \left (1+\frac {2 x}{-8+2 \left (1-i \sqrt {3}\right )}\right )}{x} \, dx,x,4+2 x\right )-4 \text {Subst}\left (\int \frac {\log \left (1+\frac {2 x}{-8+2 \left (1+i \sqrt {3}\right )}\right )}{x} \, dx,x,4+2 x\right )+\text {Subst}\left (\int \frac {\log \left (1+\frac {2 x}{-4+2 \left (1-i \sqrt {3}\right )}\right )}{x} \, dx,x,2+2 x\right )+\text {Subst}\left (\int \frac {\log \left (1+\frac {2 x}{-4+2 \left (1+i \sqrt {3}\right )}\right )}{x} \, dx,x,2+2 x\right ) \\ & = -2 x+\sqrt {3} \tan ^{-1}\left (\frac {1+2 x}{\sqrt {3}}\right )-\log (2+2 x) \log \left (-\frac {1-i \sqrt {3}+2 x}{1+i \sqrt {3}}\right )+4 \log (4+2 x) \log \left (-\frac {1-i \sqrt {3}+2 x}{3+i \sqrt {3}}\right )-\log (2+2 x) \log \left (-\frac {1+i \sqrt {3}+2 x}{1-i \sqrt {3}}\right )+4 \log (4+2 x) \log \left (-\frac {1+i \sqrt {3}+2 x}{3-i \sqrt {3}}\right )+\frac {1}{2} \log \left (1+x+x^2\right )+x \log \left (1+x+x^2\right )+\log (2+2 x) \log \left (1+x+x^2\right )-4 \log (4+2 x) \log \left (1+x+x^2\right )-\text {Li}_2\left (\frac {2 (1+x)}{1+i \sqrt {3}}\right )-\text {Li}_2\left (\frac {2 i (1+x)}{i+\sqrt {3}}\right )+4 \text {Li}_2\left (\frac {2 (2+x)}{3-i \sqrt {3}}\right )+4 \text {Li}_2\left (\frac {2 (2+x)}{3+i \sqrt {3}}\right ) \\ \end{align*}
Time = 0.12 (sec) , antiderivative size = 290, normalized size of antiderivative = 0.93 \[ \int \frac {x^2 \log \left (1+x+x^2\right )}{2+3 x+x^2} \, dx=-2 x+\sqrt {3} \arctan \left (\frac {1+2 x}{\sqrt {3}}\right )-\log \left (\frac {-i+\sqrt {3}-2 i x}{i+\sqrt {3}}\right ) \log (2 (1+x))-\log \left (\frac {i+\sqrt {3}+2 i x}{-i+\sqrt {3}}\right ) \log (2 (1+x))+\frac {1}{2} \log \left (1+x+x^2\right )+x \log \left (1+x+x^2\right )+\log (2 (1+x)) \log \left (1+x+x^2\right )-4 \log (2 (2+x)) \log \left (1+x+x^2\right )-\operatorname {PolyLog}\left (2,\frac {2 (1+x)}{1+i \sqrt {3}}\right )-\operatorname {PolyLog}\left (2,\frac {2 i (1+x)}{i+\sqrt {3}}\right )+4 \left (\left (\log \left (\frac {-i+\sqrt {3}-2 i x}{3 i+\sqrt {3}}\right )+\log \left (\frac {i+\sqrt {3}+2 i x}{-3 i+\sqrt {3}}\right )\right ) \log (2 (2+x))+\operatorname {PolyLog}\left (2,\frac {2 (2+x)}{3+i \sqrt {3}}\right )+\operatorname {PolyLog}\left (2,\frac {2 i (2+x)}{3 i+\sqrt {3}}\right )\right ) \]
[In]
[Out]
Time = 1.38 (sec) , antiderivative size = 279, normalized size of antiderivative = 0.90
method | result | size |
default | \(-2 x +\frac {\ln \left (x^{2}+x +1\right )}{2}+x \ln \left (x^{2}+x +1\right )+\arctan \left (\frac {\left (1+2 x \right ) \sqrt {3}}{3}\right ) \sqrt {3}-4 \ln \left (x +2\right ) \ln \left (x^{2}+x +1\right )+4 \ln \left (x +2\right ) \ln \left (\frac {-1-2 x +i \sqrt {3}}{3+i \sqrt {3}}\right )+4 \ln \left (x +2\right ) \ln \left (\frac {1+2 x +i \sqrt {3}}{-3+i \sqrt {3}}\right )+4 \operatorname {dilog}\left (\frac {-1-2 x +i \sqrt {3}}{3+i \sqrt {3}}\right )+4 \operatorname {dilog}\left (\frac {1+2 x +i \sqrt {3}}{-3+i \sqrt {3}}\right )+\ln \left (x +1\right ) \ln \left (x^{2}+x +1\right )-\ln \left (x +1\right ) \ln \left (\frac {-1-2 x +i \sqrt {3}}{1+i \sqrt {3}}\right )-\ln \left (x +1\right ) \ln \left (\frac {1+2 x +i \sqrt {3}}{i \sqrt {3}-1}\right )-\operatorname {dilog}\left (\frac {-1-2 x +i \sqrt {3}}{1+i \sqrt {3}}\right )-\operatorname {dilog}\left (\frac {1+2 x +i \sqrt {3}}{i \sqrt {3}-1}\right )\) | \(279\) |
risch | \(-2 x +\frac {\ln \left (x^{2}+x +1\right )}{2}+x \ln \left (x^{2}+x +1\right )+\arctan \left (\frac {\left (1+2 x \right ) \sqrt {3}}{3}\right ) \sqrt {3}-4 \ln \left (x +2\right ) \ln \left (x^{2}+x +1\right )+4 \ln \left (x +2\right ) \ln \left (\frac {-1-2 x +i \sqrt {3}}{3+i \sqrt {3}}\right )+4 \ln \left (x +2\right ) \ln \left (\frac {1+2 x +i \sqrt {3}}{-3+i \sqrt {3}}\right )+4 \operatorname {dilog}\left (\frac {-1-2 x +i \sqrt {3}}{3+i \sqrt {3}}\right )+4 \operatorname {dilog}\left (\frac {1+2 x +i \sqrt {3}}{-3+i \sqrt {3}}\right )+\ln \left (x +1\right ) \ln \left (x^{2}+x +1\right )-\ln \left (x +1\right ) \ln \left (\frac {-1-2 x +i \sqrt {3}}{1+i \sqrt {3}}\right )-\ln \left (x +1\right ) \ln \left (\frac {1+2 x +i \sqrt {3}}{i \sqrt {3}-1}\right )-\operatorname {dilog}\left (\frac {-1-2 x +i \sqrt {3}}{1+i \sqrt {3}}\right )-\operatorname {dilog}\left (\frac {1+2 x +i \sqrt {3}}{i \sqrt {3}-1}\right )\) | \(279\) |
parts | \(-2 x +\frac {\ln \left (x^{2}+x +1\right )}{2}+x \ln \left (x^{2}+x +1\right )+\arctan \left (\frac {\left (1+2 x \right ) \sqrt {3}}{3}\right ) \sqrt {3}-4 \ln \left (x +2\right ) \ln \left (x^{2}+x +1\right )+4 \ln \left (x +2\right ) \ln \left (\frac {-1-2 x +i \sqrt {3}}{3+i \sqrt {3}}\right )+4 \ln \left (x +2\right ) \ln \left (\frac {1+2 x +i \sqrt {3}}{-3+i \sqrt {3}}\right )+4 \operatorname {dilog}\left (\frac {-1-2 x +i \sqrt {3}}{3+i \sqrt {3}}\right )+4 \operatorname {dilog}\left (\frac {1+2 x +i \sqrt {3}}{-3+i \sqrt {3}}\right )+\ln \left (x +1\right ) \ln \left (x^{2}+x +1\right )-\ln \left (x +1\right ) \ln \left (\frac {-1-2 x +i \sqrt {3}}{1+i \sqrt {3}}\right )-\ln \left (x +1\right ) \ln \left (\frac {1+2 x +i \sqrt {3}}{i \sqrt {3}-1}\right )-\operatorname {dilog}\left (\frac {-1-2 x +i \sqrt {3}}{1+i \sqrt {3}}\right )-\operatorname {dilog}\left (\frac {1+2 x +i \sqrt {3}}{i \sqrt {3}-1}\right )\) | \(279\) |
[In]
[Out]
\[ \int \frac {x^2 \log \left (1+x+x^2\right )}{2+3 x+x^2} \, dx=\int { \frac {x^{2} \log \left (x^{2} + x + 1\right )}{x^{2} + 3 \, x + 2} \,d x } \]
[In]
[Out]
\[ \int \frac {x^2 \log \left (1+x+x^2\right )}{2+3 x+x^2} \, dx=\int \frac {x^{2} \log {\left (x^{2} + x + 1 \right )}}{\left (x + 1\right ) \left (x + 2\right )}\, dx \]
[In]
[Out]
\[ \int \frac {x^2 \log \left (1+x+x^2\right )}{2+3 x+x^2} \, dx=\int { \frac {x^{2} \log \left (x^{2} + x + 1\right )}{x^{2} + 3 \, x + 2} \,d x } \]
[In]
[Out]
\[ \int \frac {x^2 \log \left (1+x+x^2\right )}{2+3 x+x^2} \, dx=\int { \frac {x^{2} \log \left (x^{2} + x + 1\right )}{x^{2} + 3 \, x + 2} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {x^2 \log \left (1+x+x^2\right )}{2+3 x+x^2} \, dx=\int \frac {x^2\,\ln \left (x^2+x+1\right )}{x^2+3\,x+2} \,d x \]
[In]
[Out]