Optimal. Leaf size=220 \[ \frac {2-4 x}{5 \left (\sqrt {x}+\sqrt {-1+x^2}\right )}+\frac {1}{25} \sqrt {-110+50 \sqrt {5}} \tan ^{-1}\left (\frac {1}{2} \sqrt {2+2 \sqrt {5}} \sqrt {x}\right )-\frac {1}{50} \sqrt {-110+50 \sqrt {5}} \tan ^{-1}\left (\frac {\sqrt {-2+2 \sqrt {5}} \sqrt {-1+x^2}}{2-\left (1-\sqrt {5}\right ) x}\right )-\frac {1}{25} \sqrt {110+50 \sqrt {5}} \tanh ^{-1}\left (\frac {1}{2} \sqrt {-2+2 \sqrt {5}} \sqrt {x}\right )-\frac {1}{50} \sqrt {110+50 \sqrt {5}} \tanh ^{-1}\left (\frac {\sqrt {2+2 \sqrt {5}} \sqrt {-1+x^2}}{2-x-\sqrt {5} x}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [B] Leaf count is larger than twice the leaf count of optimal. \(541\) vs. \(2(220)=440\).
time = 0.40, antiderivative size = 541, normalized size of antiderivative = 2.46, number of steps
used = 25, number of rules used = 13, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {6874, 750,
840, 1180, 213, 209, 989, 1048, 739, 212, 210, 1032, 1079} \begin {gather*} \frac {1}{5} \sqrt {\frac {1}{5} \left (2+5 \sqrt {5}\right )} \text {ArcTan}\left (\frac {2-\left (1-\sqrt {5}\right ) x}{\sqrt {2 \left (\sqrt {5}-1\right )} \sqrt {x^2-1}}\right )-\frac {1}{5} \sqrt {\frac {1}{5} \left (5 \sqrt {5}-2\right )} \text {ArcTan}\left (\frac {2-\left (1-\sqrt {5}\right ) x}{\sqrt {2 \left (\sqrt {5}-1\right )} \sqrt {x^2-1}}\right )-\frac {1}{5} \sqrt {\frac {1}{10} \left (5 \sqrt {5}-11\right )} \text {ArcTan}\left (\frac {2-\left (1-\sqrt {5}\right ) x}{\sqrt {2 \left (\sqrt {5}-1\right )} \sqrt {x^2-1}}\right )+\frac {1}{5} \sqrt {\frac {2}{5} \left (5 \sqrt {5}-11\right )} \text {ArcTan}\left (\sqrt {\frac {2}{\sqrt {5}-1}} \sqrt {x}\right )-\frac {\sqrt {x^2-1} (1-2 x)}{5 \left (-x^2+x+1\right )}+\frac {2 \sqrt {x} (1-2 x)}{5 \left (-x^2+x+1\right )}-\frac {(3-x) \sqrt {x^2-1}}{5 \left (-x^2+x+1\right )}+\frac {(x+2) \sqrt {x^2-1}}{5 \left (-x^2+x+1\right )}+\frac {1}{5} \sqrt {\frac {1}{10} \left (11+5 \sqrt {5}\right )} \tanh ^{-1}\left (\frac {2-\left (1+\sqrt {5}\right ) x}{\sqrt {2 \left (1+\sqrt {5}\right )} \sqrt {x^2-1}}\right )-\frac {1}{5} \sqrt {\frac {1}{5} \left (2+5 \sqrt {5}\right )} \tanh ^{-1}\left (\frac {2-\left (1+\sqrt {5}\right ) x}{\sqrt {2 \left (1+\sqrt {5}\right )} \sqrt {x^2-1}}\right )-\frac {1}{5} \sqrt {\frac {1}{5} \left (5 \sqrt {5}-2\right )} \tanh ^{-1}\left (\frac {2-\left (1+\sqrt {5}\right ) x}{\sqrt {2 \left (1+\sqrt {5}\right )} \sqrt {x^2-1}}\right )-\frac {1}{5} \sqrt {\frac {2}{5} \left (11+5 \sqrt {5}\right )} \tanh ^{-1}\left (\sqrt {\frac {2}{1+\sqrt {5}}} \sqrt {x}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 210
Rule 212
Rule 213
Rule 739
Rule 750
Rule 840
Rule 989
Rule 1032
Rule 1048
Rule 1079
Rule 1180
Rule 6874
Rubi steps
\begin {align*} \int \frac {\left (\sqrt {x}-\sqrt {-1+x^2}\right )^2}{\left (1+x-x^2\right )^2 \sqrt {-1+x^2}} \, dx &=\int \left (-\frac {2 \sqrt {x}}{\left (-1-x+x^2\right )^2}-\frac {1}{\sqrt {-1+x^2} \left (-1-x+x^2\right )^2}+\frac {x}{\sqrt {-1+x^2} \left (-1-x+x^2\right )^2}+\frac {x^2}{\sqrt {-1+x^2} \left (-1-x+x^2\right )^2}\right ) \, dx\\ &=-\left (2 \int \frac {\sqrt {x}}{\left (-1-x+x^2\right )^2} \, dx\right )-\int \frac {1}{\sqrt {-1+x^2} \left (-1-x+x^2\right )^2} \, dx+\int \frac {x}{\sqrt {-1+x^2} \left (-1-x+x^2\right )^2} \, dx+\int \frac {x^2}{\sqrt {-1+x^2} \left (-1-x+x^2\right )^2} \, dx\\ &=\frac {2 (1-2 x) \sqrt {x}}{5 \left (1+x-x^2\right )}-\frac {(1-2 x) \sqrt {-1+x^2}}{5 \left (1+x-x^2\right )}-\frac {(3-x) \sqrt {-1+x^2}}{5 \left (1+x-x^2\right )}+\frac {(2+x) \sqrt {-1+x^2}}{5 \left (1+x-x^2\right )}+\frac {1}{5} \int \frac {1-3 x}{\sqrt {-1+x^2} \left (-1-x+x^2\right )} \, dx+\frac {1}{5} \int \frac {-3-x}{\sqrt {-1+x^2} \left (-1-x+x^2\right )} \, dx+\frac {1}{5} \int \frac {1+2 x}{\sqrt {-1+x^2} \left (-1-x+x^2\right )} \, dx-\frac {2}{5} \int \frac {-\frac {1}{2}-x}{\sqrt {x} \left (-1-x+x^2\right )} \, dx\\ &=\frac {2 (1-2 x) \sqrt {x}}{5 \left (1+x-x^2\right )}-\frac {(1-2 x) \sqrt {-1+x^2}}{5 \left (1+x-x^2\right )}-\frac {(3-x) \sqrt {-1+x^2}}{5 \left (1+x-x^2\right )}+\frac {(2+x) \sqrt {-1+x^2}}{5 \left (1+x-x^2\right )}-\frac {4}{5} \text {Subst}\left (\int \frac {-\frac {1}{2}-x^2}{-1-x^2+x^4} \, dx,x,\sqrt {x}\right )+\frac {1}{25} \left (2 \left (5-2 \sqrt {5}\right )\right ) \int \frac {1}{\left (-1+\sqrt {5}+2 x\right ) \sqrt {-1+x^2}} \, dx+\frac {1}{25} \left (-15+\sqrt {5}\right ) \int \frac {1}{\left (-1+\sqrt {5}+2 x\right ) \sqrt {-1+x^2}} \, dx-\frac {1}{25} \left (15+\sqrt {5}\right ) \int \frac {1}{\left (-1-\sqrt {5}+2 x\right ) \sqrt {-1+x^2}} \, dx+\frac {1}{25} \left (2 \left (5+2 \sqrt {5}\right )\right ) \int \frac {1}{\left (-1-\sqrt {5}+2 x\right ) \sqrt {-1+x^2}} \, dx+\frac {1}{25} \left (-5+7 \sqrt {5}\right ) \int \frac {1}{\left (-1+\sqrt {5}+2 x\right ) \sqrt {-1+x^2}} \, dx-\frac {1}{25} \left (5+7 \sqrt {5}\right ) \int \frac {1}{\left (-1-\sqrt {5}+2 x\right ) \sqrt {-1+x^2}} \, dx\\ &=\frac {2 (1-2 x) \sqrt {x}}{5 \left (1+x-x^2\right )}-\frac {(1-2 x) \sqrt {-1+x^2}}{5 \left (1+x-x^2\right )}-\frac {(3-x) \sqrt {-1+x^2}}{5 \left (1+x-x^2\right )}+\frac {(2+x) \sqrt {-1+x^2}}{5 \left (1+x-x^2\right )}+\frac {1}{25} \left (5-7 \sqrt {5}\right ) \text {Subst}\left (\int \frac {1}{-4+\left (-1+\sqrt {5}\right )^2-x^2} \, dx,x,\frac {-2-\left (-1+\sqrt {5}\right ) x}{\sqrt {-1+x^2}}\right )-\frac {1}{25} \left (2 \left (5-2 \sqrt {5}\right )\right ) \text {Subst}\left (\int \frac {1}{-4+\left (-1+\sqrt {5}\right )^2-x^2} \, dx,x,\frac {-2-\left (-1+\sqrt {5}\right ) x}{\sqrt {-1+x^2}}\right )+\frac {1}{25} \left (2 \left (5-2 \sqrt {5}\right )\right ) \text {Subst}\left (\int \frac {1}{-\frac {1}{2}+\frac {\sqrt {5}}{2}+x^2} \, dx,x,\sqrt {x}\right )+\frac {1}{25} \left (15-\sqrt {5}\right ) \text {Subst}\left (\int \frac {1}{-4+\left (-1+\sqrt {5}\right )^2-x^2} \, dx,x,\frac {-2-\left (-1+\sqrt {5}\right ) x}{\sqrt {-1+x^2}}\right )+\frac {1}{25} \left (15+\sqrt {5}\right ) \text {Subst}\left (\int \frac {1}{-4+\left (-1-\sqrt {5}\right )^2-x^2} \, dx,x,\frac {-2-\left (-1-\sqrt {5}\right ) x}{\sqrt {-1+x^2}}\right )-\frac {1}{25} \left (2 \left (5+2 \sqrt {5}\right )\right ) \text {Subst}\left (\int \frac {1}{-4+\left (-1-\sqrt {5}\right )^2-x^2} \, dx,x,\frac {-2-\left (-1-\sqrt {5}\right ) x}{\sqrt {-1+x^2}}\right )+\frac {1}{25} \left (2 \left (5+2 \sqrt {5}\right )\right ) \text {Subst}\left (\int \frac {1}{-\frac {1}{2}-\frac {\sqrt {5}}{2}+x^2} \, dx,x,\sqrt {x}\right )+\frac {1}{25} \left (5+7 \sqrt {5}\right ) \text {Subst}\left (\int \frac {1}{-4+\left (-1-\sqrt {5}\right )^2-x^2} \, dx,x,\frac {-2-\left (-1-\sqrt {5}\right ) x}{\sqrt {-1+x^2}}\right )\\ &=\frac {2 (1-2 x) \sqrt {x}}{5 \left (1+x-x^2\right )}-\frac {(1-2 x) \sqrt {-1+x^2}}{5 \left (1+x-x^2\right )}-\frac {(3-x) \sqrt {-1+x^2}}{5 \left (1+x-x^2\right )}+\frac {(2+x) \sqrt {-1+x^2}}{5 \left (1+x-x^2\right )}+\frac {1}{5} \sqrt {\frac {2}{5} \left (-11+5 \sqrt {5}\right )} \tan ^{-1}\left (\sqrt {\frac {2}{-1+\sqrt {5}}} \sqrt {x}\right )-\frac {1}{5} \sqrt {\frac {1}{10} \left (-11+5 \sqrt {5}\right )} \tan ^{-1}\left (\frac {2-\left (1-\sqrt {5}\right ) x}{\sqrt {2 \left (-1+\sqrt {5}\right )} \sqrt {-1+x^2}}\right )-\frac {1}{5} \sqrt {\frac {1}{5} \left (-2+5 \sqrt {5}\right )} \tan ^{-1}\left (\frac {2-\left (1-\sqrt {5}\right ) x}{\sqrt {2 \left (-1+\sqrt {5}\right )} \sqrt {-1+x^2}}\right )+\frac {1}{5} \sqrt {\frac {1}{5} \left (2+5 \sqrt {5}\right )} \tan ^{-1}\left (\frac {2-\left (1-\sqrt {5}\right ) x}{\sqrt {2 \left (-1+\sqrt {5}\right )} \sqrt {-1+x^2}}\right )-\frac {1}{5} \sqrt {\frac {2}{5} \left (11+5 \sqrt {5}\right )} \tanh ^{-1}\left (\sqrt {\frac {2}{1+\sqrt {5}}} \sqrt {x}\right )-\frac {1}{5} \sqrt {\frac {1}{5} \left (-2+5 \sqrt {5}\right )} \tanh ^{-1}\left (\frac {2-\left (1+\sqrt {5}\right ) x}{\sqrt {2 \left (1+\sqrt {5}\right )} \sqrt {-1+x^2}}\right )-\frac {1}{5} \sqrt {\frac {1}{5} \left (2+5 \sqrt {5}\right )} \tanh ^{-1}\left (\frac {2-\left (1+\sqrt {5}\right ) x}{\sqrt {2 \left (1+\sqrt {5}\right )} \sqrt {-1+x^2}}\right )+\frac {1}{5} \sqrt {\frac {1}{10} \left (11+5 \sqrt {5}\right )} \tanh ^{-1}\left (\frac {2-\left (1+\sqrt {5}\right ) x}{\sqrt {2 \left (1+\sqrt {5}\right )} \sqrt {-1+x^2}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 6.59, size = 195, normalized size = 0.89 \begin {gather*} \frac {1}{25} \left (-\frac {10 (-1+2 x) \left (-\sqrt {x}+\sqrt {-1+x^2}\right )}{-1-x+x^2}+\sqrt {-110+50 \sqrt {5}} \tan ^{-1}\left (\sqrt {\frac {1}{2} \left (1+\sqrt {5}\right )} \sqrt {x}\right )-\sqrt {-110+50 \sqrt {5}} \tan ^{-1}\left (\frac {\sqrt {-2+\sqrt {5}} \sqrt {-1+x^2}}{1+x}\right )-\sqrt {110+50 \sqrt {5}} \tanh ^{-1}\left (\sqrt {\frac {1}{2} \left (-1+\sqrt {5}\right )} \sqrt {x}\right )+\sqrt {110+50 \sqrt {5}} \tanh ^{-1}\left (\frac {\sqrt {2+\sqrt {5}} \sqrt {-1+x^2}}{1+x}\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(1636\) vs.
\(2(158)=316\).
time = 0.25, size = 1637, normalized size = 7.44
method | result | size |
default | \(\text {Expression too large to display}\) | \(1637\) |
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. 424 vs.
\(2 (153) = 306\).
time = 0.90, size = 424, normalized size = 1.93 \begin {gather*} \frac {4 \, \sqrt {5} {\left (x^{2} - x - 1\right )} \sqrt {10 \, \sqrt {5} - 22} \arctan \left (\frac {1}{2} \, \sqrt {2 \, x^{2} - \sqrt {x^{2} - 1} {\left (2 \, x + \sqrt {5} - 1\right )} + \sqrt {5} x - x} \sqrt {10 \, \sqrt {5} - 22} {\left (\sqrt {5} + 2\right )} + \frac {1}{4} \, {\left (\sqrt {5} {\left (2 \, x + 1\right )} - 2 \, \sqrt {x^{2} - 1} {\left (\sqrt {5} + 2\right )} + 4 \, x + 3\right )} \sqrt {10 \, \sqrt {5} - 22}\right ) - 4 \, \sqrt {5} {\left (x^{2} - x - 1\right )} \sqrt {10 \, \sqrt {5} - 22} \arctan \left (\frac {1}{4} \, {\left (\sqrt {2} \sqrt {2 \, x + \sqrt {5} - 1} {\left (\sqrt {5} + 2\right )} - 2 \, \sqrt {x} {\left (\sqrt {5} + 2\right )}\right )} \sqrt {10 \, \sqrt {5} - 22}\right ) - \sqrt {5} {\left (x^{2} - x - 1\right )} \sqrt {10 \, \sqrt {5} + 22} \log \left (\sqrt {10 \, \sqrt {5} + 22} {\left (\sqrt {5} - 3\right )} - 4 \, x + 2 \, \sqrt {5} + 4 \, \sqrt {x^{2} - 1} + 2\right ) + \sqrt {5} {\left (x^{2} - x - 1\right )} \sqrt {10 \, \sqrt {5} + 22} \log \left (\sqrt {10 \, \sqrt {5} + 22} {\left (\sqrt {5} - 3\right )} + 4 \, \sqrt {x}\right ) + \sqrt {5} {\left (x^{2} - x - 1\right )} \sqrt {10 \, \sqrt {5} + 22} \log \left (-\sqrt {10 \, \sqrt {5} + 22} {\left (\sqrt {5} - 3\right )} - 4 \, x + 2 \, \sqrt {5} + 4 \, \sqrt {x^{2} - 1} + 2\right ) - \sqrt {5} {\left (x^{2} - x - 1\right )} \sqrt {10 \, \sqrt {5} + 22} \log \left (-\sqrt {10 \, \sqrt {5} + 22} {\left (\sqrt {5} - 3\right )} + 4 \, \sqrt {x}\right ) - 40 \, x^{2} - 20 \, \sqrt {x^{2} - 1} {\left (2 \, x - 1\right )} + 20 \, {\left (2 \, x - 1\right )} \sqrt {x} + 40 \, x + 40}{50 \, {\left (x^{2} - x - 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 358 vs.
\(2 (153) = 306\).
time = 1.88, size = 358, normalized size = 1.63 \begin {gather*} \frac {2}{5} \, \sqrt {\frac {1}{2} \, \sqrt {5} - \frac {11}{10}} \arctan \left (\frac {2 \, x + \sqrt {5} - 2 \, \sqrt {x^{2} - 1} - 1}{\sqrt {2 \, \sqrt {5} - 2}}\right ) + \frac {1}{25} \, \sqrt {50 \, \sqrt {5} - 110} \arctan \left (\frac {\sqrt {x}}{\sqrt {\frac {1}{2} \, \sqrt {5} - \frac {1}{2}}}\right ) - \frac {1}{50} \, \sqrt {50 \, \sqrt {5} + 110} \log \left (\sqrt {x} + \sqrt {\frac {1}{2} \, \sqrt {5} + \frac {1}{2}}\right ) - \frac {1}{5} \, \sqrt {\frac {1}{2} \, \sqrt {5} + \frac {11}{10}} \log \left ({\left | -520 \, x - 78 \, \sqrt {5} \sqrt {50 \, \sqrt {5} + 110} + 260 \, \sqrt {5} + 520 \, \sqrt {x^{2} - 1} + 130 \, \sqrt {50 \, \sqrt {5} + 110} + 260 \right |}\right ) + \frac {1}{5} \, \sqrt {\frac {1}{2} \, \sqrt {5} + \frac {11}{10}} \log \left ({\left | -1040 \, x + 156 \, \sqrt {5} \sqrt {50 \, \sqrt {5} + 110} + 520 \, \sqrt {5} + 1040 \, \sqrt {x^{2} - 1} - 260 \, \sqrt {50 \, \sqrt {5} + 110} + 520 \right |}\right ) + \frac {1}{50} \, \sqrt {50 \, \sqrt {5} + 110} \log \left ({\left | \sqrt {x} - \sqrt {\frac {1}{2} \, \sqrt {5} + \frac {1}{2}} \right |}\right ) + \frac {4 \, {\left ({\left (x - \sqrt {x^{2} - 1}\right )}^{3} + 2 \, {\left (x - \sqrt {x^{2} - 1}\right )}^{2} + 3 \, x - 3 \, \sqrt {x^{2} - 1} - 2\right )}}{5 \, {\left ({\left (x - \sqrt {x^{2} - 1}\right )}^{4} - 2 \, {\left (x - \sqrt {x^{2} - 1}\right )}^{3} - 2 \, {\left (x - \sqrt {x^{2} - 1}\right )}^{2} - 2 \, x + 2 \, \sqrt {x^{2} - 1} + 1\right )}} + \frac {2 \, {\left (2 \, x^{\frac {3}{2}} - \sqrt {x}\right )}}{5 \, {\left (x^{2} - x - 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {{\left (\sqrt {x^2-1}-\sqrt {x}\right )}^2}{\sqrt {x^2-1}\,{\left (-x^2+x+1\right )}^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________