Optimal. Leaf size=103 \[ \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 ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.33, antiderivative size = 103, normalized size of antiderivative = 1.00, 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 = {6860, 653,
205, 209, 649, 266, 648, 632, 210, 642} \begin {gather*} \frac {7 \text {ArcTan}(x)}{16}-\frac {\text {ArcTan}\left (\frac {2 x+1}{\sqrt {3}}\right )}{\sqrt {3}}-\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) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 205
Rule 209
Rule 210
Rule 266
Rule 632
Rule 642
Rule 648
Rule 649
Rule 653
Rule 6860
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+\text {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.03, size = 93, normalized size = 0.90 \begin {gather*} \frac {1}{48} \left (\frac {6 (1+x)}{\left (1+x^2\right )^2}+\frac {9 (-2+3 x)}{1+x^2}+21 \tan ^{-1}(x)-16 \sqrt {3} \tan ^{-1}\left (\frac {1+2 x}{\sqrt {3}}\right )+20 \log (1-x)-48 \log (x)+45 \log \left (1+x^2\right )-10 \log \left (1+x+x^2\right )-14 \log \left (1-x^3\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.31, size = 73, normalized size = 0.71
method | result | size |
risch | \(\frac {\frac {9}{16} x^{3}-\frac {3}{8} x^{2}+\frac {11}{16} x -\frac {1}{4}}{\left (x^{2}+1\right )^{2}}+\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}\, \arctan \left (\frac {2 \left (x +\frac {1}{2}\right ) \sqrt {3}}{3}\right )}{3}\) | \(70\) |
default | \(-\frac {\ln \left (x^{2}+x +1\right )}{2}-\frac {\arctan \left (\frac {\left (2 x +1\right ) \sqrt {3}}{3}\right ) \sqrt {3}}{3}+\frac {\ln \left (-1+x \right )}{8}+\frac {\frac {9}{2} x^{3}-3 x^{2}+\frac {11}{2} x -2}{8 \left (x^{2}+1\right )^{2}}+\frac {15 \ln \left (x^{2}+1\right )}{16}+\frac {7 \arctan \left (x \right )}{16}-\ln \left (x \right )\) | \(73\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.47, size = 77, normalized size = 0.75 \begin {gather*} -\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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.42, size = 136, normalized size = 1.32 \begin {gather*} \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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.27, size = 88, normalized size = 0.85 \begin {gather*} - \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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 4.76, size = 74, normalized size = 0.72 \begin {gather*} -\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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.20, size = 96, normalized size = 0.93 \begin {gather*} \frac {\ln \left (x-1\right )}{8}-\ln \left (x\right )+\ln \left (x+\frac {1}{2}-\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{6}\right )-\ln \left (x+\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{6}\right )+\frac {\frac {9\,x^3}{16}-\frac {3\,x^2}{8}+\frac {11\,x}{16}-\frac {1}{4}}{x^4+2\,x^2+1}+\ln \left (x-\mathrm {i}\right )\,\left (\frac {15}{16}-\frac {7}{32}{}\mathrm {i}\right )+\ln \left (x+1{}\mathrm {i}\right )\,\left (\frac {15}{16}+\frac {7}{32}{}\mathrm {i}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________