Optimal. Leaf size=103 \[ -\frac{3 (1-x)}{8 \left (x^2+1\right )}+\frac{3 x}{16 \left (x^2+1\right )}+\frac{x+1}{8 \left (x^2+1\right )^2}+\frac{15}{16} \log \left (x^2+1\right )-\frac{1}{2} \log \left (x^2+x+1\right )+\frac{1}{8} \log (1-x)-\log (x)+\frac{7}{16} \tan ^{-1}(x)-\frac{\tan ^{-1}\left (\frac{2 x+1}{\sqrt{3}}\right )}{\sqrt{3}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.536711, antiderivative size = 103, normalized size of antiderivative = 1., number of steps used = 14, number of rules used = 10, integrand size = 32, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.312, Rules used = {6728, 639, 199, 203, 635, 260, 634, 618, 204, 628} \[ -\frac{3 (1-x)}{8 \left (x^2+1\right )}+\frac{3 x}{16 \left (x^2+1\right )}+\frac{x+1}{8 \left (x^2+1\right )^2}+\frac{15}{16} \log \left (x^2+1\right )-\frac{1}{2} \log \left (x^2+x+1\right )+\frac{1}{8} \log (1-x)-\log (x)+\frac{7}{16} \tan ^{-1}(x)-\frac{\tan ^{-1}\left (\frac{2 x+1}{\sqrt{3}}\right )}{\sqrt{3}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 6728
Rule 639
Rule 199
Rule 203
Rule 635
Rule 260
Rule 634
Rule 618
Rule 204
Rule 628
Rubi steps
\begin{align*} \int \frac{1+x^2+x^3}{(-1+x) x \left (1+x^2\right )^3 \left (1+x+x^2\right )} \, dx &=\int \left (\frac{1}{8 (-1+x)}-\frac{1}{x}+\frac{1-x}{2 \left (1+x^2\right )^3}+\frac{3 (1+x)}{4 \left (1+x^2\right )^2}+\frac{-1+15 x}{8 \left (1+x^2\right )}+\frac{-1-x}{1+x+x^2}\right ) \, dx\\ &=\frac{1}{8} \log (1-x)-\log (x)+\frac{1}{8} \int \frac{-1+15 x}{1+x^2} \, dx+\frac{1}{2} \int \frac{1-x}{\left (1+x^2\right )^3} \, dx+\frac{3}{4} \int \frac{1+x}{\left (1+x^2\right )^2} \, dx+\int \frac{-1-x}{1+x+x^2} \, dx\\ &=\frac{1+x}{8 \left (1+x^2\right )^2}-\frac{3 (1-x)}{8 \left (1+x^2\right )}+\frac{1}{8} \log (1-x)-\log (x)-\frac{1}{8} \int \frac{1}{1+x^2} \, dx+\frac{3}{8} \int \frac{1}{\left (1+x^2\right )^2} \, dx+\frac{3}{8} \int \frac{1}{1+x^2} \, dx-\frac{1}{2} \int \frac{1}{1+x+x^2} \, dx-\frac{1}{2} \int \frac{1+2 x}{1+x+x^2} \, dx+\frac{15}{8} \int \frac{x}{1+x^2} \, dx\\ &=\frac{1+x}{8 \left (1+x^2\right )^2}-\frac{3 (1-x)}{8 \left (1+x^2\right )}+\frac{3 x}{16 \left (1+x^2\right )}+\frac{1}{4} \tan ^{-1}(x)+\frac{1}{8} \log (1-x)-\log (x)+\frac{15}{16} \log \left (1+x^2\right )-\frac{1}{2} \log \left (1+x+x^2\right )+\frac{3}{16} \int \frac{1}{1+x^2} \, dx+\operatorname{Subst}\left (\int \frac{1}{-3-x^2} \, dx,x,1+2 x\right )\\ &=\frac{1+x}{8 \left (1+x^2\right )^2}-\frac{3 (1-x)}{8 \left (1+x^2\right )}+\frac{3 x}{16 \left (1+x^2\right )}+\frac{7}{16} \tan ^{-1}(x)-\frac{\tan ^{-1}\left (\frac{1+2 x}{\sqrt{3}}\right )}{\sqrt{3}}+\frac{1}{8} \log (1-x)-\log (x)+\frac{15}{16} \log \left (1+x^2\right )-\frac{1}{2} \log \left (1+x+x^2\right )\\ \end{align*}
Mathematica [A] time = 0.0439117, size = 93, normalized size = 0.9 \[ \frac{1}{48} \left (\frac{6 (x+1)}{\left (x^2+1\right )^2}+\frac{9 (3 x-2)}{x^2+1}+45 \log \left (x^2+1\right )-10 \log \left (x^2+x+1\right )-14 \log \left (1-x^3\right )+20 \log (1-x)-48 \log (x)+21 \tan ^{-1}(x)-16 \sqrt{3} \tan ^{-1}\left (\frac{2 x+1}{\sqrt{3}}\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.01, size = 73, normalized size = 0.7 \begin{align*}{\frac{1}{8\, \left ({x}^{2}+1 \right ) ^{2}} \left ({\frac{9\,{x}^{3}}{2}}-3\,{x}^{2}+{\frac{11\,x}{2}}-2 \right ) }+{\frac{15\,\ln \left ({x}^{2}+1 \right ) }{16}}+{\frac{7\,\arctan \left ( x \right ) }{16}}-\ln \left ( x \right ) +{\frac{\ln \left ( -1+x \right ) }{8}}-{\frac{\ln \left ({x}^{2}+x+1 \right ) }{2}}-{\frac{\sqrt{3}}{3}\arctan \left ({\frac{ \left ( 1+2\,x \right ) \sqrt{3}}{3}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.41266, size = 104, normalized size = 1.01 \begin{align*} -\frac{1}{3} \, \sqrt{3} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x + 1\right )}\right ) + \frac{9 \, x^{3} - 6 \, x^{2} + 11 \, x - 4}{16 \,{\left (x^{4} + 2 \, x^{2} + 1\right )}} + \frac{7}{16} \, \arctan \left (x\right ) - \frac{1}{2} \, \log \left (x^{2} + x + 1\right ) + \frac{15}{16} \, \log \left (x^{2} + 1\right ) + \frac{1}{8} \, \log \left (x - 1\right ) - \log \left (x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.1198, size = 387, normalized size = 3.76 \begin{align*} \frac{27 \, x^{3} - 16 \, \sqrt{3}{\left (x^{4} + 2 \, x^{2} + 1\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x + 1\right )}\right ) - 18 \, x^{2} + 21 \,{\left (x^{4} + 2 \, x^{2} + 1\right )} \arctan \left (x\right ) - 24 \,{\left (x^{4} + 2 \, x^{2} + 1\right )} \log \left (x^{2} + x + 1\right ) + 45 \,{\left (x^{4} + 2 \, x^{2} + 1\right )} \log \left (x^{2} + 1\right ) + 6 \,{\left (x^{4} + 2 \, x^{2} + 1\right )} \log \left (x - 1\right ) - 48 \,{\left (x^{4} + 2 \, x^{2} + 1\right )} \log \left (x\right ) + 33 \, x - 12}{48 \,{\left (x^{4} + 2 \, x^{2} + 1\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.460151, size = 88, normalized size = 0.85 \begin{align*} - \log{\left (x \right )} + \frac{\log{\left (x - 1 \right )}}{8} + \frac{15 \log{\left (x^{2} + 1 \right )}}{16} - \frac{\log{\left (x^{2} + x + 1 \right )}}{2} + \frac{7 \operatorname{atan}{\left (x \right )}}{16} - \frac{\sqrt{3} \operatorname{atan}{\left (\frac{2 \sqrt{3} x}{3} + \frac{\sqrt{3}}{3} \right )}}{3} + \frac{9 x^{3} - 6 x^{2} + 11 x - 4}{16 x^{4} + 32 x^{2} + 16} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.05815, size = 100, normalized size = 0.97 \begin{align*} -\frac{1}{3} \, \sqrt{3} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x + 1\right )}\right ) + \frac{9 \, x^{3} - 6 \, x^{2} + 11 \, x - 4}{16 \,{\left (x^{2} + 1\right )}^{2}} + \frac{7}{16} \, \arctan \left (x\right ) - \frac{1}{2} \, \log \left (x^{2} + x + 1\right ) + \frac{15}{16} \, \log \left (x^{2} + 1\right ) + \frac{1}{8} \, \log \left ({\left | x - 1 \right |}\right ) - \log \left ({\left | x \right |}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]