Optimal. Leaf size=40 \[ -\frac {2 \text {ArcTan}\left (\frac {\sqrt {3} \sqrt {-x-x^2+x^3}}{-1-x+x^2}\right )}{\sqrt {3}} \]
[Out]
________________________________________________________________________________________
Rubi [C] Result contains higher order function than in optimal. Order 4 vs. order 3 in
optimal.
time = 0.86, antiderivative size = 387, normalized size of antiderivative = 9.68, number of steps
used = 15, number of rules used = 8, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {2081, 6860,
730, 1112, 948, 174, 552, 551} \begin {gather*} \frac {\sqrt {x} \sqrt {-\left (\left (1-\sqrt {5}\right ) x\right )-2} \sqrt {\frac {\left (1+\sqrt {5}\right ) x+2}{\left (1-\sqrt {5}\right ) x+2}} F\left (\text {ArcSin}\left (\frac {\sqrt {2} \sqrt [4]{5} \sqrt {x}}{\sqrt {-\left (\left (1-\sqrt {5}\right ) x\right )-2}}\right )|\frac {1}{10} \left (5-\sqrt {5}\right )\right )}{\sqrt [4]{5} \sqrt {\frac {1}{\left (1-\sqrt {5}\right ) x+2}} \sqrt {x^3-x^2-x}}-\frac {\sqrt {3+\sqrt {5}} \sqrt {x} \sqrt {2 x+\sqrt {5}-1} \sqrt {1-\frac {2 x}{1+\sqrt {5}}} \Pi \left (\frac {1}{2} \left (1-\sqrt {2}\right ) \left (1+\sqrt {5}\right );\text {ArcSin}\left (\sqrt {\frac {2}{1+\sqrt {5}}} \sqrt {x}\right )|\frac {1}{2} \left (-3-\sqrt {5}\right )\right )}{\sqrt {x^3-x^2-x}}-\frac {\sqrt {3+\sqrt {5}} \sqrt {x} \sqrt {2 x+\sqrt {5}-1} \sqrt {1-\frac {2 x}{1+\sqrt {5}}} \Pi \left (\frac {1}{2} \left (1+\sqrt {2}\right ) \left (1+\sqrt {5}\right );\text {ArcSin}\left (\sqrt {\frac {2}{1+\sqrt {5}}} \sqrt {x}\right )|\frac {1}{2} \left (-3-\sqrt {5}\right )\right )}{\sqrt {x^3-x^2-x}} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
Rule 174
Rule 551
Rule 552
Rule 730
Rule 948
Rule 1112
Rule 2081
Rule 6860
Rubi steps
\begin {align*} \int \frac {1+x^2}{\left (-1+2 x+x^2\right ) \sqrt {-x-x^2+x^3}} \, dx &=\frac {\left (\sqrt {x} \sqrt {-1-x+x^2}\right ) \int \frac {1+x^2}{\sqrt {x} \sqrt {-1-x+x^2} \left (-1+2 x+x^2\right )} \, dx}{\sqrt {-x-x^2+x^3}}\\ &=\frac {\left (\sqrt {x} \sqrt {-1-x+x^2}\right ) \int \left (\frac {1}{\sqrt {x} \sqrt {-1-x+x^2}}+\frac {2 (1-x)}{\sqrt {x} \sqrt {-1-x+x^2} \left (-1+2 x+x^2\right )}\right ) \, dx}{\sqrt {-x-x^2+x^3}}\\ &=\frac {\left (\sqrt {x} \sqrt {-1-x+x^2}\right ) \int \frac {1}{\sqrt {x} \sqrt {-1-x+x^2}} \, dx}{\sqrt {-x-x^2+x^3}}+\frac {\left (2 \sqrt {x} \sqrt {-1-x+x^2}\right ) \int \frac {1-x}{\sqrt {x} \sqrt {-1-x+x^2} \left (-1+2 x+x^2\right )} \, dx}{\sqrt {-x-x^2+x^3}}\\ &=\frac {\left (2 \sqrt {x} \sqrt {-1-x+x^2}\right ) \int \left (\frac {-1+\sqrt {2}}{\sqrt {x} \left (2-2 \sqrt {2}+2 x\right ) \sqrt {-1-x+x^2}}+\frac {-1-\sqrt {2}}{\sqrt {x} \left (2+2 \sqrt {2}+2 x\right ) \sqrt {-1-x+x^2}}\right ) \, dx}{\sqrt {-x-x^2+x^3}}+\frac {\left (2 \sqrt {x} \sqrt {-1-x+x^2}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {-1-x^2+x^4}} \, dx,x,\sqrt {x}\right )}{\sqrt {-x-x^2+x^3}}\\ &=\frac {\sqrt {x} \sqrt {-2-\left (1-\sqrt {5}\right ) x} \sqrt {\frac {2+\left (1+\sqrt {5}\right ) x}{2+\left (1-\sqrt {5}\right ) x}} F\left (\sin ^{-1}\left (\frac {\sqrt {2} \sqrt [4]{5} \sqrt {x}}{\sqrt {-2-\left (1-\sqrt {5}\right ) x}}\right )|\frac {1}{10} \left (5-\sqrt {5}\right )\right )}{\sqrt [4]{5} \sqrt {\frac {1}{2+\left (1-\sqrt {5}\right ) x}} \sqrt {-x-x^2+x^3}}+\frac {\left (2 \left (-1-\sqrt {2}\right ) \sqrt {x} \sqrt {-1-x+x^2}\right ) \int \frac {1}{\sqrt {x} \left (2+2 \sqrt {2}+2 x\right ) \sqrt {-1-x+x^2}} \, dx}{\sqrt {-x-x^2+x^3}}+\frac {\left (2 \left (-1+\sqrt {2}\right ) \sqrt {x} \sqrt {-1-x+x^2}\right ) \int \frac {1}{\sqrt {x} \left (2-2 \sqrt {2}+2 x\right ) \sqrt {-1-x+x^2}} \, dx}{\sqrt {-x-x^2+x^3}}\\ &=\frac {\sqrt {x} \sqrt {-2-\left (1-\sqrt {5}\right ) x} \sqrt {\frac {2+\left (1+\sqrt {5}\right ) x}{2+\left (1-\sqrt {5}\right ) x}} F\left (\sin ^{-1}\left (\frac {\sqrt {2} \sqrt [4]{5} \sqrt {x}}{\sqrt {-2-\left (1-\sqrt {5}\right ) x}}\right )|\frac {1}{10} \left (5-\sqrt {5}\right )\right )}{\sqrt [4]{5} \sqrt {\frac {1}{2+\left (1-\sqrt {5}\right ) x}} \sqrt {-x-x^2+x^3}}+\frac {\left (2 \left (-1-\sqrt {2}\right ) \sqrt {x} \sqrt {-1-\sqrt {5}+2 x} \sqrt {-1+\sqrt {5}+2 x}\right ) \int \frac {1}{\sqrt {x} \left (2+2 \sqrt {2}+2 x\right ) \sqrt {-1-\sqrt {5}+2 x} \sqrt {-1+\sqrt {5}+2 x}} \, dx}{\sqrt {-x-x^2+x^3}}+\frac {\left (2 \left (-1+\sqrt {2}\right ) \sqrt {x} \sqrt {-1-\sqrt {5}+2 x} \sqrt {-1+\sqrt {5}+2 x}\right ) \int \frac {1}{\sqrt {x} \left (2-2 \sqrt {2}+2 x\right ) \sqrt {-1-\sqrt {5}+2 x} \sqrt {-1+\sqrt {5}+2 x}} \, dx}{\sqrt {-x-x^2+x^3}}\\ &=\frac {\sqrt {x} \sqrt {-2-\left (1-\sqrt {5}\right ) x} \sqrt {\frac {2+\left (1+\sqrt {5}\right ) x}{2+\left (1-\sqrt {5}\right ) x}} F\left (\sin ^{-1}\left (\frac {\sqrt {2} \sqrt [4]{5} \sqrt {x}}{\sqrt {-2-\left (1-\sqrt {5}\right ) x}}\right )|\frac {1}{10} \left (5-\sqrt {5}\right )\right )}{\sqrt [4]{5} \sqrt {\frac {1}{2+\left (1-\sqrt {5}\right ) x}} \sqrt {-x-x^2+x^3}}-\frac {\left (4 \left (-1-\sqrt {2}\right ) \sqrt {x} \sqrt {-1-\sqrt {5}+2 x} \sqrt {-1+\sqrt {5}+2 x}\right ) \text {Subst}\left (\int \frac {1}{\left (-2 \left (1+\sqrt {2}\right )-2 x^2\right ) \sqrt {-1-\sqrt {5}+2 x^2} \sqrt {-1+\sqrt {5}+2 x^2}} \, dx,x,\sqrt {x}\right )}{\sqrt {-x-x^2+x^3}}-\frac {\left (4 \left (-1+\sqrt {2}\right ) \sqrt {x} \sqrt {-1-\sqrt {5}+2 x} \sqrt {-1+\sqrt {5}+2 x}\right ) \text {Subst}\left (\int \frac {1}{\left (-2 \left (1-\sqrt {2}\right )-2 x^2\right ) \sqrt {-1-\sqrt {5}+2 x^2} \sqrt {-1+\sqrt {5}+2 x^2}} \, dx,x,\sqrt {x}\right )}{\sqrt {-x-x^2+x^3}}\\ &=\frac {\sqrt {x} \sqrt {-2-\left (1-\sqrt {5}\right ) x} \sqrt {\frac {2+\left (1+\sqrt {5}\right ) x}{2+\left (1-\sqrt {5}\right ) x}} F\left (\sin ^{-1}\left (\frac {\sqrt {2} \sqrt [4]{5} \sqrt {x}}{\sqrt {-2-\left (1-\sqrt {5}\right ) x}}\right )|\frac {1}{10} \left (5-\sqrt {5}\right )\right )}{\sqrt [4]{5} \sqrt {\frac {1}{2+\left (1-\sqrt {5}\right ) x}} \sqrt {-x-x^2+x^3}}-\frac {\left (4 \left (-1-\sqrt {2}\right ) \sqrt {x} \sqrt {-1+\sqrt {5}+2 x} \sqrt {1-\frac {2 x}{1+\sqrt {5}}}\right ) \text {Subst}\left (\int \frac {1}{\left (-2 \left (1+\sqrt {2}\right )-2 x^2\right ) \sqrt {-1+\sqrt {5}+2 x^2} \sqrt {1+\frac {2 x^2}{-1-\sqrt {5}}}} \, dx,x,\sqrt {x}\right )}{\sqrt {-x-x^2+x^3}}-\frac {\left (4 \left (-1+\sqrt {2}\right ) \sqrt {x} \sqrt {-1+\sqrt {5}+2 x} \sqrt {1-\frac {2 x}{1+\sqrt {5}}}\right ) \text {Subst}\left (\int \frac {1}{\left (-2 \left (1-\sqrt {2}\right )-2 x^2\right ) \sqrt {-1+\sqrt {5}+2 x^2} \sqrt {1+\frac {2 x^2}{-1-\sqrt {5}}}} \, dx,x,\sqrt {x}\right )}{\sqrt {-x-x^2+x^3}}\\ &=\frac {\sqrt {x} \sqrt {-2-\left (1-\sqrt {5}\right ) x} \sqrt {\frac {2+\left (1+\sqrt {5}\right ) x}{2+\left (1-\sqrt {5}\right ) x}} F\left (\sin ^{-1}\left (\frac {\sqrt {2} \sqrt [4]{5} \sqrt {x}}{\sqrt {-2-\left (1-\sqrt {5}\right ) x}}\right )|\frac {1}{10} \left (5-\sqrt {5}\right )\right )}{\sqrt [4]{5} \sqrt {\frac {1}{2+\left (1-\sqrt {5}\right ) x}} \sqrt {-x-x^2+x^3}}-\frac {\sqrt {3+\sqrt {5}} \sqrt {x} \sqrt {-1+\sqrt {5}+2 x} \sqrt {1-\frac {2 x}{1+\sqrt {5}}} \Pi \left (\frac {1}{2} \left (1-\sqrt {2}\right ) \left (1+\sqrt {5}\right );\sin ^{-1}\left (\sqrt {\frac {2}{1+\sqrt {5}}} \sqrt {x}\right )|\frac {1}{2} \left (-3-\sqrt {5}\right )\right )}{\sqrt {-x-x^2+x^3}}-\frac {\sqrt {3+\sqrt {5}} \sqrt {x} \sqrt {-1+\sqrt {5}+2 x} \sqrt {1-\frac {2 x}{1+\sqrt {5}}} \Pi \left (\frac {1}{2} \left (1+\sqrt {2}\right ) \left (1+\sqrt {5}\right );\sin ^{-1}\left (\sqrt {\frac {2}{1+\sqrt {5}}} \sqrt {x}\right )|\frac {1}{2} \left (-3-\sqrt {5}\right )\right )}{\sqrt {-x-x^2+x^3}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.21, size = 62, normalized size = 1.55 \begin {gather*} -\frac {2 \sqrt {x} \sqrt {-1-x+x^2} \text {ArcTan}\left (\frac {\sqrt {3} \sqrt {x}}{\sqrt {-1-x+x^2}}\right )}{\sqrt {3} \sqrt {x \left (-1-x+x^2\right )}} \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.09, size = 1393, normalized size = 34.82
method | result | size |
trager | \(-\frac {\RootOf \left (\textit {\_Z}^{2}+3\right ) \ln \left (\frac {\RootOf \left (\textit {\_Z}^{2}+3\right ) x^{2}-4 \RootOf \left (\textit {\_Z}^{2}+3\right ) x +6 \sqrt {x^{3}-x^{2}-x}-\RootOf \left (\textit {\_Z}^{2}+3\right )}{x^{2}+2 x -1}\right )}{3}\) | \(65\) |
default | \(\text {Expression too large to display}\) | \(1393\) |
elliptic | \(\text {Expression too large to display}\) | \(1531\) |
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 [A]
time = 0.45, size = 33, normalized size = 0.82 \begin {gather*} \frac {1}{3} \, \sqrt {3} \arctan \left (\frac {\sqrt {3} {\left (x^{2} - 4 \, x - 1\right )}}{6 \, \sqrt {x^{3} - x^{2} - x}}\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} + 1}{\sqrt {x \left (x^{2} - 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.15, size = 223, normalized size = 5.58 \begin {gather*} -\frac {\sqrt {\frac {x}{\frac {\sqrt {5}}{2}+\frac {1}{2}}}\,\sqrt {\frac {x+\frac {\sqrt {5}}{2}-\frac {1}{2}}{\frac {\sqrt {5}}{2}-\frac {1}{2}}}\,\left (\sqrt {5}+1\right )\,\sqrt {\frac {\frac {\sqrt {5}}{2}-x+\frac {1}{2}}{\frac {\sqrt {5}}{2}+\frac {1}{2}}}\,\left (\Pi \left (\frac {\frac {\sqrt {5}}{2}+\frac {1}{2}}{\sqrt {2}-1};\mathrm {asin}\left (\sqrt {\frac {x}{\frac {\sqrt {5}}{2}+\frac {1}{2}}}\right )\middle |-\frac {\frac {\sqrt {5}}{2}+\frac {1}{2}}{\frac {\sqrt {5}}{2}-\frac {1}{2}}\right )-\mathrm {F}\left (\mathrm {asin}\left (\sqrt {\frac {x}{\frac {\sqrt {5}}{2}+\frac {1}{2}}}\right )\middle |-\frac {\frac {\sqrt {5}}{2}+\frac {1}{2}}{\frac {\sqrt {5}}{2}-\frac {1}{2}}\right )+\Pi \left (-\frac {\frac {\sqrt {5}}{2}+\frac {1}{2}}{\sqrt {2}+1};\mathrm {asin}\left (\sqrt {\frac {x}{\frac {\sqrt {5}}{2}+\frac {1}{2}}}\right )\middle |-\frac {\frac {\sqrt {5}}{2}+\frac {1}{2}}{\frac {\sqrt {5}}{2}-\frac {1}{2}}\right )\right )}{\sqrt {x^3-x^2-\left (\frac {\sqrt {5}}{2}-\frac {1}{2}\right )\,\left (\frac {\sqrt {5}}{2}+\frac {1}{2}\right )\,x}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________