Optimal. Leaf size=85 \[ -\frac {\text {ArcTan}\left (\frac {(-1+k) x}{\sqrt {x+\left (-1-k^2\right ) x^2+k^2 x^3}}\right )}{2 (-1+k) k}+\frac {\text {ArcTan}\left (\frac {(1+k) x}{\sqrt {x+\left (-1-k^2\right ) x^2+k^2 x^3}}\right )}{2 k (1+k)} \]
[Out]
________________________________________________________________________________________
Rubi [C] Result contains higher order function than in optimal. Order 4 vs. order 3 in
optimal.
time = 1.06, antiderivative size = 203, normalized size of antiderivative = 2.39, number of steps
used = 13, number of rules used = 7, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.219, Rules used = {6850, 6857,
181, 116, 174, 552, 551} \begin {gather*} \frac {\sqrt {1-x} \sqrt {x} \sqrt {\frac {k^2 (1-x)}{1-k^2}+1} \Pi \left (-\frac {k}{1-k};\text {ArcSin}\left (\sqrt {1-x}\right )|-\frac {k^2}{1-k^2}\right )}{(1-k) k \sqrt {(1-x) x \left (1-k^2 x\right )}}-\frac {\sqrt {1-x} \sqrt {x} \sqrt {\frac {k^2 (1-x)}{1-k^2}+1} \Pi \left (\frac {k}{k+1};\text {ArcSin}\left (\sqrt {1-x}\right )|-\frac {k^2}{1-k^2}\right )}{k (k+1) \sqrt {(1-x) x \left (1-k^2 x\right )}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 116
Rule 174
Rule 181
Rule 551
Rule 552
Rule 6850
Rule 6857
Rubi steps
\begin {align*} \int \frac {x}{\sqrt {(1-x) x \left (1-k^2 x\right )} \left (-1+k^2 x^2\right )} \, dx &=\frac {\left (\sqrt {1-x} \sqrt {x} \sqrt {1-k^2 x}\right ) \int \frac {\sqrt {x}}{\sqrt {1-x} \sqrt {1-k^2 x} \left (-1+k^2 x^2\right )} \, dx}{\sqrt {(1-x) x \left (1-k^2 x\right )}}\\ &=\frac {\left (\sqrt {1-x} \sqrt {x} \sqrt {1-k^2 x}\right ) \int \left (-\frac {\sqrt {x}}{2 \sqrt {1-x} (1-k x) \sqrt {1-k^2 x}}-\frac {\sqrt {x}}{2 \sqrt {1-x} (1+k x) \sqrt {1-k^2 x}}\right ) \, dx}{\sqrt {(1-x) x \left (1-k^2 x\right )}}\\ &=-\frac {\left (\sqrt {1-x} \sqrt {x} \sqrt {1-k^2 x}\right ) \int \frac {\sqrt {x}}{\sqrt {1-x} (1-k x) \sqrt {1-k^2 x}} \, dx}{2 \sqrt {(1-x) x \left (1-k^2 x\right )}}-\frac {\left (\sqrt {1-x} \sqrt {x} \sqrt {1-k^2 x}\right ) \int \frac {\sqrt {x}}{\sqrt {1-x} (1+k x) \sqrt {1-k^2 x}} \, dx}{2 \sqrt {(1-x) x \left (1-k^2 x\right )}}\\ &=-\frac {\left (\sqrt {1-x} \sqrt {x} \sqrt {1-k^2 x}\right ) \int \frac {1}{\sqrt {1-x} \sqrt {x} (1-k x) \sqrt {1-k^2 x}} \, dx}{2 k \sqrt {(1-x) x \left (1-k^2 x\right )}}+\frac {\left (\sqrt {1-x} \sqrt {x} \sqrt {1-k^2 x}\right ) \int \frac {1}{\sqrt {1-x} \sqrt {x} (1+k x) \sqrt {1-k^2 x}} \, dx}{2 k \sqrt {(1-x) x \left (1-k^2 x\right )}}\\ &=-\frac {\left (\sqrt {1-x} \sqrt {x} \sqrt {1-k^2 x}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1-x^2} \left (1+k-k x^2\right ) \sqrt {1-k^2+k^2 x^2}} \, dx,x,\sqrt {1-x}\right )}{k \sqrt {(1-x) x \left (1-k^2 x\right )}}+\frac {\left (\sqrt {1-x} \sqrt {x} \sqrt {1-k^2 x}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1-x^2} \left (1-k+k x^2\right ) \sqrt {1-k^2+k^2 x^2}} \, dx,x,\sqrt {1-x}\right )}{k \sqrt {(1-x) x \left (1-k^2 x\right )}}\\ &=-\frac {\left (\sqrt {1+\frac {k^2 (-1+x)}{-1+k^2}} \sqrt {1-x} \sqrt {x}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1-x^2} \left (1+k-k x^2\right ) \sqrt {1+\frac {k^2 x^2}{1-k^2}}} \, dx,x,\sqrt {1-x}\right )}{k \sqrt {(1-x) x \left (1-k^2 x\right )}}+\frac {\left (\sqrt {1+\frac {k^2 (-1+x)}{-1+k^2}} \sqrt {1-x} \sqrt {x}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1-x^2} \left (1-k+k x^2\right ) \sqrt {1+\frac {k^2 x^2}{1-k^2}}} \, dx,x,\sqrt {1-x}\right )}{k \sqrt {(1-x) x \left (1-k^2 x\right )}}\\ &=\frac {\sqrt {1+\frac {k^2 (1-x)}{1-k^2}} \sqrt {1-x} \sqrt {x} \Pi \left (-\frac {k}{1-k};\sin ^{-1}\left (\sqrt {1-x}\right )|-\frac {k^2}{1-k^2}\right )}{(1-k) k \sqrt {(1-x) x \left (1-k^2 x\right )}}-\frac {\sqrt {1+\frac {k^2 (1-x)}{1-k^2}} \sqrt {1-x} \sqrt {x} \Pi \left (\frac {k}{1+k};\sin ^{-1}\left (\sqrt {1-x}\right )|-\frac {k^2}{1-k^2}\right )}{k (1+k) \sqrt {(1-x) x \left (1-k^2 x\right )}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 4 vs. order 3 in
optimal.
time = 15.70, size = 154, normalized size = 1.81 \begin {gather*} \frac {i \sqrt {1+\frac {1-\frac {1}{k^2}}{-1+x}} \sqrt {-1+x} x \left (2 k F\left (i \sinh ^{-1}\left (\frac {1}{\sqrt {-1+x}}\right )|1-\frac {1}{k^2}\right )-(-1+k) \Pi \left (1+\frac {1}{k};i \sinh ^{-1}\left (\frac {1}{\sqrt {-1+x}}\right )|1-\frac {1}{k^2}\right )-(1+k) \Pi \left (\frac {-1+k}{k};i \sinh ^{-1}\left (\frac {1}{\sqrt {-1+x}}\right )|1-\frac {1}{k^2}\right )\right )}{k \left (-1+k^2\right ) \sqrt {1+\frac {1}{-1+x}} \sqrt {(-1+x) x \left (-1+k^2 x\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 = 0.57, size = 232, normalized size = 2.73
method | result | size |
default | \(-\frac {\sqrt {-\left (x -\frac {1}{k^{2}}\right ) k^{2}}\, \sqrt {\frac {-1+x}{\frac {1}{k^{2}}-1}}\, \sqrt {k^{2} x}\, \EllipticPi \left (\sqrt {-\left (x -\frac {1}{k^{2}}\right ) k^{2}}, \frac {1}{k^{2} \left (\frac {1}{k^{2}}+\frac {1}{k}\right )}, \sqrt {\frac {1}{k^{2} \left (\frac {1}{k^{2}}-1\right )}}\right )}{k^{4} \sqrt {k^{2} x^{3}-k^{2} x^{2}-x^{2}+x}\, \left (\frac {1}{k^{2}}+\frac {1}{k}\right )}-\frac {\sqrt {-\left (x -\frac {1}{k^{2}}\right ) k^{2}}\, \sqrt {\frac {-1+x}{\frac {1}{k^{2}}-1}}\, \sqrt {k^{2} x}\, \EllipticPi \left (\sqrt {-\left (x -\frac {1}{k^{2}}\right ) k^{2}}, \frac {1}{k^{2} \left (\frac {1}{k^{2}}-\frac {1}{k}\right )}, \sqrt {\frac {1}{k^{2} \left (\frac {1}{k^{2}}-1\right )}}\right )}{k^{4} \sqrt {k^{2} x^{3}-k^{2} x^{2}-x^{2}+x}\, \left (\frac {1}{k^{2}}-\frac {1}{k}\right )}\) | \(232\) |
elliptic | \(-\frac {\sqrt {-k^{2} x +1}\, \sqrt {-\frac {1}{\frac {1}{k^{2}}-1}+\frac {x}{\frac {1}{k^{2}}-1}}\, \sqrt {k^{2} x}\, \EllipticPi \left (\sqrt {-\left (x -\frac {1}{k^{2}}\right ) k^{2}}, \frac {1}{k^{2} \left (\frac {1}{k^{2}}+\frac {1}{k}\right )}, \sqrt {\frac {1}{k^{2} \left (\frac {1}{k^{2}}-1\right )}}\right )}{k^{4} \sqrt {k^{2} x^{3}-k^{2} x^{2}-x^{2}+x}\, \left (\frac {1}{k^{2}}+\frac {1}{k}\right )}-\frac {\sqrt {-k^{2} x +1}\, \sqrt {-\frac {1}{\frac {1}{k^{2}}-1}+\frac {x}{\frac {1}{k^{2}}-1}}\, \sqrt {k^{2} x}\, \EllipticPi \left (\sqrt {-\left (x -\frac {1}{k^{2}}\right ) k^{2}}, \frac {1}{k^{2} \left (\frac {1}{k^{2}}-\frac {1}{k}\right )}, \sqrt {\frac {1}{k^{2} \left (\frac {1}{k^{2}}-1\right )}}\right )}{k^{4} \sqrt {k^{2} x^{3}-k^{2} x^{2}-x^{2}+x}\, \left (\frac {1}{k^{2}}-\frac {1}{k}\right )}\) | \(240\) |
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. 177 vs.
\(2 (75) = 150\).
time = 0.40, size = 177, normalized size = 2.08 \begin {gather*} -\frac {{\left (k - 1\right )} \arctan \left (\frac {\sqrt {k^{2} x^{3} - {\left (k^{2} + 1\right )} x^{2} + x} {\left (k^{2} x^{2} - 2 \, {\left (k^{2} + k + 1\right )} x + 1\right )}}{2 \, {\left ({\left (k^{3} + k^{2}\right )} x^{3} - {\left (k^{3} + k^{2} + k + 1\right )} x^{2} + {\left (k + 1\right )} x\right )}}\right ) - {\left (k + 1\right )} \arctan \left (\frac {\sqrt {k^{2} x^{3} - {\left (k^{2} + 1\right )} x^{2} + x} {\left (k^{2} x^{2} - 2 \, {\left (k^{2} - k + 1\right )} x + 1\right )}}{2 \, {\left ({\left (k^{3} - k^{2}\right )} x^{3} - {\left (k^{3} - k^{2} + k - 1\right )} x^{2} + {\left (k - 1\right )} x\right )}}\right )}{4 \, {\left (k^{3} - k\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}{\sqrt {x \left (x - 1\right ) \left (k^{2} 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 [F(-1)]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \text {Hanged} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________