Optimal. Leaf size=65 \[ -\frac {3 \tan ^{-1}\left (\frac {\sqrt {2} \sqrt {x^3+x}}{x^2+1}\right )}{2 \sqrt {2}}-\frac {\tanh ^{-1}\left (\frac {\sqrt {2} \sqrt {x^3+x}}{x^2+1}\right )}{2 \sqrt {2}} \]
________________________________________________________________________________________
Rubi [C] time = 0.79, antiderivative size = 172, normalized size of antiderivative = 2.65, number of steps used = 15, number of rules used = 8, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.320, Rules used = {2056, 6725, 329, 220, 932, 168, 538, 537} \begin {gather*} \frac {\sqrt {x} (x+1) \sqrt {\frac {x^2+1}{(x+1)^2}} F\left (2 \tan ^{-1}\left (\sqrt {x}\right )|\frac {1}{2}\right )}{\sqrt {x^3+x}}+\frac {\left (\frac {3}{2}-\frac {3 i}{2}\right ) \sqrt {i x} \sqrt {x^2+1} \Pi \left (\frac {1}{2}-\frac {i}{2};\sin ^{-1}\left (\sqrt {1-i x}\right )|\frac {1}{2}\right )}{\sqrt {2} \sqrt {x^3+x}}-\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) \sqrt {i x} \sqrt {x^2+1} \Pi \left (\frac {1}{2}+\frac {i}{2};\sin ^{-1}\left (\sqrt {1-i x}\right )|\frac {1}{2}\right )}{\sqrt {2} \sqrt {x^3+x}} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
Rule 168
Rule 220
Rule 329
Rule 537
Rule 538
Rule 932
Rule 2056
Rule 6725
Rubi steps
\begin {align*} \int \frac {1-x+x^2}{\left (-1+x^2\right ) \sqrt {x+x^3}} \, dx &=\frac {\left (\sqrt {x} \sqrt {1+x^2}\right ) \int \frac {1-x+x^2}{\sqrt {x} \left (-1+x^2\right ) \sqrt {1+x^2}} \, dx}{\sqrt {x+x^3}}\\ &=\frac {\left (\sqrt {x} \sqrt {1+x^2}\right ) \int \left (\frac {1}{\sqrt {x} \sqrt {1+x^2}}+\frac {2-x}{\sqrt {x} \left (-1+x^2\right ) \sqrt {1+x^2}}\right ) \, dx}{\sqrt {x+x^3}}\\ &=\frac {\left (\sqrt {x} \sqrt {1+x^2}\right ) \int \frac {1}{\sqrt {x} \sqrt {1+x^2}} \, dx}{\sqrt {x+x^3}}+\frac {\left (\sqrt {x} \sqrt {1+x^2}\right ) \int \frac {2-x}{\sqrt {x} \left (-1+x^2\right ) \sqrt {1+x^2}} \, dx}{\sqrt {x+x^3}}\\ &=\frac {\left (\sqrt {x} \sqrt {1+x^2}\right ) \int \left (-\frac {1}{2 (1-x) \sqrt {x} \sqrt {1+x^2}}-\frac {3}{2 \sqrt {x} (1+x) \sqrt {1+x^2}}\right ) \, dx}{\sqrt {x+x^3}}+\frac {\left (2 \sqrt {x} \sqrt {1+x^2}\right ) \operatorname {Subst}\left (\int \frac {1}{\sqrt {1+x^4}} \, dx,x,\sqrt {x}\right )}{\sqrt {x+x^3}}\\ &=\frac {\sqrt {x} (1+x) \sqrt {\frac {1+x^2}{(1+x)^2}} F\left (2 \tan ^{-1}\left (\sqrt {x}\right )|\frac {1}{2}\right )}{\sqrt {x+x^3}}-\frac {\left (\sqrt {x} \sqrt {1+x^2}\right ) \int \frac {1}{(1-x) \sqrt {x} \sqrt {1+x^2}} \, dx}{2 \sqrt {x+x^3}}-\frac {\left (3 \sqrt {x} \sqrt {1+x^2}\right ) \int \frac {1}{\sqrt {x} (1+x) \sqrt {1+x^2}} \, dx}{2 \sqrt {x+x^3}}\\ &=\frac {\sqrt {x} (1+x) \sqrt {\frac {1+x^2}{(1+x)^2}} F\left (2 \tan ^{-1}\left (\sqrt {x}\right )|\frac {1}{2}\right )}{\sqrt {x+x^3}}-\frac {\left (\sqrt {x} \sqrt {1+x^2}\right ) \int \frac {1}{(1-x) \sqrt {1-i x} \sqrt {1+i x} \sqrt {x}} \, dx}{2 \sqrt {x+x^3}}-\frac {\left (3 \sqrt {x} \sqrt {1+x^2}\right ) \int \frac {1}{\sqrt {1-i x} \sqrt {1+i x} \sqrt {x} (1+x)} \, dx}{2 \sqrt {x+x^3}}\\ &=\frac {\sqrt {x} (1+x) \sqrt {\frac {1+x^2}{(1+x)^2}} F\left (2 \tan ^{-1}\left (\sqrt {x}\right )|\frac {1}{2}\right )}{\sqrt {x+x^3}}+\frac {\left (\sqrt {x} \sqrt {1+x^2}\right ) \operatorname {Subst}\left (\int \frac {1}{\sqrt {2-x^2} \sqrt {-i+i x^2} \left ((-1+i)+x^2\right )} \, dx,x,\sqrt {1-i x}\right )}{\sqrt {x+x^3}}+\frac {\left (3 \sqrt {x} \sqrt {1+x^2}\right ) \operatorname {Subst}\left (\int \frac {1}{\left ((1+i)-x^2\right ) \sqrt {2-x^2} \sqrt {-i+i x^2}} \, dx,x,\sqrt {1-i x}\right )}{\sqrt {x+x^3}}\\ &=\frac {\sqrt {x} (1+x) \sqrt {\frac {1+x^2}{(1+x)^2}} F\left (2 \tan ^{-1}\left (\sqrt {x}\right )|\frac {1}{2}\right )}{\sqrt {x+x^3}}+\frac {\left (\sqrt {i x} \sqrt {1+x^2}\right ) \operatorname {Subst}\left (\int \frac {1}{\sqrt {1-x^2} \sqrt {2-x^2} \left ((-1+i)+x^2\right )} \, dx,x,\sqrt {1-i x}\right )}{\sqrt {x+x^3}}+\frac {\left (3 \sqrt {i x} \sqrt {1+x^2}\right ) \operatorname {Subst}\left (\int \frac {1}{\sqrt {1-x^2} \left ((1+i)-x^2\right ) \sqrt {2-x^2}} \, dx,x,\sqrt {1-i x}\right )}{\sqrt {x+x^3}}\\ &=\frac {\sqrt {x} (1+x) \sqrt {\frac {1+x^2}{(1+x)^2}} F\left (2 \tan ^{-1}\left (\sqrt {x}\right )|\frac {1}{2}\right )}{\sqrt {x+x^3}}+\frac {\left (\frac {3}{2}-\frac {3 i}{2}\right ) \sqrt {i x} \sqrt {1+x^2} \Pi \left (\frac {1}{2}-\frac {i}{2};\sin ^{-1}\left (\sqrt {1-i x}\right )|\frac {1}{2}\right )}{\sqrt {2} \sqrt {x+x^3}}-\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) \sqrt {i x} \sqrt {1+x^2} \Pi \left (\frac {1}{2}+\frac {i}{2};\sin ^{-1}\left (\sqrt {1-i x}\right )|\frac {1}{2}\right )}{\sqrt {2} \sqrt {x+x^3}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.55, size = 177, normalized size = 2.72 \begin {gather*} \frac {2 \left (5 \sqrt {\frac {1}{x^2}+1} F_1\left (\frac {3}{4};\frac {1}{2},1;\frac {7}{4};-\frac {1}{x^2},\frac {1}{x^2}\right )-\frac {3 \sqrt {\frac {1}{x^2}+1} F_1\left (\frac {5}{4};\frac {1}{2},1;\frac {9}{4};-\frac {1}{x^2},\frac {1}{x^2}\right )}{x}-\frac {75 x^5 F_1\left (\frac {1}{4};\frac {1}{2},1;\frac {5}{4};-\frac {1}{x^2},\frac {1}{x^2}\right )}{\left (x^2-1\right ) \left (5 x^2 F_1\left (\frac {1}{4};\frac {1}{2},1;\frac {5}{4};-\frac {1}{x^2},\frac {1}{x^2}\right )+4 F_1\left (\frac {5}{4};\frac {1}{2},2;\frac {9}{4};-\frac {1}{x^2},\frac {1}{x^2}\right )-2 F_1\left (\frac {5}{4};\frac {3}{2},1;\frac {9}{4};-\frac {1}{x^2},\frac {1}{x^2}\right )\right )}\right )}{15 \sqrt {x^3+x}} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [A] time = 0.27, size = 65, normalized size = 1.00 \begin {gather*} -\frac {3 \tan ^{-1}\left (\frac {\sqrt {2} \sqrt {x+x^3}}{1+x^2}\right )}{2 \sqrt {2}}-\frac {\tanh ^{-1}\left (\frac {\sqrt {2} \sqrt {x+x^3}}{1+x^2}\right )}{2 \sqrt {2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.51, size = 92, normalized size = 1.42 \begin {gather*} \frac {3}{8} \, \sqrt {2} \arctan \left (\frac {\sqrt {2} {\left (x^{2} - 2 \, x + 1\right )}}{4 \, \sqrt {x^{3} + x}}\right ) + \frac {1}{16} \, \sqrt {2} \log \left (\frac {x^{4} + 12 \, x^{3} - 4 \, \sqrt {2} \sqrt {x^{3} + x} {\left (x^{2} + 2 \, x + 1\right )} + 6 \, x^{2} + 12 \, x + 1}{x^{4} - 4 \, x^{3} + 6 \, x^{2} - 4 \, x + 1}\right ) \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*} \int \frac {x^{2} - x + 1}{\sqrt {x^{3} + x} {\left (x^{2} - 1\right )}}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [C] time = 0.56, size = 102, normalized size = 1.57
method | result | size |
trager | \(\frac {3 \RootOf \left (\textit {\_Z}^{2}+2\right ) \ln \left (\frac {\RootOf \left (\textit {\_Z}^{2}+2\right ) x^{2}-2 \RootOf \left (\textit {\_Z}^{2}+2\right ) x +\RootOf \left (\textit {\_Z}^{2}+2\right )-4 \sqrt {x^{3}+x}}{\left (1+x \right )^{2}}\right )}{8}-\frac {\RootOf \left (\textit {\_Z}^{2}-2\right ) \ln \left (\frac {\RootOf \left (\textit {\_Z}^{2}-2\right ) x^{2}+2 \RootOf \left (\textit {\_Z}^{2}-2\right ) x +4 \sqrt {x^{3}+x}+\RootOf \left (\textit {\_Z}^{2}-2\right )}{\left (-1+x \right )^{2}}\right )}{8}\) | \(102\) |
default | \(\frac {i \sqrt {-i \left (i+x \right )}\, \sqrt {2}\, \sqrt {i \left (-i+x \right )}\, \sqrt {i x}\, \EllipticF \left (\sqrt {-i \left (i+x \right )}, \frac {\sqrt {2}}{2}\right )}{\sqrt {x^{3}+x}}+\frac {\left (\frac {3}{4}-\frac {3 i}{4}\right ) \sqrt {-i \left (i+x \right )}\, \sqrt {2}\, \sqrt {i \left (-i+x \right )}\, \sqrt {i x}\, \EllipticPi \left (\sqrt {-i \left (i+x \right )}, \frac {1}{2}-\frac {i}{2}, \frac {\sqrt {2}}{2}\right )}{\sqrt {x^{3}+x}}+\frac {\left (-\frac {1}{4}-\frac {i}{4}\right ) \sqrt {-i \left (i+x \right )}\, \sqrt {2}\, \sqrt {i \left (-i+x \right )}\, \sqrt {i x}\, \EllipticPi \left (\sqrt {-i \left (i+x \right )}, \frac {1}{2}+\frac {i}{2}, \frac {\sqrt {2}}{2}\right )}{\sqrt {x^{3}+x}}\) | \(166\) |
elliptic | \(\frac {i \sqrt {-i x +1}\, \sqrt {2}\, \sqrt {i x +1}\, \sqrt {i x}\, \EllipticF \left (\sqrt {-i \left (i+x \right )}, \frac {\sqrt {2}}{2}\right )}{\sqrt {x^{3}+x}}+\frac {3 \sqrt {-i x +1}\, \sqrt {2}\, \sqrt {i x +1}\, \sqrt {i x}\, \EllipticPi \left (\sqrt {-i \left (i+x \right )}, \frac {1}{2}-\frac {i}{2}, \frac {\sqrt {2}}{2}\right )}{4 \sqrt {x^{3}+x}}-\frac {3 i \sqrt {-i x +1}\, \sqrt {2}\, \sqrt {i x +1}\, \sqrt {i x}\, \EllipticPi \left (\sqrt {-i \left (i+x \right )}, \frac {1}{2}-\frac {i}{2}, \frac {\sqrt {2}}{2}\right )}{4 \sqrt {x^{3}+x}}-\frac {\sqrt {-i x +1}\, \sqrt {2}\, \sqrt {i x +1}\, \sqrt {i x}\, \EllipticPi \left (\sqrt {-i \left (i+x \right )}, \frac {1}{2}+\frac {i}{2}, \frac {\sqrt {2}}{2}\right )}{4 \sqrt {x^{3}+x}}-\frac {i \sqrt {-i x +1}\, \sqrt {2}\, \sqrt {i x +1}\, \sqrt {i x}\, \EllipticPi \left (\sqrt {-i \left (i+x \right )}, \frac {1}{2}+\frac {i}{2}, \frac {\sqrt {2}}{2}\right )}{4 \sqrt {x^{3}+x}}\) | \(262\) |
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*} \int \frac {x^{2} - x + 1}{\sqrt {x^{3} + x} {\left (x^{2} - 1\right )}}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.72, size = 116, normalized size = 1.78 \begin {gather*} -\frac {-\sqrt {1-x\,1{}\mathrm {i}}\,\sqrt {1+x\,1{}\mathrm {i}}\,\sqrt {-x\,1{}\mathrm {i}}\,\mathrm {F}\left (\mathrm {asin}\left (\sqrt {-x\,1{}\mathrm {i}}\right )\middle |-1\right )\,2{}\mathrm {i}+\sqrt {1-x\,1{}\mathrm {i}}\,\sqrt {1+x\,1{}\mathrm {i}}\,\sqrt {-x\,1{}\mathrm {i}}\,\Pi \left (-\mathrm {i};\mathrm {asin}\left (\sqrt {-x\,1{}\mathrm {i}}\right )\middle |-1\right )\,3{}\mathrm {i}+\sqrt {1-x\,1{}\mathrm {i}}\,\sqrt {1+x\,1{}\mathrm {i}}\,\sqrt {-x\,1{}\mathrm {i}}\,\Pi \left (1{}\mathrm {i};\mathrm {asin}\left (\sqrt {-x\,1{}\mathrm {i}}\right )\middle |-1\right )\,1{}\mathrm {i}}{\sqrt {x^3+x}} \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 {x \left (x^{2} + 1\right )} \left (x - 1\right ) \left (x + 1\right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________