Optimal. Leaf size=38 \[ \frac {2 \tanh ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {x^2 (-a-b)+a b x+x^3}}\right )}{\sqrt {d}} \]
________________________________________________________________________________________
Rubi [C] time = 6.45, antiderivative size = 273, normalized size of antiderivative = 7.18, number of steps used = 15, number of rules used = 7, integrand size = 42, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {6718, 6728, 117, 116, 169, 538, 537} \begin {gather*} \frac {2 \sqrt {a} \sqrt {x} \sqrt {1-\frac {x}{a}} \sqrt {1-\frac {x}{b}} \Pi \left (\frac {2 a}{a+b+d-\sqrt {a^2-2 (b-d) a+(b+d)^2}};\sin ^{-1}\left (\frac {\sqrt {x}}{\sqrt {a}}\right )|\frac {a}{b}\right )}{\sqrt {x (a-x) (b-x)}}+\frac {2 \sqrt {a} \sqrt {x} \sqrt {1-\frac {x}{a}} \sqrt {1-\frac {x}{b}} \Pi \left (\frac {2 a}{a+b+d+\sqrt {a^2-2 (b-d) a+(b+d)^2}};\sin ^{-1}\left (\frac {\sqrt {x}}{\sqrt {a}}\right )|\frac {a}{b}\right )}{\sqrt {x (a-x) (b-x)}}-\frac {2 \sqrt {a} \sqrt {x} \sqrt {1-\frac {x}{a}} \sqrt {1-\frac {x}{b}} F\left (\sin ^{-1}\left (\frac {\sqrt {x}}{\sqrt {a}}\right )|\frac {a}{b}\right )}{\sqrt {x (a-x) (b-x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 116
Rule 117
Rule 169
Rule 537
Rule 538
Rule 6718
Rule 6728
Rubi steps
\begin {align*} \int \frac {a b-x^2}{\sqrt {x (-a+x) (-b+x)} \left (a b-(a+b+d) x+x^2\right )} \, dx &=\frac {\left (\sqrt {x} \sqrt {-a+x} \sqrt {-b+x}\right ) \int \frac {a b-x^2}{\sqrt {x} \sqrt {-a+x} \sqrt {-b+x} \left (a b-(a+b+d) x+x^2\right )} \, dx}{\sqrt {x (-a+x) (-b+x)}}\\ &=\frac {\left (\sqrt {x} \sqrt {-a+x} \sqrt {-b+x}\right ) \int \left (-\frac {1}{\sqrt {x} \sqrt {-a+x} \sqrt {-b+x}}+\frac {2 a b-(a+b+d) x}{\sqrt {x} \sqrt {-a+x} \sqrt {-b+x} \left (a b+(-a-b-d) x+x^2\right )}\right ) \, dx}{\sqrt {x (-a+x) (-b+x)}}\\ &=-\frac {\left (\sqrt {x} \sqrt {-a+x} \sqrt {-b+x}\right ) \int \frac {1}{\sqrt {x} \sqrt {-a+x} \sqrt {-b+x}} \, dx}{\sqrt {x (-a+x) (-b+x)}}+\frac {\left (\sqrt {x} \sqrt {-a+x} \sqrt {-b+x}\right ) \int \frac {2 a b-(a+b+d) x}{\sqrt {x} \sqrt {-a+x} \sqrt {-b+x} \left (a b+(-a-b-d) x+x^2\right )} \, dx}{\sqrt {x (-a+x) (-b+x)}}\\ &=\frac {\left (\sqrt {x} \sqrt {-a+x} \sqrt {-b+x}\right ) \int \left (\frac {-a-b-d-\sqrt {a^2-2 a b+b^2+2 a d+2 b d+d^2}}{\sqrt {x} \sqrt {-a+x} \sqrt {-b+x} \left (-a-b-d-\sqrt {a^2-2 a b+b^2+2 a d+2 b d+d^2}+2 x\right )}+\frac {-a-b-d+\sqrt {a^2-2 a b+b^2+2 a d+2 b d+d^2}}{\sqrt {x} \sqrt {-a+x} \sqrt {-b+x} \left (-a-b-d+\sqrt {a^2-2 a b+b^2+2 a d+2 b d+d^2}+2 x\right )}\right ) \, dx}{\sqrt {x (-a+x) (-b+x)}}-\frac {\left (\sqrt {x} \sqrt {1-\frac {x}{a}} \sqrt {1-\frac {x}{b}}\right ) \int \frac {1}{\sqrt {x} \sqrt {1-\frac {x}{a}} \sqrt {1-\frac {x}{b}}} \, dx}{\sqrt {x (-a+x) (-b+x)}}\\ &=-\frac {2 \sqrt {a} \sqrt {x} \sqrt {1-\frac {x}{a}} \sqrt {1-\frac {x}{b}} F\left (\sin ^{-1}\left (\frac {\sqrt {x}}{\sqrt {a}}\right )|\frac {a}{b}\right )}{\sqrt {(a-x) (b-x) x}}+\frac {\left (\left (-a-b-d-\sqrt {a^2-2 a (b-d)+(b+d)^2}\right ) \sqrt {x} \sqrt {-a+x} \sqrt {-b+x}\right ) \int \frac {1}{\sqrt {x} \sqrt {-a+x} \sqrt {-b+x} \left (-a-b-d-\sqrt {a^2-2 a b+b^2+2 a d+2 b d+d^2}+2 x\right )} \, dx}{\sqrt {x (-a+x) (-b+x)}}+\frac {\left (\left (-a-b-d+\sqrt {a^2-2 a (b-d)+(b+d)^2}\right ) \sqrt {x} \sqrt {-a+x} \sqrt {-b+x}\right ) \int \frac {1}{\sqrt {x} \sqrt {-a+x} \sqrt {-b+x} \left (-a-b-d+\sqrt {a^2-2 a b+b^2+2 a d+2 b d+d^2}+2 x\right )} \, dx}{\sqrt {x (-a+x) (-b+x)}}\\ &=-\frac {2 \sqrt {a} \sqrt {x} \sqrt {1-\frac {x}{a}} \sqrt {1-\frac {x}{b}} F\left (\sin ^{-1}\left (\frac {\sqrt {x}}{\sqrt {a}}\right )|\frac {a}{b}\right )}{\sqrt {(a-x) (b-x) x}}-\frac {\left (2 \left (-a-b-d-\sqrt {a^2-2 a (b-d)+(b+d)^2}\right ) \sqrt {x} \sqrt {-a+x} \sqrt {-b+x}\right ) \operatorname {Subst}\left (\int \frac {1}{\left (a+b+d+\sqrt {a^2-2 a (b-d)+(b+d)^2}-2 x^2\right ) \sqrt {-a+x^2} \sqrt {-b+x^2}} \, dx,x,\sqrt {x}\right )}{\sqrt {x (-a+x) (-b+x)}}-\frac {\left (2 \left (-a-b-d+\sqrt {a^2-2 a (b-d)+(b+d)^2}\right ) \sqrt {x} \sqrt {-a+x} \sqrt {-b+x}\right ) \operatorname {Subst}\left (\int \frac {1}{\left (a+b+d-\sqrt {a^2-2 a (b-d)+(b+d)^2}-2 x^2\right ) \sqrt {-a+x^2} \sqrt {-b+x^2}} \, dx,x,\sqrt {x}\right )}{\sqrt {x (-a+x) (-b+x)}}\\ &=-\frac {2 \sqrt {a} \sqrt {x} \sqrt {1-\frac {x}{a}} \sqrt {1-\frac {x}{b}} F\left (\sin ^{-1}\left (\frac {\sqrt {x}}{\sqrt {a}}\right )|\frac {a}{b}\right )}{\sqrt {(a-x) (b-x) x}}-\frac {\left (2 \left (-a-b-d-\sqrt {a^2-2 a (b-d)+(b+d)^2}\right ) \sqrt {x} \sqrt {-b+x} \sqrt {1-\frac {x}{a}}\right ) \operatorname {Subst}\left (\int \frac {1}{\left (a+b+d+\sqrt {a^2-2 a (b-d)+(b+d)^2}-2 x^2\right ) \sqrt {-b+x^2} \sqrt {1-\frac {x^2}{a}}} \, dx,x,\sqrt {x}\right )}{\sqrt {x (-a+x) (-b+x)}}-\frac {\left (2 \left (-a-b-d+\sqrt {a^2-2 a (b-d)+(b+d)^2}\right ) \sqrt {x} \sqrt {-b+x} \sqrt {1-\frac {x}{a}}\right ) \operatorname {Subst}\left (\int \frac {1}{\left (a+b+d-\sqrt {a^2-2 a (b-d)+(b+d)^2}-2 x^2\right ) \sqrt {-b+x^2} \sqrt {1-\frac {x^2}{a}}} \, dx,x,\sqrt {x}\right )}{\sqrt {x (-a+x) (-b+x)}}\\ &=-\frac {2 \sqrt {a} \sqrt {x} \sqrt {1-\frac {x}{a}} \sqrt {1-\frac {x}{b}} F\left (\sin ^{-1}\left (\frac {\sqrt {x}}{\sqrt {a}}\right )|\frac {a}{b}\right )}{\sqrt {(a-x) (b-x) x}}-\frac {\left (2 \left (-a-b-d-\sqrt {a^2-2 a (b-d)+(b+d)^2}\right ) \sqrt {x} \sqrt {1-\frac {x}{a}} \sqrt {1-\frac {x}{b}}\right ) \operatorname {Subst}\left (\int \frac {1}{\left (a+b+d+\sqrt {a^2-2 a (b-d)+(b+d)^2}-2 x^2\right ) \sqrt {1-\frac {x^2}{a}} \sqrt {1-\frac {x^2}{b}}} \, dx,x,\sqrt {x}\right )}{\sqrt {x (-a+x) (-b+x)}}-\frac {\left (2 \left (-a-b-d+\sqrt {a^2-2 a (b-d)+(b+d)^2}\right ) \sqrt {x} \sqrt {1-\frac {x}{a}} \sqrt {1-\frac {x}{b}}\right ) \operatorname {Subst}\left (\int \frac {1}{\left (a+b+d-\sqrt {a^2-2 a (b-d)+(b+d)^2}-2 x^2\right ) \sqrt {1-\frac {x^2}{a}} \sqrt {1-\frac {x^2}{b}}} \, dx,x,\sqrt {x}\right )}{\sqrt {x (-a+x) (-b+x)}}\\ &=-\frac {2 \sqrt {a} \sqrt {x} \sqrt {1-\frac {x}{a}} \sqrt {1-\frac {x}{b}} F\left (\sin ^{-1}\left (\frac {\sqrt {x}}{\sqrt {a}}\right )|\frac {a}{b}\right )}{\sqrt {(a-x) (b-x) x}}+\frac {2 \sqrt {a} \sqrt {x} \sqrt {1-\frac {x}{a}} \sqrt {1-\frac {x}{b}} \Pi \left (\frac {2 a}{a+b+d-\sqrt {a^2-2 a (b-d)+(b+d)^2}};\sin ^{-1}\left (\frac {\sqrt {x}}{\sqrt {a}}\right )|\frac {a}{b}\right )}{\sqrt {(a-x) (b-x) x}}+\frac {2 \sqrt {a} \sqrt {x} \sqrt {1-\frac {x}{a}} \sqrt {1-\frac {x}{b}} \Pi \left (\frac {2 a}{a+b+d+\sqrt {a^2-2 a (b-d)+(b+d)^2}};\sin ^{-1}\left (\frac {\sqrt {x}}{\sqrt {a}}\right )|\frac {a}{b}\right )}{\sqrt {(a-x) (b-x) x}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 4.56, size = 195, normalized size = 5.13 \begin {gather*} \frac {2 i x^{3/2} \sqrt {1-\frac {a}{x}} \sqrt {1-\frac {b}{x}} \left (-\Pi \left (\frac {2 b}{a+b+d-\sqrt {a^2-2 (b-d) a+(b+d)^2}};i \sinh ^{-1}\left (\frac {\sqrt {-a}}{\sqrt {x}}\right )|\frac {b}{a}\right )-\Pi \left (\frac {2 b}{a+b+d+\sqrt {a^2-2 (b-d) a+(b+d)^2}};i \sinh ^{-1}\left (\frac {\sqrt {-a}}{\sqrt {x}}\right )|\frac {b}{a}\right )+F\left (i \sinh ^{-1}\left (\frac {\sqrt {-a}}{\sqrt {x}}\right )|\frac {b}{a}\right )\right )}{\sqrt {-a} \sqrt {x (x-a) (x-b)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [A] time = 0.17, size = 38, normalized size = 1.00 \begin {gather*} \frac {2 \tanh ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {a b x+(-a-b) x^2+x^3}}\right )}{\sqrt {d}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.65, size = 250, normalized size = 6.58 \begin {gather*} \left [\frac {\log \left (\frac {a^{2} b^{2} - 2 \, {\left (a + b - 3 \, d\right )} x^{3} + x^{4} + {\left (a^{2} + 4 \, a b + b^{2} - 6 \, {\left (a + b\right )} d + d^{2}\right )} x^{2} + 4 \, \sqrt {a b x - {\left (a + b\right )} x^{2} + x^{3}} {\left (a b - {\left (a + b - d\right )} x + x^{2}\right )} \sqrt {d} - 2 \, {\left (a^{2} b + a b^{2} - 3 \, a b d\right )} x}{a^{2} b^{2} - 2 \, {\left (a + b + d\right )} x^{3} + x^{4} + {\left (a^{2} + 4 \, a b + b^{2} + 2 \, {\left (a + b\right )} d + d^{2}\right )} x^{2} - 2 \, {\left (a^{2} b + a b^{2} + a b d\right )} x}\right )}{2 \, \sqrt {d}}, -\frac {\sqrt {-d} \arctan \left (\frac {\sqrt {a b x - {\left (a + b\right )} x^{2} + x^{3}} {\left (a b - {\left (a + b - d\right )} x + x^{2}\right )} \sqrt {-d}}{2 \, {\left (a b d x - {\left (a + b\right )} d x^{2} + d x^{3}\right )}}\right )}{d}\right ] \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*} \int \frac {a b - x^{2}}{\sqrt {{\left (a - x\right )} {\left (b - x\right )} x} {\left (a b - {\left (a + b + d\right )} x + x^{2}\right )}}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [C] time = 0.29, size = 3392, normalized size = 89.26
method | result | size |
default | \(\text {Expression too large to display}\) | \(3392\) |
elliptic | \(\text {Expression too large to display}\) | \(3397\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.34, size = 532, normalized size = 14.00 \begin {gather*} \frac {2\,b\,\mathrm {F}\left (\mathrm {asin}\left (\sqrt {\frac {b-x}{b}}\right )\middle |-\frac {b}{a-b}\right )\,\sqrt {\frac {x}{b}}\,\sqrt {\frac {b-x}{b}}\,\sqrt {\frac {a-x}{a-b}}}{\sqrt {x^3+\left (-a-b\right )\,x^2+a\,b\,x}}-\frac {2\,b\,\sqrt {\frac {x}{b}}\,\sqrt {\frac {b-x}{b}}\,\sqrt {\frac {a-x}{a-b}}\,\left (2\,a\,b-\left (a+b+d\right )\,\left (\frac {a}{2}+\frac {b}{2}+\frac {d}{2}-\frac {\sqrt {a^2-2\,a\,b+2\,a\,d+b^2+2\,b\,d+d^2}}{2}\right )\right )\,\Pi \left (-\frac {b}{\frac {a}{2}-\frac {b}{2}+\frac {d}{2}-\frac {\sqrt {a^2-2\,a\,b+2\,a\,d+b^2+2\,b\,d+d^2}}{2}};\mathrm {asin}\left (\sqrt {\frac {b-x}{b}}\right )\middle |-\frac {b}{a-b}\right )}{\sqrt {x^3+\left (-a-b\right )\,x^2+a\,b\,x}\,\left (\frac {a}{2}-\frac {b}{2}+\frac {d}{2}-\frac {\sqrt {a^2-2\,a\,b+2\,a\,d+b^2+2\,b\,d+d^2}}{2}\right )\,\sqrt {a^2-2\,a\,b+2\,a\,d+b^2+2\,b\,d+d^2}}+\frac {2\,b\,\sqrt {\frac {x}{b}}\,\sqrt {\frac {b-x}{b}}\,\sqrt {\frac {a-x}{a-b}}\,\left (2\,a\,b-\left (a+b+d\right )\,\left (\frac {a}{2}+\frac {b}{2}+\frac {d}{2}+\frac {\sqrt {a^2-2\,a\,b+2\,a\,d+b^2+2\,b\,d+d^2}}{2}\right )\right )\,\Pi \left (-\frac {b}{\frac {a}{2}-\frac {b}{2}+\frac {d}{2}+\frac {\sqrt {a^2-2\,a\,b+2\,a\,d+b^2+2\,b\,d+d^2}}{2}};\mathrm {asin}\left (\sqrt {\frac {b-x}{b}}\right )\middle |-\frac {b}{a-b}\right )}{\sqrt {x^3+\left (-a-b\right )\,x^2+a\,b\,x}\,\left (\frac {a}{2}-\frac {b}{2}+\frac {d}{2}+\frac {\sqrt {a^2-2\,a\,b+2\,a\,d+b^2+2\,b\,d+d^2}}{2}\right )\,\sqrt {a^2-2\,a\,b+2\,a\,d+b^2+2\,b\,d+d^2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] 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]
________________________________________________________________________________________