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.242529, antiderivative size = 44, normalized size of antiderivative = 1., 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 1593
Rule 6725
Rule 634
Rule 618
Rule 204
Rule 628
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.0249415, size = 44, normalized size = 1. \[ \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]
________________________________________________________________________________________
Maple [A] time = 0.008, size = 42, normalized size = 1. \begin{align*} \ln \left ( x \right ) +\ln \left ({x}^{2}-x+1 \right ) +{\frac{2\,\sqrt{3}}{3}\arctan \left ({\frac{ \left ( 2\,x-1 \right ) \sqrt{3}}{3}} \right ) }-3\, \left ( 1+x \right ) ^{-1}-2\,\ln \left ( 1+x \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.48511, size = 55, normalized size = 1.25 \begin{align*} \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 \left (x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.41565, size = 186, normalized size = 4.23 \begin{align*} \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 \left (x\right ) - 9}{3 \,{\left (x + 1\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.186507, size = 49, normalized size = 1.11 \begin{align*} \log{\left (x \right )} - 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} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.20969, size = 58, normalized size = 1.32 \begin{align*} \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 ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]