Optimal. Leaf size=111 \[ -\frac {1}{2} \sqrt {\frac {1}{3} \left (3+2 \sqrt {3}\right )} \text {ArcTan}\left (\frac {\sqrt {3+2 \sqrt {3}} \sqrt {1+x^3}}{1-x+x^2}\right )-\frac {1}{2} \sqrt {\frac {1}{3} \left (-3+2 \sqrt {3}\right )} \tanh ^{-1}\left (\frac {\sqrt {-3+2 \sqrt {3}} \sqrt {1+x^3}}{1-x+x^2}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [C] Result contains higher order function than in optimal. Order 4 vs. order 3 in
optimal.
time = 0.58, antiderivative size = 412, normalized size of antiderivative = 3.71, number of steps
used = 13, number of rules used = 6, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {6860, 224,
2160, 2165, 212, 209} \begin {gather*} -\frac {\left (2+\sqrt {3}\right )^{3/2} (x+1) \sqrt {\frac {x^2-x+1}{\left (x+\sqrt {3}+1\right )^2}} F\left (\text {ArcSin}\left (\frac {x-\sqrt {3}+1}{x+\sqrt {3}+1}\right )|-7-4 \sqrt {3}\right )}{2 \sqrt [4]{3} \sqrt {\frac {x+1}{\left (x+\sqrt {3}+1\right )^2}} \sqrt {x^3+1}}+\frac {2 \sqrt {2+\sqrt {3}} (x+1) \sqrt {\frac {x^2-x+1}{\left (x+\sqrt {3}+1\right )^2}} F\left (\text {ArcSin}\left (\frac {x-\sqrt {3}+1}{x+\sqrt {3}+1}\right )|-7-4 \sqrt {3}\right )}{\sqrt [4]{3} \sqrt {\frac {x+1}{\left (x+\sqrt {3}+1\right )^2}} \sqrt {x^3+1}}-\frac {\sqrt {2-\sqrt {3}} (x+1) \sqrt {\frac {x^2-x+1}{\left (x+\sqrt {3}+1\right )^2}} F\left (\text {ArcSin}\left (\frac {x-\sqrt {3}+1}{x+\sqrt {3}+1}\right )|-7-4 \sqrt {3}\right )}{2 \sqrt [4]{3} \sqrt {\frac {x+1}{\left (x+\sqrt {3}+1\right )^2}} \sqrt {x^3+1}}-\frac {1}{2} \sqrt {\frac {1}{3} \left (3+2 \sqrt {3}\right )} \text {ArcTan}\left (\frac {\sqrt {3+2 \sqrt {3}} (x+1)}{\sqrt {x^3+1}}\right )-\frac {1}{2} \sqrt {\frac {1}{3} \left (2 \sqrt {3}-3\right )} \tanh ^{-1}\left (\frac {\sqrt {2 \sqrt {3}-3} (x+1)}{\sqrt {x^3+1}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 212
Rule 224
Rule 2160
Rule 2165
Rule 6860
Rubi steps
\begin {align*} \int \frac {1-x+x^2}{\left (-2+2 x+x^2\right ) \sqrt {1+x^3}} \, dx &=\int \left (\frac {1}{\sqrt {1+x^3}}+\frac {3 (1-x)}{\left (-2+2 x+x^2\right ) \sqrt {1+x^3}}\right ) \, dx\\ &=3 \int \frac {1-x}{\left (-2+2 x+x^2\right ) \sqrt {1+x^3}} \, dx+\int \frac {1}{\sqrt {1+x^3}} \, dx\\ &=\frac {2 \sqrt {2+\sqrt {3}} (1+x) \sqrt {\frac {1-x+x^2}{\left (1+\sqrt {3}+x\right )^2}} F\left (\sin ^{-1}\left (\frac {1-\sqrt {3}+x}{1+\sqrt {3}+x}\right )|-7-4 \sqrt {3}\right )}{\sqrt [4]{3} \sqrt {\frac {1+x}{\left (1+\sqrt {3}+x\right )^2}} \sqrt {1+x^3}}+3 \int \left (\frac {-1+\frac {2}{\sqrt {3}}}{\left (2-2 \sqrt {3}+2 x\right ) \sqrt {1+x^3}}+\frac {-1-\frac {2}{\sqrt {3}}}{\left (2+2 \sqrt {3}+2 x\right ) \sqrt {1+x^3}}\right ) \, dx\\ &=\frac {2 \sqrt {2+\sqrt {3}} (1+x) \sqrt {\frac {1-x+x^2}{\left (1+\sqrt {3}+x\right )^2}} F\left (\sin ^{-1}\left (\frac {1-\sqrt {3}+x}{1+\sqrt {3}+x}\right )|-7-4 \sqrt {3}\right )}{\sqrt [4]{3} \sqrt {\frac {1+x}{\left (1+\sqrt {3}+x\right )^2}} \sqrt {1+x^3}}+\left (-3+2 \sqrt {3}\right ) \int \frac {1}{\left (2-2 \sqrt {3}+2 x\right ) \sqrt {1+x^3}} \, dx-\left (3+2 \sqrt {3}\right ) \int \frac {1}{\left (2+2 \sqrt {3}+2 x\right ) \sqrt {1+x^3}} \, dx\\ &=\frac {2 \sqrt {2+\sqrt {3}} (1+x) \sqrt {\frac {1-x+x^2}{\left (1+\sqrt {3}+x\right )^2}} F\left (\sin ^{-1}\left (\frac {1-\sqrt {3}+x}{1+\sqrt {3}+x}\right )|-7-4 \sqrt {3}\right )}{\sqrt [4]{3} \sqrt {\frac {1+x}{\left (1+\sqrt {3}+x\right )^2}} \sqrt {1+x^3}}+\frac {1}{192} \left (2-\sqrt {3}\right ) \int \frac {96 \left (1+\sqrt {3}\right )+96 x}{\left (2-2 \sqrt {3}+2 x\right ) \sqrt {1+x^3}} \, dx+\frac {1}{4} \left (-2+\sqrt {3}\right ) \int \frac {1}{\sqrt {1+x^3}} \, dx+\frac {1}{192} \left (2+\sqrt {3}\right ) \int \frac {96 \left (1-\sqrt {3}\right )+96 x}{\left (2+2 \sqrt {3}+2 x\right ) \sqrt {1+x^3}} \, dx-\frac {1}{4} \left (2+\sqrt {3}\right ) \int \frac {1}{\sqrt {1+x^3}} \, dx\\ &=-\frac {\sqrt {2-\sqrt {3}} (1+x) \sqrt {\frac {1-x+x^2}{\left (1+\sqrt {3}+x\right )^2}} F\left (\sin ^{-1}\left (\frac {1-\sqrt {3}+x}{1+\sqrt {3}+x}\right )|-7-4 \sqrt {3}\right )}{2 \sqrt [4]{3} \sqrt {\frac {1+x}{\left (1+\sqrt {3}+x\right )^2}} \sqrt {1+x^3}}+\frac {2 \sqrt {2+\sqrt {3}} (1+x) \sqrt {\frac {1-x+x^2}{\left (1+\sqrt {3}+x\right )^2}} F\left (\sin ^{-1}\left (\frac {1-\sqrt {3}+x}{1+\sqrt {3}+x}\right )|-7-4 \sqrt {3}\right )}{\sqrt [4]{3} \sqrt {\frac {1+x}{\left (1+\sqrt {3}+x\right )^2}} \sqrt {1+x^3}}-\frac {\left (2+\sqrt {3}\right )^{3/2} (1+x) \sqrt {\frac {1-x+x^2}{\left (1+\sqrt {3}+x\right )^2}} F\left (\sin ^{-1}\left (\frac {1-\sqrt {3}+x}{1+\sqrt {3}+x}\right )|-7-4 \sqrt {3}\right )}{2 \sqrt [4]{3} \sqrt {\frac {1+x}{\left (1+\sqrt {3}+x\right )^2}} \sqrt {1+x^3}}+\frac {1}{2} \left (-2-\sqrt {3}\right ) \text {Subst}\left (\int \frac {1}{1+\left (3+2 \sqrt {3}\right ) x^2} \, dx,x,\frac {1+\frac {2 \left (1+\sqrt {3}\right ) x}{2+2 \sqrt {3}}}{\sqrt {1+x^3}}\right )+\frac {1}{2} \left (-2+\sqrt {3}\right ) \text {Subst}\left (\int \frac {1}{1+\left (3-2 \sqrt {3}\right ) x^2} \, dx,x,\frac {1+\frac {2 \left (1-\sqrt {3}\right ) x}{2-2 \sqrt {3}}}{\sqrt {1+x^3}}\right )\\ &=-\frac {1}{2} \sqrt {1+\frac {2}{\sqrt {3}}} \tan ^{-1}\left (\frac {\sqrt {3+2 \sqrt {3}} (1+x)}{\sqrt {1+x^3}}\right )-\frac {1}{2} \sqrt {-1+\frac {2}{\sqrt {3}}} \tanh ^{-1}\left (\frac {\sqrt {-3+2 \sqrt {3}} (1+x)}{\sqrt {1+x^3}}\right )-\frac {\sqrt {2-\sqrt {3}} (1+x) \sqrt {\frac {1-x+x^2}{\left (1+\sqrt {3}+x\right )^2}} F\left (\sin ^{-1}\left (\frac {1-\sqrt {3}+x}{1+\sqrt {3}+x}\right )|-7-4 \sqrt {3}\right )}{2 \sqrt [4]{3} \sqrt {\frac {1+x}{\left (1+\sqrt {3}+x\right )^2}} \sqrt {1+x^3}}+\frac {2 \sqrt {2+\sqrt {3}} (1+x) \sqrt {\frac {1-x+x^2}{\left (1+\sqrt {3}+x\right )^2}} F\left (\sin ^{-1}\left (\frac {1-\sqrt {3}+x}{1+\sqrt {3}+x}\right )|-7-4 \sqrt {3}\right )}{\sqrt [4]{3} \sqrt {\frac {1+x}{\left (1+\sqrt {3}+x\right )^2}} \sqrt {1+x^3}}-\frac {\left (2+\sqrt {3}\right )^{3/2} (1+x) \sqrt {\frac {1-x+x^2}{\left (1+\sqrt {3}+x\right )^2}} F\left (\sin ^{-1}\left (\frac {1-\sqrt {3}+x}{1+\sqrt {3}+x}\right )|-7-4 \sqrt {3}\right )}{2 \sqrt [4]{3} \sqrt {\frac {1+x}{\left (1+\sqrt {3}+x\right )^2}} \sqrt {1+x^3}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.89, size = 106, normalized size = 0.95 \begin {gather*} -\frac {\sqrt {3+2 \sqrt {3}} \text {ArcTan}\left (\frac {\sqrt {3+2 \sqrt {3}} \sqrt {1+x^3}}{1-x+x^2}\right )+\sqrt {-3+2 \sqrt {3}} \tanh ^{-1}\left (\frac {\sqrt {-3+2 \sqrt {3}} \sqrt {1+x^3}}{1-x+x^2}\right )}{2 \sqrt {3}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 4 vs. order
3.
time = 2.38, size = 1501, normalized size = 13.52
method | result | size |
trager | \(-\frac {\RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right ) \ln \left (-\frac {240 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{5} x^{2}-480 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{5} x +232 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{3} x^{2}-304 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{3} x +32 \sqrt {x^{3}+1}\, \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{2}+160 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{3}+55 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right ) x^{2}-22 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right ) x +16 \sqrt {x^{3}+1}+88 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )}{\left (12 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{2} x +5 x -4\right )^{2}}\right )}{2}+\frac {\RootOf \left (\textit {\_Z}^{2}+4 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{2}+2\right ) \ln \left (\frac {240 \RootOf \left (\textit {\_Z}^{2}+4 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{2}+2\right ) \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{4} x^{2}-480 \RootOf \left (\textit {\_Z}^{2}+4 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{2}+2\right ) \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{4} x +8 \RootOf \left (\textit {\_Z}^{2}+4 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{2}+2\right ) \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{2} x^{2}-176 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{2} \RootOf \left (\textit {\_Z}^{2}+4 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{2}+2\right ) x +64 \sqrt {x^{3}+1}\, \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{2}-160 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{2} \RootOf \left (\textit {\_Z}^{2}+4 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{2}+2\right )-\RootOf \left (\textit {\_Z}^{2}+4 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{2}+2\right ) x^{2}+10 \RootOf \left (\textit {\_Z}^{2}+4 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{2}+2\right ) x +8 \RootOf \left (\textit {\_Z}^{2}+4 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{2}+2\right )}{\left (12 \RootOf \left (48 \textit {\_Z}^{4}+24 \textit {\_Z}^{2}-1\right )^{2} x +x +4\right )^{2}}\right )}{4}\) | \(583\) |
default | \(\text {Expression too large to display}\) | \(1501\) |
elliptic | \(\text {Expression too large to display}\) | \(1706\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 229 vs.
\(2 (79) = 158\).
time = 0.49, size = 229, normalized size = 2.06 \begin {gather*} -\frac {1}{6} \, \sqrt {3} \sqrt {2 \, \sqrt {3} + 3} \arctan \left (\frac {\sqrt {x^{3} + 1} \sqrt {2 \, \sqrt {3} + 3}}{x^{2} - x + 1}\right ) - \frac {1}{24} \, \sqrt {3} \sqrt {2 \, \sqrt {3} - 3} \log \left (\frac {x^{4} - 2 \, x^{3} + 6 \, x^{2} + 2 \, \sqrt {x^{3} + 1} {\left (x^{2} + 2 \, \sqrt {3} {\left (x + 1\right )} + 2 \, x + 4\right )} \sqrt {2 \, \sqrt {3} - 3} + 4 \, \sqrt {3} {\left (x^{3} + 1\right )} + 4 \, x + 4}{x^{4} + 4 \, x^{3} - 8 \, x + 4}\right ) + \frac {1}{24} \, \sqrt {3} \sqrt {2 \, \sqrt {3} - 3} \log \left (\frac {x^{4} - 2 \, x^{3} + 6 \, x^{2} - 2 \, \sqrt {x^{3} + 1} {\left (x^{2} + 2 \, \sqrt {3} {\left (x + 1\right )} + 2 \, x + 4\right )} \sqrt {2 \, \sqrt {3} - 3} + 4 \, \sqrt {3} {\left (x^{3} + 1\right )} + 4 \, x + 4}{x^{4} + 4 \, x^{3} - 8 \, x + 4}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {x^{2} - x + 1}{\sqrt {\left (x + 1\right ) \left (x^{2} - x + 1\right )} \left (x^{2} + 2 x - 2\right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.97, size = 509, normalized size = 4.59 \begin {gather*} \frac {2\,\left (\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\sqrt {\frac {x-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}{-\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\,\sqrt {\frac {x+1}{\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\,\sqrt {\frac {\frac {1}{2}-x+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}{\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\,\mathrm {F}\left (\mathrm {asin}\left (\sqrt {\frac {x+1}{\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\right )\middle |-\frac {\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}{-\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}\right )}{\sqrt {x^3+\left (-\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )-1\right )\,x-\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}}+\frac {\left (3\,\sqrt {3}-6\right )\,\left (\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\sqrt {\frac {x-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}{-\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\,\sqrt {\frac {x+1}{\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\,\sqrt {\frac {\frac {1}{2}-x+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}{\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\,\Pi \left (\frac {\sqrt {3}\,\left (\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}{3};\mathrm {asin}\left (\sqrt {\frac {x+1}{\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\right )\middle |-\frac {\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}{-\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}\right )}{3\,\sqrt {x^3+\left (-\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )-1\right )\,x-\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}}-\frac {\left (3\,\sqrt {3}+6\right )\,\left (\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\sqrt {\frac {x-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}{-\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\,\sqrt {\frac {x+1}{\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\,\sqrt {\frac {\frac {1}{2}-x+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}{\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\,\Pi \left (-\frac {\sqrt {3}\,\left (\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}{3};\mathrm {asin}\left (\sqrt {\frac {x+1}{\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}}\right )\middle |-\frac {\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}{-\frac {3}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}}\right )}{3\,\sqrt {x^3+\left (-\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )-1\right )\,x-\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________