Optimal. Leaf size=77 \[ \frac {1}{4} \left (-2-\sqrt {2}\right ) \tanh ^{-1}\left (\frac {-1+x}{\left (-1+\sqrt {2}\right ) \sqrt {-x+x^3}}\right )+\frac {1}{4} \left (2-\sqrt {2}\right ) \tanh ^{-1}\left (\frac {-1+x}{\left (1+\sqrt {2}\right ) \sqrt {-x+x^3}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [C] Result contains higher order function than in optimal. Order 4 vs. order 3 in
optimal.
time = 0.46, antiderivative size = 251, normalized size of antiderivative = 3.26, number of steps
used = 16, number of rules used = 9, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {1607, 2081,
6860, 958, 335, 228, 947, 174, 551} \begin {gather*} \frac {\left (2+\sqrt {2}\right ) \sqrt {x-1} \sqrt {x} \sqrt {x+1} F\left (\text {ArcSin}\left (\frac {\sqrt {2} \sqrt {x}}{\sqrt {x-1}}\right )|\frac {1}{2}\right )}{2 \sqrt {x^3-x}}-\frac {\left (2-\sqrt {2}\right ) \sqrt {x-1} \sqrt {x} \sqrt {x+1} F\left (\text {ArcSin}\left (\frac {\sqrt {2} \sqrt {x}}{\sqrt {x-1}}\right )|\frac {1}{2}\right )}{2 \sqrt {x^3-x}}+\frac {\left (3+2 \sqrt {2}\right ) \sqrt {x} \sqrt {1-x^2} \Pi \left (-\frac {1}{\sqrt {2}};\text {ArcSin}\left (\sqrt {1-x}\right )|\frac {1}{2}\right )}{2 \sqrt {x^3-x}}-\frac {\left (3-2 \sqrt {2}\right ) \sqrt {x} \sqrt {1-x^2} \Pi \left (\frac {1}{\sqrt {2}};\text {ArcSin}\left (\sqrt {1-x}\right )|\frac {1}{2}\right )}{2 \sqrt {x^3-x}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 174
Rule 228
Rule 335
Rule 551
Rule 947
Rule 958
Rule 1607
Rule 2081
Rule 6860
Rubi steps
\begin {align*} \int \frac {x+x^2}{\left (-1-2 x+x^2\right ) \sqrt {-x+x^3}} \, dx &=\int \frac {x (1+x)}{\left (-1-2 x+x^2\right ) \sqrt {-x+x^3}} \, dx\\ &=\frac {\left (\sqrt {x} \sqrt {-1+x^2}\right ) \int \frac {\sqrt {x} (1+x)}{\sqrt {-1+x^2} \left (-1-2 x+x^2\right )} \, dx}{\sqrt {-x+x^3}}\\ &=\frac {\left (\sqrt {x} \sqrt {-1+x^2}\right ) \int \left (\frac {\left (1+\sqrt {2}\right ) \sqrt {x}}{\left (-2-2 \sqrt {2}+2 x\right ) \sqrt {-1+x^2}}+\frac {\left (1-\sqrt {2}\right ) \sqrt {x}}{\left (-2+2 \sqrt {2}+2 x\right ) \sqrt {-1+x^2}}\right ) \, dx}{\sqrt {-x+x^3}}\\ &=\frac {\left (\left (1-\sqrt {2}\right ) \sqrt {x} \sqrt {-1+x^2}\right ) \int \frac {\sqrt {x}}{\left (-2+2 \sqrt {2}+2 x\right ) \sqrt {-1+x^2}} \, dx}{\sqrt {-x+x^3}}+\frac {\left (\left (1+\sqrt {2}\right ) \sqrt {x} \sqrt {-1+x^2}\right ) \int \frac {\sqrt {x}}{\left (-2-2 \sqrt {2}+2 x\right ) \sqrt {-1+x^2}} \, dx}{\sqrt {-x+x^3}}\\ &=\frac {\left (\left (1-\sqrt {2}\right ) \sqrt {x} \sqrt {-1+x^2}\right ) \int \frac {1}{\sqrt {x} \sqrt {-1+x^2}} \, dx}{2 \sqrt {-x+x^3}}+\frac {\left (\left (1-\sqrt {2}\right )^2 \sqrt {x} \sqrt {-1+x^2}\right ) \int \frac {1}{\sqrt {x} \left (-2+2 \sqrt {2}+2 x\right ) \sqrt {-1+x^2}} \, dx}{\sqrt {-x+x^3}}+\frac {\left (\left (1+\sqrt {2}\right ) \sqrt {x} \sqrt {-1+x^2}\right ) \int \frac {1}{\sqrt {x} \sqrt {-1+x^2}} \, dx}{2 \sqrt {-x+x^3}}+\frac {\left (\left (1+\sqrt {2}\right )^2 \sqrt {x} \sqrt {-1+x^2}\right ) \int \frac {1}{\sqrt {x} \left (-2-2 \sqrt {2}+2 x\right ) \sqrt {-1+x^2}} \, dx}{\sqrt {-x+x^3}}\\ &=\frac {\left (\left (1-\sqrt {2}\right )^2 \sqrt {x} \sqrt {1-x^2}\right ) \int \frac {1}{\sqrt {1-x} \sqrt {x} \sqrt {1+x} \left (-2+2 \sqrt {2}+2 x\right )} \, dx}{\sqrt {-x+x^3}}+\frac {\left (\left (1+\sqrt {2}\right )^2 \sqrt {x} \sqrt {1-x^2}\right ) \int \frac {1}{\sqrt {1-x} \sqrt {x} \sqrt {1+x} \left (-2-2 \sqrt {2}+2 x\right )} \, dx}{\sqrt {-x+x^3}}+\frac {\left (\left (1-\sqrt {2}\right ) \sqrt {x} \sqrt {-1+x^2}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {-1+x^4}} \, dx,x,\sqrt {x}\right )}{\sqrt {-x+x^3}}+\frac {\left (\left (1+\sqrt {2}\right ) \sqrt {x} \sqrt {-1+x^2}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {-1+x^4}} \, dx,x,\sqrt {x}\right )}{\sqrt {-x+x^3}}\\ &=-\frac {\left (2-\sqrt {2}\right ) \sqrt {-1+x} \sqrt {x} \sqrt {1+x} F\left (\sin ^{-1}\left (\frac {\sqrt {2} \sqrt {x}}{\sqrt {-1+x}}\right )|\frac {1}{2}\right )}{2 \sqrt {-x+x^3}}+\frac {\left (2+\sqrt {2}\right ) \sqrt {-1+x} \sqrt {x} \sqrt {1+x} F\left (\sin ^{-1}\left (\frac {\sqrt {2} \sqrt {x}}{\sqrt {-1+x}}\right )|\frac {1}{2}\right )}{2 \sqrt {-x+x^3}}-\frac {\left (2 \left (1-\sqrt {2}\right )^2 \sqrt {x} \sqrt {1-x^2}\right ) \text {Subst}\left (\int \frac {1}{\left (2 \sqrt {2}-2 x^2\right ) \sqrt {1-x^2} \sqrt {2-x^2}} \, dx,x,\sqrt {1-x}\right )}{\sqrt {-x+x^3}}-\frac {\left (2 \left (1+\sqrt {2}\right )^2 \sqrt {x} \sqrt {1-x^2}\right ) \text {Subst}\left (\int \frac {1}{\left (-2 \sqrt {2}-2 x^2\right ) \sqrt {1-x^2} \sqrt {2-x^2}} \, dx,x,\sqrt {1-x}\right )}{\sqrt {-x+x^3}}\\ &=-\frac {\left (2-\sqrt {2}\right ) \sqrt {-1+x} \sqrt {x} \sqrt {1+x} F\left (\sin ^{-1}\left (\frac {\sqrt {2} \sqrt {x}}{\sqrt {-1+x}}\right )|\frac {1}{2}\right )}{2 \sqrt {-x+x^3}}+\frac {\left (2+\sqrt {2}\right ) \sqrt {-1+x} \sqrt {x} \sqrt {1+x} F\left (\sin ^{-1}\left (\frac {\sqrt {2} \sqrt {x}}{\sqrt {-1+x}}\right )|\frac {1}{2}\right )}{2 \sqrt {-x+x^3}}+\frac {\left (3+2 \sqrt {2}\right ) \sqrt {x} \sqrt {1-x^2} \Pi \left (-\frac {1}{\sqrt {2}};\sin ^{-1}\left (\sqrt {1-x}\right )|\frac {1}{2}\right )}{2 \sqrt {-x+x^3}}-\frac {\left (3-2 \sqrt {2}\right ) \sqrt {x} \sqrt {1-x^2} \Pi \left (\frac {1}{\sqrt {2}};\sin ^{-1}\left (\sqrt {1-x}\right )|\frac {1}{2}\right )}{2 \sqrt {-x+x^3}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 4 vs. order 3 in
optimal.
time = 20.22, size = 88, normalized size = 1.14 \begin {gather*} \frac {\sqrt {x \left (-1+x^2\right )} \left (-2 F\left (\left .\text {ArcSin}\left (\sqrt {x}\right )\right |-1\right )-\left (-1+\sqrt {2}\right ) \Pi \left (-1-\sqrt {2};\left .\text {ArcSin}\left (\sqrt {x}\right )\right |-1\right )+\left (1+\sqrt {2}\right ) \Pi \left (-1+\sqrt {2};\left .\text {ArcSin}\left (\sqrt {x}\right )\right |-1\right )\right )}{\sqrt {x} \sqrt {1-x^2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 4 vs. order
3.
time = 1.84, size = 273, normalized size = 3.55
method | result | size |
default | \(\frac {\sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \EllipticF \left (\sqrt {1+x}, \frac {\sqrt {2}}{2}\right )}{\sqrt {x^{3}-x}}+\frac {\sqrt {2}\, \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \EllipticPi \left (\sqrt {1+x}, -\frac {1}{-2-\sqrt {2}}, \frac {\sqrt {2}}{2}\right )}{\sqrt {x^{3}-x}\, \left (-2-\sqrt {2}\right )}+\frac {3 \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \EllipticPi \left (\sqrt {1+x}, -\frac {1}{-2-\sqrt {2}}, \frac {\sqrt {2}}{2}\right )}{2 \sqrt {x^{3}-x}\, \left (-2-\sqrt {2}\right )}+\frac {3 \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \EllipticPi \left (\sqrt {1+x}, -\frac {1}{-2+\sqrt {2}}, \frac {\sqrt {2}}{2}\right )}{2 \sqrt {x^{3}-x}\, \left (-2+\sqrt {2}\right )}-\frac {\sqrt {2}\, \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \EllipticPi \left (\sqrt {1+x}, -\frac {1}{-2+\sqrt {2}}, \frac {\sqrt {2}}{2}\right )}{\sqrt {x^{3}-x}\, \left (-2+\sqrt {2}\right )}\) | \(273\) |
elliptic | \(\frac {\sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \EllipticF \left (\sqrt {1+x}, \frac {\sqrt {2}}{2}\right )}{\sqrt {x^{3}-x}}+\frac {\sqrt {2}\, \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \EllipticPi \left (\sqrt {1+x}, -\frac {1}{-2-\sqrt {2}}, \frac {\sqrt {2}}{2}\right )}{\sqrt {x^{3}-x}\, \left (-2-\sqrt {2}\right )}+\frac {3 \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \EllipticPi \left (\sqrt {1+x}, -\frac {1}{-2-\sqrt {2}}, \frac {\sqrt {2}}{2}\right )}{2 \sqrt {x^{3}-x}\, \left (-2-\sqrt {2}\right )}+\frac {3 \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \EllipticPi \left (\sqrt {1+x}, -\frac {1}{-2+\sqrt {2}}, \frac {\sqrt {2}}{2}\right )}{2 \sqrt {x^{3}-x}\, \left (-2+\sqrt {2}\right )}-\frac {\sqrt {2}\, \sqrt {1+x}\, \sqrt {2-2 x}\, \sqrt {-x}\, \EllipticPi \left (\sqrt {1+x}, -\frac {1}{-2+\sqrt {2}}, \frac {\sqrt {2}}{2}\right )}{\sqrt {x^{3}-x}\, \left (-2+\sqrt {2}\right )}\) | \(273\) |
trager | \(\frac {\RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right ) \ln \left (\frac {278808 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right )^{2} x^{2}-1394040 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right )^{2} x -493895 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right ) x^{2}+1672848 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right )^{2}+1038514 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right ) \sqrt {x^{3}-x}-74648 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right ) x +66352 x^{2}-419247 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right )-152085 \sqrt {x^{3}-x}+40832 x +25520}{\left (4 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right ) x -8 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right )-x +1\right )^{2}}\right )}{2}-\frac {\ln \left (\frac {278808 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right )^{2} x^{2}-1394040 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right )^{2} x -63721 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right ) x^{2}+1672848 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right )^{2}-1038514 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right ) \sqrt {x^{3}-x}+2862728 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right ) x -148735 x^{2}-2926449 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right )+886429 \sqrt {x^{3}-x}-1427856 x +1279121}{\left (4 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right ) x -8 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right )-3 x +7\right )^{2}}\right ) \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right )}{2}+\frac {\ln \left (\frac {278808 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right )^{2} x^{2}-1394040 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right )^{2} x -63721 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right ) x^{2}+1672848 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right )^{2}-1038514 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right ) \sqrt {x^{3}-x}+2862728 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right ) x -148735 x^{2}-2926449 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right )+886429 \sqrt {x^{3}-x}-1427856 x +1279121}{\left (4 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right ) x -8 \RootOf \left (8 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right )-3 x +7\right )^{2}}\right )}{2}\) | \(543\) |
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. 126 vs.
\(2 (57) = 114\).
time = 0.42, size = 126, normalized size = 1.64 \begin {gather*} \frac {1}{8} \, \sqrt {2} \log \left (\frac {x^{4} + 12 \, x^{3} - 4 \, \sqrt {2} \sqrt {x^{3} - x} {\left (x^{2} + 2 \, x - 1\right )} + 2 \, x^{2} - 12 \, x + 1}{x^{4} - 4 \, x^{3} + 2 \, x^{2} + 4 \, x + 1}\right ) + \frac {1}{4} \, \log \left (\frac {x^{4} + 4 \, x^{3} + 2 \, x^{2} - 4 \, \sqrt {x^{3} - x} {\left (x^{2} + 1\right )} - 4 \, x + 1}{x^{4} - 4 \, x^{3} + 2 \, x^{2} + 4 \, x + 1}\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 \left (x + 1\right )}{\sqrt {x \left (x - 1\right ) \left (x + 1\right )} \left (x^{2} - 2 x - 1\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.82, size = 159, normalized size = 2.06 \begin {gather*} \frac {\sqrt {2}\,\sqrt {-x}\,\left (3\,\sqrt {2}+4\right )\,\sqrt {1-x}\,\sqrt {x+1}\,\Pi \left (-\frac {1}{\sqrt {2}+1};\mathrm {asin}\left (\sqrt {-x}\right )\middle |-1\right )}{2\,\sqrt {x^3-x}\,\left (\sqrt {2}+1\right )}-\frac {\sqrt {2}\,\sqrt {-x}\,\left (3\,\sqrt {2}-4\right )\,\sqrt {1-x}\,\sqrt {x+1}\,\Pi \left (\frac {1}{\sqrt {2}-1};\mathrm {asin}\left (\sqrt {-x}\right )\middle |-1\right )}{2\,\sqrt {x^3-x}\,\left (\sqrt {2}-1\right )}-\frac {2\,\sqrt {-x}\,\sqrt {1-x}\,\sqrt {x+1}\,\mathrm {F}\left (\mathrm {asin}\left (\sqrt {-x}\right )\middle |-1\right )}{\sqrt {x^3-x}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________