Optimal. Leaf size=40 \[ -\frac {\sqrt {1+\left (-1-k^2\right ) x^2+k^2 x^4}}{x \left (-1+k^2 x^2\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.33, antiderivative size = 63, normalized size of antiderivative = 1.58, number of steps
used = 4, number of rules used = 4, integrand size = 54, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.074, Rules used = {1976, 1697,
1704, 1604} \begin {gather*} \frac {k^2 x \left (1-x^2\right )}{\sqrt {k^2 x^4-\left (k^2+1\right ) x^2+1}}+\frac {\sqrt {k^2 x^4-\left (k^2+1\right ) x^2+1}}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 1604
Rule 1697
Rule 1704
Rule 1976
Rubi steps
\begin {align*} \int \frac {1-2 k^2 x^2+k^2 x^4}{x^2 \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )} \left (-1+k^2 x^2\right )} \, dx &=\frac {\left (\sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {1-2 k^2 x^2+k^2 x^4}{x^2 \sqrt {1-x^2} \sqrt {1-k^2 x^2} \left (-1+k^2 x^2\right )} \, dx}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}\\ &=-\frac {\left (\sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {1-2 k^2 x^2+k^2 x^4}{x^2 \sqrt {1-x^2} \left (1-k^2 x^2\right )^{3/2}} \, dx}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}\\ &=-\frac {\left (\sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \left (-\frac {2 k^2}{\sqrt {1-x^2} \left (1-k^2 x^2\right )^{3/2}}+\frac {1}{x^2 \sqrt {1-x^2} \left (1-k^2 x^2\right )^{3/2}}+\frac {k^2 x^2}{\sqrt {1-x^2} \left (1-k^2 x^2\right )^{3/2}}\right ) \, dx}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}\\ &=-\frac {\left (\sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {1}{x^2 \sqrt {1-x^2} \left (1-k^2 x^2\right )^{3/2}} \, dx}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}-\frac {\left (k^2 \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {x^2}{\sqrt {1-x^2} \left (1-k^2 x^2\right )^{3/2}} \, dx}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\left (2 k^2 \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {1}{\sqrt {1-x^2} \left (1-k^2 x^2\right )^{3/2}} \, dx}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}\\ &=\frac {k^2 \left (1-x^2\right )}{\left (1-k^2\right ) x \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {k^2 x \left (1-x^2\right )}{\left (1-k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}-\frac {2 k^4 x \left (1-x^2\right )}{\left (1-k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}-\frac {\left (\sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {-1+2 k^2-k^2 x^2}{x^2 \sqrt {1-x^2} \sqrt {1-k^2 x^2}} \, dx}{\left (-1+k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\left (k^2 \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {\sqrt {1-x^2}}{\sqrt {1-k^2 x^2}} \, dx}{\left (-1+k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\left (2 k^2 \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {-1+k^2 x^2}{\sqrt {1-x^2} \sqrt {1-k^2 x^2}} \, dx}{\left (-1+k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}\\ &=\frac {k^2 \left (1-x^2\right )}{\left (1-k^2\right ) x \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {k^2 x \left (1-x^2\right )}{\left (1-k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}-\frac {2 k^4 x \left (1-x^2\right )}{\left (1-k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\left (1-2 k^2\right ) \left (1-x^2\right ) \left (1-k^2 x^2\right )}{\left (1-k^2\right ) x \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}-\frac {k \sqrt {1-x^2} \sqrt {1-k^2 x^2} E\left (\sin ^{-1}(k x)|\frac {1}{k^2}\right )}{\left (1-k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\left (\sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {k^2+k^2 \left (1-2 k^2\right ) x^2}{\sqrt {1-x^2} \sqrt {1-k^2 x^2}} \, dx}{\left (-1+k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}-\frac {\left (2 k^2 \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {\sqrt {1-k^2 x^2}}{\sqrt {1-x^2}} \, dx}{\left (-1+k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}\\ &=\frac {k^2 \left (1-x^2\right )}{\left (1-k^2\right ) x \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {k^2 x \left (1-x^2\right )}{\left (1-k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}-\frac {2 k^4 x \left (1-x^2\right )}{\left (1-k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\left (1-2 k^2\right ) \left (1-x^2\right ) \left (1-k^2 x^2\right )}{\left (1-k^2\right ) x \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {2 k^2 \sqrt {1-x^2} \sqrt {1-k^2 x^2} E\left (\sin ^{-1}(x)|k^2\right )}{\left (1-k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}-\frac {k \sqrt {1-x^2} \sqrt {1-k^2 x^2} E\left (\sin ^{-1}(k x)|\frac {1}{k^2}\right )}{\left (1-k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\left (\left (1-k^2\right ) \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {1}{\sqrt {1-x^2} \sqrt {1-k^2 x^2}} \, dx}{\left (-1+k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\left (\left (-1+2 k^2\right ) \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {\sqrt {1-k^2 x^2}}{\sqrt {1-x^2}} \, dx}{\left (-1+k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}\\ &=\frac {k^2 \left (1-x^2\right )}{\left (1-k^2\right ) x \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {k^2 x \left (1-x^2\right )}{\left (1-k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}-\frac {2 k^4 x \left (1-x^2\right )}{\left (1-k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\left (1-2 k^2\right ) \left (1-x^2\right ) \left (1-k^2 x^2\right )}{\left (1-k^2\right ) x \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {2 k^2 \sqrt {1-x^2} \sqrt {1-k^2 x^2} E\left (\sin ^{-1}(x)|k^2\right )}{\left (1-k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\left (1-2 k^2\right ) \sqrt {1-x^2} \sqrt {1-k^2 x^2} E\left (\sin ^{-1}(x)|k^2\right )}{\left (1-k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}-\frac {k \sqrt {1-x^2} \sqrt {1-k^2 x^2} E\left (\sin ^{-1}(k x)|\frac {1}{k^2}\right )}{\left (1-k^2\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}-\frac {\sqrt {1-x^2} \sqrt {1-k^2 x^2} F\left (\sin ^{-1}(x)|k^2\right )}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 7.41, size = 30, normalized size = 0.75 \begin {gather*} \frac {1-x^2}{x \sqrt {\left (-1+x^2\right ) \left (-1+k^2 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
2.
time = 0.39, size = 551, normalized size = 13.78
method | result | size |
gosper | \(-\frac {\left (1+x \right ) \left (-1+x \right )}{\sqrt {\left (x^{2}-1\right ) \left (k^{2} x^{2}-1\right )}\, x}\) | \(29\) |
elliptic | \(\frac {-x^{2}+1}{x \sqrt {\left (-x^{2}+1\right ) \left (-k^{2} x^{2}+1\right )}\, k^{2}}\) | \(35\) |
trager | \(-\frac {\sqrt {k^{2} x^{4}-k^{2} x^{2}-x^{2}+1}}{x \left (k^{2} x^{2}-1\right )}\) | \(41\) |
risch | \(\frac {\left (x^{2}-1\right ) \left (k^{2} x^{2}-1\right )}{x \sqrt {\left (x^{2}-1\right ) \left (k^{2} x^{2}-1\right )}}-\frac {\left (-1+x \right ) \left (1+x \right ) k^{2} x}{\sqrt {\left (x^{2}-1\right ) \left (k^{2} x^{2}-1\right )}}\) | \(66\) |
default | \(\frac {\sqrt {-x^{2}+1}\, \sqrt {-k^{2} x^{2}+1}\, \EllipticF \left (x , k\right )}{\sqrt {k^{2} x^{4}-k^{2} x^{2}-x^{2}+1}}+\left (-\frac {k^{2}}{2}+\frac {1}{2}\right ) \left (\frac {k^{2} x^{3}-k^{2} x +k \,x^{2}-k}{\left (k^{2}-1\right ) \sqrt {\left (x -\frac {1}{k}\right ) \left (k^{2} x^{3}-k^{2} x +k \,x^{2}-k \right )}}+\frac {\left (-\frac {k^{2}-2}{2 \left (k^{2}-1\right )}+\frac {k^{2}}{2 k^{2}-2}\right ) \sqrt {-x^{2}+1}\, \sqrt {-k^{2} x^{2}+1}\, \EllipticF \left (x , k\right )}{\sqrt {k^{2} x^{4}-k^{2} x^{2}-x^{2}+1}}-\frac {\sqrt {-x^{2}+1}\, \sqrt {-k^{2} x^{2}+1}\, \left (\EllipticF \left (x , k\right )-\EllipticE \left (x , k\right )\right )}{\left (k^{2}-1\right ) \sqrt {k^{2} x^{4}-k^{2} x^{2}-x^{2}+1}}\right )+\left (\frac {k^{2}}{2}-\frac {1}{2}\right ) \left (-\frac {k^{2} x^{3}-k^{2} x -k \,x^{2}+k}{\left (k^{2}-1\right ) \sqrt {\left (x +\frac {1}{k}\right ) \left (k^{2} x^{3}-k^{2} x -k \,x^{2}+k \right )}}+\frac {\left (\frac {k^{2}-2}{2 k^{2}-2}-\frac {k^{2}}{2 \left (k^{2}-1\right )}\right ) \sqrt {-x^{2}+1}\, \sqrt {-k^{2} x^{2}+1}\, \EllipticF \left (x , k\right )}{\sqrt {k^{2} x^{4}-k^{2} x^{2}-x^{2}+1}}+\frac {\sqrt {-x^{2}+1}\, \sqrt {-k^{2} x^{2}+1}\, \left (\EllipticF \left (x , k\right )-\EllipticE \left (x , k\right )\right )}{\left (k^{2}-1\right ) \sqrt {k^{2} x^{4}-k^{2} x^{2}-x^{2}+1}}\right )+\frac {\sqrt {k^{2} x^{4}-k^{2} x^{2}-x^{2}+1}}{x}-\frac {\sqrt {-x^{2}+1}\, \sqrt {-k^{2} x^{2}+1}\, \left (\EllipticF \left (x , k\right )-\EllipticE \left (x , k\right )\right )}{\sqrt {k^{2} x^{4}-k^{2} x^{2}-x^{2}+1}}\) | \(551\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.34, size = 34, normalized size = 0.85 \begin {gather*} -\frac {x^{2} - 1}{\sqrt {k x + 1} \sqrt {k x - 1} \sqrt {x + 1} \sqrt {x - 1} x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 36, normalized size = 0.90 \begin {gather*} -\frac {\sqrt {k^{2} x^{4} - {\left (k^{2} + 1\right )} x^{2} + 1}}{k^{2} 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 {k^{2} x^{4} - 2 k^{2} x^{2} + 1}{x^{2} \sqrt {\left (x - 1\right ) \left (x + 1\right ) \left (k x - 1\right ) \left (k x + 1\right )} \left (k x - 1\right ) \left (k 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.33, size = 33, normalized size = 0.82 \begin {gather*} -\frac {\sqrt {\left (x^2-1\right )\,\left (k^2\,x^2-1\right )}}{x\,\left (k^2\,x^2-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________