Optimal. Leaf size=88 \[ -\frac {2 \text {ArcTan}\left (\frac {\sqrt {a+b} \sqrt {b+a k} \sqrt {x+(-1-k) x^2+k x^3}}{\sqrt {a} \sqrt {b} (-1+x) (-1+k x)}\right )}{\sqrt {a} \sqrt {b} \sqrt {a+b} \sqrt {b+a k}} \]
[Out]
________________________________________________________________________________________
Rubi [C] Result contains higher order function than in optimal. Order 4 vs. order 3 in
optimal.
time = 4.68, antiderivative size = 253, normalized size of antiderivative = 2.88, number of steps
used = 14, number of rules used = 9, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.225, Rules used = {6850, 6820,
6874, 728, 116, 948, 12, 174, 551} \begin {gather*} \frac {2 (1-x) \sqrt {-x} \sqrt {x} \sqrt {1-k x} \Pi \left (-\frac {a}{b};\text {ArcSin}\left (\sqrt {-k} \sqrt {-x}\right )|\frac {1}{k}\right )}{a b \sqrt {-k} \sqrt {x-x^2} \sqrt {(1-x) x (1-k x)}}+\frac {2 (1-x) \sqrt {-x} \sqrt {x} \sqrt {1-k x} \Pi \left (-\frac {b}{a k};\text {ArcSin}\left (\sqrt {-k} \sqrt {-x}\right )|\frac {1}{k}\right )}{a b \sqrt {-k} \sqrt {x-x^2} \sqrt {(1-x) x (1-k x)}}+\frac {2 \sqrt {1-x} \sqrt {x} \sqrt {1-k x} F\left (\left .\text {ArcSin}\left (\sqrt {x}\right )\right |k\right )}{a b \sqrt {(1-x) x (1-k x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 116
Rule 174
Rule 551
Rule 728
Rule 948
Rule 6820
Rule 6850
Rule 6874
Rubi steps
\begin {align*} \int \frac {-1+k x^2}{(a+b x) \sqrt {(1-x) x (1-k x)} (b+a k x)} \, dx &=\frac {\left (\sqrt {1-x} \sqrt {x} \sqrt {1-k x}\right ) \int \frac {-1+k x^2}{\sqrt {1-x} \sqrt {x} (a+b x) \sqrt {1-k x} (b+a k x)} \, dx}{\sqrt {(1-x) x (1-k x)}}\\ &=\frac {\left (\sqrt {1-x} \sqrt {x} \sqrt {1-k x}\right ) \int \frac {-1+k x^2}{(a+b x) \sqrt {1-k x} (b+a k x) \sqrt {x-x^2}} \, dx}{\sqrt {(1-x) x (1-k x)}}\\ &=\frac {\left (\sqrt {1-x} \sqrt {x} \sqrt {1-k x}\right ) \int \left (\frac {1}{a b \sqrt {1-k x} \sqrt {x-x^2}}-\frac {1}{b (a+b x) \sqrt {1-k x} \sqrt {x-x^2}}-\frac {1}{a \sqrt {1-k x} (b+a k x) \sqrt {x-x^2}}\right ) \, dx}{\sqrt {(1-x) x (1-k x)}}\\ &=-\frac {\left (\sqrt {1-x} \sqrt {x} \sqrt {1-k x}\right ) \int \frac {1}{\sqrt {1-k x} (b+a k x) \sqrt {x-x^2}} \, dx}{a \sqrt {(1-x) x (1-k x)}}-\frac {\left (\sqrt {1-x} \sqrt {x} \sqrt {1-k x}\right ) \int \frac {1}{(a+b x) \sqrt {1-k x} \sqrt {x-x^2}} \, dx}{b \sqrt {(1-x) x (1-k x)}}+\frac {\left (\sqrt {1-x} \sqrt {x} \sqrt {1-k x}\right ) \int \frac {1}{\sqrt {1-k x} \sqrt {x-x^2}} \, dx}{a b \sqrt {(1-x) x (1-k x)}}\\ &=\frac {\left (\sqrt {1-x} \sqrt {x} \sqrt {1-k x}\right ) \int \frac {1}{\sqrt {1-x} \sqrt {x} \sqrt {1-k x}} \, dx}{a b \sqrt {(1-x) x (1-k x)}}-\frac {\left (\sqrt {2} \sqrt {2-2 x} \sqrt {1-x} \sqrt {-x} \sqrt {x} \sqrt {1-k x}\right ) \int \frac {1}{\sqrt {2} \sqrt {2-2 x} \sqrt {-x} \sqrt {1-k x} (b+a k x)} \, dx}{a \sqrt {(1-x) x (1-k x)} \sqrt {x-x^2}}-\frac {\left (\sqrt {2} \sqrt {2-2 x} \sqrt {1-x} \sqrt {-x} \sqrt {x} \sqrt {1-k x}\right ) \int \frac {1}{\sqrt {2} \sqrt {2-2 x} \sqrt {-x} (a+b x) \sqrt {1-k x}} \, dx}{b \sqrt {(1-x) x (1-k x)} \sqrt {x-x^2}}\\ &=\frac {2 \sqrt {1-x} \sqrt {x} \sqrt {1-k x} F\left (\left .\sin ^{-1}\left (\sqrt {x}\right )\right |k\right )}{a b \sqrt {(1-x) x (1-k x)}}-\frac {\left (\sqrt {2-2 x} \sqrt {1-x} \sqrt {-x} \sqrt {x} \sqrt {1-k x}\right ) \int \frac {1}{\sqrt {2-2 x} \sqrt {-x} \sqrt {1-k x} (b+a k x)} \, dx}{a \sqrt {(1-x) x (1-k x)} \sqrt {x-x^2}}-\frac {\left (\sqrt {2-2 x} \sqrt {1-x} \sqrt {-x} \sqrt {x} \sqrt {1-k x}\right ) \int \frac {1}{\sqrt {2-2 x} \sqrt {-x} (a+b x) \sqrt {1-k x}} \, dx}{b \sqrt {(1-x) x (1-k x)} \sqrt {x-x^2}}\\ &=\frac {2 \sqrt {1-x} \sqrt {x} \sqrt {1-k x} F\left (\left .\sin ^{-1}\left (\sqrt {x}\right )\right |k\right )}{a b \sqrt {(1-x) x (1-k x)}}+\frac {\left (2 \sqrt {2-2 x} \sqrt {1-x} \sqrt {-x} \sqrt {x} \sqrt {1-k x}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {2+2 x^2} \sqrt {1+k x^2} \left (b-a k x^2\right )} \, dx,x,\sqrt {-x}\right )}{a \sqrt {(1-x) x (1-k x)} \sqrt {x-x^2}}+\frac {\left (2 \sqrt {2-2 x} \sqrt {1-x} \sqrt {-x} \sqrt {x} \sqrt {1-k x}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {2+2 x^2} \left (a-b x^2\right ) \sqrt {1+k x^2}} \, dx,x,\sqrt {-x}\right )}{b \sqrt {(1-x) x (1-k x)} \sqrt {x-x^2}}\\ &=\frac {2 \sqrt {1-x} \sqrt {x} \sqrt {1-k x} F\left (\left .\sin ^{-1}\left (\sqrt {x}\right )\right |k\right )}{a b \sqrt {(1-x) x (1-k x)}}+\frac {2 (1-x) \sqrt {-x} \sqrt {x} \sqrt {1-k x} \Pi \left (-\frac {a}{b};\sin ^{-1}\left (\sqrt {-k} \sqrt {-x}\right )|\frac {1}{k}\right )}{a b \sqrt {-k} \sqrt {(1-x) x (1-k x)} \sqrt {x-x^2}}+\frac {2 (1-x) \sqrt {-x} \sqrt {x} \sqrt {1-k x} \Pi \left (-\frac {b}{a k};\sin ^{-1}\left (\sqrt {-k} \sqrt {-x}\right )|\frac {1}{k}\right )}{a b \sqrt {-k} \sqrt {(1-x) x (1-k x)} \sqrt {x-x^2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 4 vs. order 3 in
optimal.
time = 21.29, size = 169, normalized size = 1.92 \begin {gather*} \frac {2 i (-1+x)^{3/2} \sqrt {\frac {x}{-1+x}} \sqrt {\frac {1-k x}{k-k x}} \left (a b (-1+k) F\left (i \sinh ^{-1}\left (\frac {1}{\sqrt {-1+x}}\right )|\frac {-1+k}{k}\right )+a (b+a k) \Pi \left (\frac {a+b}{b};i \sinh ^{-1}\left (\frac {1}{\sqrt {-1+x}}\right )|\frac {-1+k}{k}\right )+b (a+b) \Pi \left (1+\frac {b}{a k};i \sinh ^{-1}\left (\frac {1}{\sqrt {-1+x}}\right )|\frac {-1+k}{k}\right )\right )}{a b (a+b) (b+a k) \sqrt {(-1+x) x (-1+k x)}} \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.62, size = 315, normalized size = 3.58
method | result | size |
default | \(-\frac {2 \sqrt {-\left (x -\frac {1}{k}\right ) k}\, \sqrt {\frac {-1+x}{\frac {1}{k}-1}}\, \sqrt {k x}\, \EllipticF \left (\sqrt {-\left (x -\frac {1}{k}\right ) k}, \sqrt {\frac {1}{k \left (\frac {1}{k}-1\right )}}\right )}{a b k \sqrt {k \,x^{3}-k \,x^{2}-x^{2}+x}}+\frac {2 \sqrt {-\left (x -\frac {1}{k}\right ) k}\, \sqrt {\frac {-1+x}{\frac {1}{k}-1}}\, \sqrt {k x}\, \EllipticPi \left (\sqrt {-\left (x -\frac {1}{k}\right ) k}, \frac {1}{k \left (\frac {1}{k}+\frac {a}{b}\right )}, \sqrt {\frac {1}{k \left (\frac {1}{k}-1\right )}}\right )}{b^{2} k \sqrt {k \,x^{3}-k \,x^{2}-x^{2}+x}\, \left (\frac {1}{k}+\frac {a}{b}\right )}+\frac {2 \sqrt {-\left (x -\frac {1}{k}\right ) k}\, \sqrt {\frac {-1+x}{\frac {1}{k}-1}}\, \sqrt {k x}\, \EllipticPi \left (\sqrt {-\left (x -\frac {1}{k}\right ) k}, \frac {1}{k \left (\frac {1}{k}+\frac {b}{a k}\right )}, \sqrt {\frac {1}{k \left (\frac {1}{k}-1\right )}}\right )}{a^{2} k^{2} \sqrt {k \,x^{3}-k \,x^{2}-x^{2}+x}\, \left (\frac {1}{k}+\frac {b}{a k}\right )}\) | \(315\) |
elliptic | \(-\frac {2 \sqrt {-k x +1}\, \sqrt {-\frac {1}{\frac {1}{k}-1}+\frac {x}{\frac {1}{k}-1}}\, \sqrt {k x}\, \EllipticF \left (\sqrt {-\left (x -\frac {1}{k}\right ) k}, \sqrt {\frac {1}{k \left (\frac {1}{k}-1\right )}}\right )}{a b k \sqrt {k \,x^{3}-k \,x^{2}-x^{2}+x}}+\frac {2 \sqrt {-k x +1}\, \sqrt {-\frac {1}{\frac {1}{k}-1}+\frac {x}{\frac {1}{k}-1}}\, \sqrt {k x}\, \EllipticPi \left (\sqrt {-\left (x -\frac {1}{k}\right ) k}, \frac {1}{k \left (\frac {1}{k}+\frac {a}{b}\right )}, \sqrt {\frac {1}{k \left (\frac {1}{k}-1\right )}}\right )}{\left (-a^{2} k +b^{2}\right ) k \sqrt {k \,x^{3}-k \,x^{2}-x^{2}+x}\, \left (\frac {1}{k}+\frac {a}{b}\right )}-\frac {2 \sqrt {-k x +1}\, \sqrt {-\frac {1}{\frac {1}{k}-1}+\frac {x}{\frac {1}{k}-1}}\, \sqrt {k x}\, \EllipticPi \left (\sqrt {-\left (x -\frac {1}{k}\right ) k}, \frac {1}{k \left (\frac {1}{k}+\frac {a}{b}\right )}, \sqrt {\frac {1}{k \left (\frac {1}{k}-1\right )}}\right ) a^{2}}{\left (-a^{2} k +b^{2}\right ) \sqrt {k \,x^{3}-k \,x^{2}-x^{2}+x}\, \left (\frac {1}{k}+\frac {a}{b}\right ) b^{2}}+\frac {2 \sqrt {-k x +1}\, \sqrt {-\frac {1}{\frac {1}{k}-1}+\frac {x}{\frac {1}{k}-1}}\, \sqrt {k x}\, \EllipticPi \left (\sqrt {-\left (x -\frac {1}{k}\right ) k}, \frac {1}{k \left (\frac {1}{k}+\frac {b}{a k}\right )}, \sqrt {\frac {1}{k \left (\frac {1}{k}-1\right )}}\right )}{\left (a^{2} k -b^{2}\right ) k \sqrt {k \,x^{3}-k \,x^{2}-x^{2}+x}\, \left (\frac {1}{k}+\frac {b}{a k}\right )}-\frac {2 \sqrt {-k x +1}\, \sqrt {-\frac {1}{\frac {1}{k}-1}+\frac {x}{\frac {1}{k}-1}}\, \sqrt {k x}\, \EllipticPi \left (\sqrt {-\left (x -\frac {1}{k}\right ) k}, \frac {1}{k \left (\frac {1}{k}+\frac {b}{a k}\right )}, \sqrt {\frac {1}{k \left (\frac {1}{k}-1\right )}}\right ) b^{2}}{\left (a^{2} k -b^{2}\right ) k^{2} \sqrt {k \,x^{3}-k \,x^{2}-x^{2}+x}\, \left (\frac {1}{k}+\frac {b}{a k}\right ) a^{2}}\) | \(608\) |
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. 239 vs.
\(2 (69) = 138\).
time = 0.99, size = 639, normalized size = 7.26 \begin {gather*} \left [-\frac {\sqrt {-a^{2} b^{2} - a b^{3} - {\left (a^{3} b + a^{2} b^{2}\right )} k} \log \left (\frac {a^{2} b^{2} k^{2} x^{4} + a^{2} b^{2} - 2 \, {\left ({\left (3 \, a^{3} b + 4 \, a^{2} b^{2}\right )} k^{2} + {\left (4 \, a^{2} b^{2} + 3 \, a b^{3}\right )} k\right )} x^{3} + {\left (8 \, a^{2} b^{2} + 8 \, a b^{3} + b^{4} + {\left (a^{4} + 8 \, a^{3} b + 8 \, a^{2} b^{2}\right )} k^{2} + 4 \, {\left (2 \, a^{3} b + 5 \, a^{2} b^{2} + 2 \, a b^{3}\right )} k\right )} x^{2} - 4 \, {\left (a b k x^{2} + a b - {\left (2 \, a b + b^{2} + {\left (a^{2} + 2 \, a b\right )} k\right )} x\right )} \sqrt {-a^{2} b^{2} - a b^{3} - {\left (a^{3} b + a^{2} b^{2}\right )} k} \sqrt {k x^{3} - {\left (k + 1\right )} x^{2} + x} - 2 \, {\left (4 \, a^{2} b^{2} + 3 \, a b^{3} + {\left (3 \, a^{3} b + 4 \, a^{2} b^{2}\right )} k\right )} x}{a^{2} b^{2} k^{2} x^{4} + a^{2} b^{2} + 2 \, {\left (a^{3} b k^{2} + a b^{3} k\right )} x^{3} + {\left (a^{4} k^{2} + 4 \, a^{2} b^{2} k + b^{4}\right )} x^{2} + 2 \, {\left (a^{3} b k + a b^{3}\right )} x}\right )}{2 \, {\left (a^{2} b^{2} + a b^{3} + {\left (a^{3} b + a^{2} b^{2}\right )} k\right )}}, \frac {\arctan \left (\frac {{\left (a b k x^{2} + a b - {\left (2 \, a b + b^{2} + {\left (a^{2} + 2 \, a b\right )} k\right )} x\right )} \sqrt {a^{2} b^{2} + a b^{3} + {\left (a^{3} b + a^{2} b^{2}\right )} k} \sqrt {k x^{3} - {\left (k + 1\right )} x^{2} + x}}{2 \, {\left ({\left ({\left (a^{3} b + a^{2} b^{2}\right )} k^{2} + {\left (a^{2} b^{2} + a b^{3}\right )} k\right )} x^{3} - {\left (a^{2} b^{2} + a b^{3} + {\left (a^{3} b + a^{2} b^{2}\right )} k^{2} + {\left (a^{3} b + 2 \, a^{2} b^{2} + a b^{3}\right )} k\right )} x^{2} + {\left (a^{2} b^{2} + a b^{3} + {\left (a^{3} b + a^{2} b^{2}\right )} k\right )} x\right )}}\right )}{\sqrt {a^{2} b^{2} + a b^{3} + {\left (a^{3} b + a^{2} b^{2}\right )} 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 {k x^{2} - 1}{\sqrt {x \left (x - 1\right ) \left (k x - 1\right )} \left (a + b x\right ) \left (a k x + b\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 = 4.31, size = 103, normalized size = 1.17 \begin {gather*} \frac {\ln \left (\frac {2\,\sqrt {x\,\left (k\,x-1\right )\,\left (x-1\right )}\,\sqrt {a\,b\,\left (a+b\right )\,\left (b+a\,k\right )}+b^2\,x\,1{}\mathrm {i}-a\,b\,1{}\mathrm {i}+a^2\,k\,x\,1{}\mathrm {i}+a\,b\,x\,2{}\mathrm {i}+a\,b\,k\,x\,2{}\mathrm {i}-a\,b\,k\,x^2\,1{}\mathrm {i}}{\left (b+a\,k\,x\right )\,\left (a+b\,x\right )}\right )\,1{}\mathrm {i}}{\sqrt {a\,b\,\left (a+b\right )\,\left (b+a\,k\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________