Optimal. Leaf size=44 \[ \log \left (x^2-x+1\right )-\frac {3}{x+1}+\log (x)-2 \log (x+1)-\frac {2 \tan ^{-1}\left (\frac {1-2 x}{\sqrt {3}}\right )}{\sqrt {3}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.24, antiderivative size = 44, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {1593, 6725, 634, 618, 204, 628} \[ \log \left (x^2-x+1\right )-\frac {3}{x+1}+\log (x)-2 \log (x+1)-\frac {2 \tan ^{-1}\left (\frac {1-2 x}{\sqrt {3}}\right )}{\sqrt {3}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 204
Rule 618
Rule 628
Rule 634
Rule 1593
Rule 6725
Rubi steps
\begin {align*} \int \frac {1+2 x-x^2+8 x^3+x^4}{\left (x+x^2\right ) \left (1+x^3\right )} \, dx &=\int \frac {1+2 x-x^2+8 x^3+x^4}{x (1+x) \left (1+x^3\right )} \, dx\\ &=\int \left (\frac {1}{x}+\frac {3}{(1+x)^2}-\frac {2}{1+x}+\frac {2 x}{1-x+x^2}\right ) \, dx\\ &=-\frac {3}{1+x}+\log (x)-2 \log (1+x)+2 \int \frac {x}{1-x+x^2} \, dx\\ &=-\frac {3}{1+x}+\log (x)-2 \log (1+x)+\int \frac {1}{1-x+x^2} \, dx+\int \frac {-1+2 x}{1-x+x^2} \, dx\\ &=-\frac {3}{1+x}+\log (x)-2 \log (1+x)+\log \left (1-x+x^2\right )-2 \operatorname {Subst}\left (\int \frac {1}{-3-x^2} \, dx,x,-1+2 x\right )\\ &=-\frac {3}{1+x}-\frac {2 \tan ^{-1}\left (\frac {1-2 x}{\sqrt {3}}\right )}{\sqrt {3}}+\log (x)-2 \log (1+x)+\log \left (1-x+x^2\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.02, size = 44, normalized size = 1.00 \[ \log \left (x^2-x+1\right )-\frac {3}{x+1}+\log (x)-2 \log (x+1)+\frac {2 \tan ^{-1}\left (\frac {2 x-1}{\sqrt {3}}\right )}{\sqrt {3}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.88, size = 58, normalized size = 1.32 \[ \frac {2 \, \sqrt {3} {\left (x + 1\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )}\right ) + 3 \, {\left (x + 1\right )} \log \left (x^{2} - x + 1\right ) - 6 \, {\left (x + 1\right )} \log \left (x + 1\right ) + 3 \, {\left (x + 1\right )} \log \relax (x) - 9}{3 \, {\left (x + 1\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.36, size = 43, normalized size = 0.98 \[ \frac {2}{3} \, \sqrt {3} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )}\right ) - \frac {3}{x + 1} + \log \left (x^{2} - x + 1\right ) - 2 \, \log \left ({\left | x + 1 \right |}\right ) + \log \left ({\left | x \right |}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.01, size = 42, normalized size = 0.95 \[ \frac {2 \sqrt {3}\, \arctan \left (\frac {\left (2 x -1\right ) \sqrt {3}}{3}\right )}{3}+\ln \relax (x )-2 \ln \left (x +1\right )+\ln \left (x^{2}-x +1\right )-\frac {3}{x +1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 2.25, size = 41, normalized size = 0.93 \[ \frac {2}{3} \, \sqrt {3} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )}\right ) - \frac {3}{x + 1} + \log \left (x^{2} - x + 1\right ) - 2 \, \log \left (x + 1\right ) + \log \relax (x) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.13, size = 55, normalized size = 1.25 \[ \ln \relax (x)-2\,\ln \left (x+1\right )-\frac {3}{x+1}-\ln \left (x-\frac {1}{2}-\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (-1+\frac {\sqrt {3}\,1{}\mathrm {i}}{3}\right )+\ln \left (x-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (1+\frac {\sqrt {3}\,1{}\mathrm {i}}{3}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.21, size = 49, normalized size = 1.11 \[ \log {\relax (x )} - 2 \log {\left (x + 1 \right )} + \log {\left (x^{2} - x + 1 \right )} + \frac {2 \sqrt {3} \operatorname {atan}{\left (\frac {2 \sqrt {3} x}{3} - \frac {\sqrt {3}}{3} \right )}}{3} - \frac {3}{x + 1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________