Optimal. Leaf size=18 \[ -\frac {\sqrt {x^4-1}}{2 (x-1)^2} \]
________________________________________________________________________________________
Rubi [B] time = 0.41, antiderivative size = 68, normalized size of antiderivative = 3.78, number of steps used = 32, number of rules used = 19, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.905, Rules used = {6742, 222, 2153, 1152, 414, 527, 524, 427, 424, 253, 1248, 659, 651, 1256, 471, 21, 1725, 423, 426} \begin {gather*} \frac {x \left (x^2+1\right )}{\left (1-x^2\right ) \sqrt {x^4-1}}+\frac {\sqrt {x^4-1}}{2 \left (1-x^2\right )}-\frac {\sqrt {x^4-1}}{\left (1-x^2\right )^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 21
Rule 222
Rule 253
Rule 414
Rule 423
Rule 424
Rule 426
Rule 427
Rule 471
Rule 524
Rule 527
Rule 651
Rule 659
Rule 1152
Rule 1248
Rule 1256
Rule 1725
Rule 2153
Rule 6742
Rubi steps
\begin {align*} \int \frac {1+x+x^2}{(-1+x)^2 \sqrt {-1+x^4}} \, dx &=\int \left (\frac {1}{\sqrt {-1+x^4}}+\frac {3}{(-1+x)^2 \sqrt {-1+x^4}}+\frac {3}{(-1+x) \sqrt {-1+x^4}}\right ) \, dx\\ &=3 \int \frac {1}{(-1+x)^2 \sqrt {-1+x^4}} \, dx+3 \int \frac {1}{(-1+x) \sqrt {-1+x^4}} \, dx+\int \frac {1}{\sqrt {-1+x^4}} \, dx\\ &=\frac {\sqrt {-1+x^2} \sqrt {1+x^2} F\left (\sin ^{-1}\left (\frac {\sqrt {2} x}{\sqrt {-1+x^2}}\right )|\frac {1}{2}\right )}{\sqrt {2} \sqrt {-1+x^4}}-3 \int \frac {1}{\left (1-x^2\right ) \sqrt {-1+x^4}} \, dx-3 \int \frac {x}{\left (1-x^2\right ) \sqrt {-1+x^4}} \, dx+3 \int \left (\frac {1}{\left (-1+x^2\right )^2 \sqrt {-1+x^4}}+\frac {2 x}{\left (-1+x^2\right )^2 \sqrt {-1+x^4}}+\frac {x^2}{\left (-1+x^2\right )^2 \sqrt {-1+x^4}}\right ) \, dx\\ &=\frac {\sqrt {-1+x^2} \sqrt {1+x^2} F\left (\sin ^{-1}\left (\frac {\sqrt {2} x}{\sqrt {-1+x^2}}\right )|\frac {1}{2}\right )}{\sqrt {2} \sqrt {-1+x^4}}-\frac {3}{2} \operatorname {Subst}\left (\int \frac {1}{(1-x) \sqrt {-1+x^2}} \, dx,x,x^2\right )+3 \int \frac {1}{\left (-1+x^2\right )^2 \sqrt {-1+x^4}} \, dx+3 \int \frac {x^2}{\left (-1+x^2\right )^2 \sqrt {-1+x^4}} \, dx+6 \int \frac {x}{\left (-1+x^2\right )^2 \sqrt {-1+x^4}} \, dx-\frac {\left (3 \sqrt {-1-x^2} \sqrt {1-x^2}\right ) \int \frac {1}{\sqrt {-1-x^2} \left (1-x^2\right )^{3/2}} \, dx}{\sqrt {-1+x^4}}\\ &=-\frac {3 x \left (1+x^2\right )}{2 \sqrt {-1+x^4}}+\frac {3 \sqrt {-1+x^4}}{2 \left (1-x^2\right )}+\frac {\sqrt {-1+x^2} \sqrt {1+x^2} F\left (\sin ^{-1}\left (\frac {\sqrt {2} x}{\sqrt {-1+x^2}}\right )|\frac {1}{2}\right )}{\sqrt {2} \sqrt {-1+x^4}}+3 \operatorname {Subst}\left (\int \frac {1}{(-1+x)^2 \sqrt {-1+x^2}} \, dx,x,x^2\right )+\frac {\left (3 \sqrt {-1-x^2} \sqrt {1-x^2}\right ) \int \frac {-1+x^2}{\sqrt {-1-x^2} \sqrt {1-x^2}} \, dx}{2 \sqrt {-1+x^4}}+\frac {\left (3 \sqrt {-1+x^2} \sqrt {1+x^2}\right ) \int \frac {1}{\left (-1+x^2\right )^{5/2} \sqrt {1+x^2}} \, dx}{\sqrt {-1+x^4}}+\frac {\left (3 \sqrt {-1+x^2} \sqrt {1+x^2}\right ) \int \frac {x^2}{\left (-1+x^2\right )^{5/2} \sqrt {1+x^2}} \, dx}{\sqrt {-1+x^4}}\\ &=-\frac {3 x \left (1+x^2\right )}{2 \sqrt {-1+x^4}}+\frac {x \left (1+x^2\right )}{\left (1-x^2\right ) \sqrt {-1+x^4}}-\frac {\sqrt {-1+x^4}}{\left (1-x^2\right )^2}+\frac {3 \sqrt {-1+x^4}}{2 \left (1-x^2\right )}+\frac {\sqrt {-1+x^2} \sqrt {1+x^2} F\left (\sin ^{-1}\left (\frac {\sqrt {2} x}{\sqrt {-1+x^2}}\right )|\frac {1}{2}\right )}{\sqrt {2} \sqrt {-1+x^4}}-\frac {\left (3 \sqrt {-1-x^2} \sqrt {1-x^2}\right ) \int \frac {\sqrt {1-x^2}}{\sqrt {-1-x^2}} \, dx}{2 \sqrt {-1+x^4}}+\frac {\left (\sqrt {-1+x^2} \sqrt {1+x^2}\right ) \int \frac {-5-x^2}{\left (-1+x^2\right )^{3/2} \sqrt {1+x^2}} \, dx}{2 \sqrt {-1+x^4}}+\frac {\left (\sqrt {-1+x^2} \sqrt {1+x^2}\right ) \int \frac {1-x^2}{\left (-1+x^2\right )^{3/2} \sqrt {1+x^2}} \, dx}{2 \sqrt {-1+x^4}}-\operatorname {Subst}\left (\int \frac {1}{(-1+x) \sqrt {-1+x^2}} \, dx,x,x^2\right )\\ &=\frac {x \left (1+x^2\right )}{\left (1-x^2\right ) \sqrt {-1+x^4}}-\frac {\sqrt {-1+x^4}}{\left (1-x^2\right )^2}+\frac {\sqrt {-1+x^4}}{2 \left (1-x^2\right )}+\frac {\sqrt {-1+x^2} \sqrt {1+x^2} F\left (\sin ^{-1}\left (\frac {\sqrt {2} x}{\sqrt {-1+x^2}}\right )|\frac {1}{2}\right )}{\sqrt {2} \sqrt {-1+x^4}}-\frac {\left (3 \sqrt {-1-x^2} \sqrt {1-x^2}\right ) \int \frac {\sqrt {-1-x^2}}{\sqrt {1-x^2}} \, dx}{2 \sqrt {-1+x^4}}-\frac {\left (3 \sqrt {-1-x^2} \sqrt {1-x^2}\right ) \int \frac {1}{\sqrt {-1-x^2} \sqrt {1-x^2}} \, dx}{\sqrt {-1+x^4}}+\frac {\left (\sqrt {-1+x^2} \sqrt {1+x^2}\right ) \int \frac {4-6 x^2}{\sqrt {-1+x^2} \sqrt {1+x^2}} \, dx}{4 \sqrt {-1+x^4}}-\frac {\left (\sqrt {-1+x^2} \sqrt {1+x^2}\right ) \int \frac {1}{\sqrt {-1+x^2} \sqrt {1+x^2}} \, dx}{2 \sqrt {-1+x^4}}\\ &=\frac {x \left (1+x^2\right )}{\left (1-x^2\right ) \sqrt {-1+x^4}}-\frac {\sqrt {-1+x^4}}{\left (1-x^2\right )^2}+\frac {\sqrt {-1+x^4}}{2 \left (1-x^2\right )}+\frac {\sqrt {-1+x^2} \sqrt {1+x^2} F\left (\sin ^{-1}\left (\frac {\sqrt {2} x}{\sqrt {-1+x^2}}\right )|\frac {1}{2}\right )}{\sqrt {2} \sqrt {-1+x^4}}-\frac {1}{2} \int \frac {1}{\sqrt {-1+x^4}} \, dx-3 \int \frac {1}{\sqrt {-1+x^4}} \, dx-\frac {\left (3 \left (-1-x^2\right ) \sqrt {1-x^2}\right ) \int \frac {\sqrt {1+x^2}}{\sqrt {1-x^2}} \, dx}{2 \sqrt {1+x^2} \sqrt {-1+x^4}}-\frac {\left (3 \sqrt {-1+x^2} \sqrt {1+x^2}\right ) \int \frac {\sqrt {1+x^2}}{\sqrt {-1+x^2}} \, dx}{2 \sqrt {-1+x^4}}+\frac {\left (5 \sqrt {-1+x^2} \sqrt {1+x^2}\right ) \int \frac {1}{\sqrt {-1+x^2} \sqrt {1+x^2}} \, dx}{2 \sqrt {-1+x^4}}\\ &=\frac {x \left (1+x^2\right )}{\left (1-x^2\right ) \sqrt {-1+x^4}}-\frac {\sqrt {-1+x^4}}{\left (1-x^2\right )^2}+\frac {\sqrt {-1+x^4}}{2 \left (1-x^2\right )}+\frac {3 \sqrt {1-x^2} \sqrt {1+x^2} E\left (\left .\sin ^{-1}(x)\right |-1\right )}{2 \sqrt {-1+x^4}}-\frac {5 \sqrt {-1+x^2} \sqrt {1+x^2} F\left (\sin ^{-1}\left (\frac {\sqrt {2} x}{\sqrt {-1+x^2}}\right )|\frac {1}{2}\right )}{2 \sqrt {2} \sqrt {-1+x^4}}+\frac {5}{2} \int \frac {1}{\sqrt {-1+x^4}} \, dx-\frac {\left (3 \sqrt {1-x^2} \sqrt {1+x^2}\right ) \int \frac {\sqrt {1+x^2}}{\sqrt {1-x^2}} \, dx}{2 \sqrt {-1+x^4}}\\ &=\frac {x \left (1+x^2\right )}{\left (1-x^2\right ) \sqrt {-1+x^4}}-\frac {\sqrt {-1+x^4}}{\left (1-x^2\right )^2}+\frac {\sqrt {-1+x^4}}{2 \left (1-x^2\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.14, size = 33, normalized size = 1.83 \begin {gather*} \frac {-x^3-x^2-x-1}{2 (x-1) \sqrt {x^4-1}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [A] time = 3.33, size = 18, normalized size = 1.00 \begin {gather*} -\frac {\sqrt {-1+x^4}}{2 (-1+x)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.47, size = 19, normalized size = 1.06 \begin {gather*} -\frac {\sqrt {x^{4} - 1}}{2 \, {\left (x^{2} - 2 \, x + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.45, size = 27, normalized size = 1.50 \begin {gather*} -\frac {1}{2} \, \sqrt {\frac {4}{x - 1} + \frac {6}{{\left (x - 1\right )}^{2}} + \frac {4}{{\left (x - 1\right )}^{3}} + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.12, size = 15, normalized size = 0.83
method | result | size |
default | \(-\frac {\sqrt {x^{4}-1}}{2 \left (-1+x \right )^{2}}\) | \(15\) |
trager | \(-\frac {\sqrt {x^{4}-1}}{2 \left (-1+x \right )^{2}}\) | \(15\) |
elliptic | \(-\frac {\sqrt {x^{4}-1}}{2 \left (-1+x \right )^{2}}\) | \(15\) |
gosper | \(-\frac {\left (1+x \right ) \left (x^{2}+1\right )}{2 \left (-1+x \right ) \sqrt {x^{4}-1}}\) | \(23\) |
risch | \(-\frac {x^{3}+x^{2}+x +1}{2 \left (-1+x \right ) \sqrt {x^{4}-1}}\) | \(24\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.59, size = 28, normalized size = 1.56 \begin {gather*} -\frac {x^{3} + x^{2} + x + 1}{2 \, \sqrt {x^{2} + 1} \sqrt {x + 1} {\left (x - 1\right )}^{\frac {3}{2}}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.14, size = 14, normalized size = 0.78 \begin {gather*} -\frac {\sqrt {x^4-1}}{2\,{\left (x-1\right )}^2} \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 + 1\right ) \left (x^{2} + 1\right )} \left (x - 1\right )^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________