Integrand size = 42, antiderivative size = 38 \[ \int \frac {a b-x^2}{\sqrt {x (-a+x) (-b+x)} \left (a b-(a+b+d) x+x^2\right )} \, dx=\frac {2 \text {arctanh}\left (\frac {\sqrt {d} x}{\sqrt {a b x+(-a-b) x^2+x^3}}\right )}{\sqrt {d}} \]
[Out]
Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.
Time = 4.35 (sec) , antiderivative size = 273, normalized size of antiderivative = 7.18, number of steps used = 15, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {6850, 6860, 118, 117, 175, 552, 551} \[ \int \frac {a b-x^2}{\sqrt {x (-a+x) (-b+x)} \left (a b-(a+b+d) x+x^2\right )} \, dx=\frac {2 \sqrt {a} \sqrt {x} \sqrt {1-\frac {x}{a}} \sqrt {1-\frac {x}{b}} \operatorname {EllipticPi}\left (\frac {2 a}{a+b+d-\sqrt {a^2-2 (b-d) a+(b+d)^2}},\arcsin \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}} \operatorname {EllipticPi}\left (\frac {2 a}{a+b+d+\sqrt {a^2-2 (b-d) a+(b+d)^2}},\arcsin \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}} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {x}}{\sqrt {a}}\right ),\frac {a}{b}\right )}{\sqrt {x (a-x) (b-x)}} \]
[In]
[Out]
Rule 117
Rule 118
Rule 175
Rule 551
Rule 552
Rule 6850
Rule 6860
Rubi steps \begin{align*} \text {integral}& = \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}} \operatorname {EllipticF}\left (\arcsin \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}} \operatorname {EllipticF}\left (\arcsin \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 ) \text {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 ) \text {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}} \operatorname {EllipticF}\left (\arcsin \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 ) \text {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 ) \text {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}} \operatorname {EllipticF}\left (\arcsin \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 ) \text {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 ) \text {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}} \operatorname {EllipticF}\left (\arcsin \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}} \operatorname {EllipticPi}\left (\frac {2 a}{a+b+d-\sqrt {a^2-2 a (b-d)+(b+d)^2}},\arcsin \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}} \operatorname {EllipticPi}\left (\frac {2 a}{a+b+d+\sqrt {a^2-2 a (b-d)+(b+d)^2}},\arcsin \left (\frac {\sqrt {x}}{\sqrt {a}}\right ),\frac {a}{b}\right )}{\sqrt {(a-x) (b-x) x}} \\ \end{align*}
Time = 15.16 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.82 \[ \int \frac {a b-x^2}{\sqrt {x (-a+x) (-b+x)} \left (a b-(a+b+d) x+x^2\right )} \, dx=\frac {2 \text {arctanh}\left (\frac {\sqrt {d} x}{\sqrt {x (-a+x) (-b+x)}}\right )}{\sqrt {d}} \]
[In]
[Out]
Time = 1.94 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.74
method | result | size |
default | \(\frac {2 \,\operatorname {arctanh}\left (\frac {\sqrt {x \left (a -x \right ) \left (b -x \right )}}{x \sqrt {d}}\right )}{\sqrt {d}}\) | \(28\) |
pseudoelliptic | \(\frac {2 \,\operatorname {arctanh}\left (\frac {\sqrt {x \left (a -x \right ) \left (b -x \right )}}{x \sqrt {d}}\right )}{\sqrt {d}}\) | \(28\) |
elliptic | \(\text {Expression too large to display}\) | \(3397\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 74 vs. \(2 (29) = 58\).
Time = 0.35 (sec) , antiderivative size = 250, normalized size of antiderivative = 6.58 \[ \int \frac {a b-x^2}{\sqrt {x (-a+x) (-b+x)} \left (a b-(a+b+d) x+x^2\right )} \, dx=\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 ] \]
[In]
[Out]
Timed out. \[ \int \frac {a b-x^2}{\sqrt {x (-a+x) (-b+x)} \left (a b-(a+b+d) x+x^2\right )} \, dx=\text {Timed out} \]
[In]
[Out]
Exception generated. \[ \int \frac {a b-x^2}{\sqrt {x (-a+x) (-b+x)} \left (a b-(a+b+d) x+x^2\right )} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
\[ \int \frac {a b-x^2}{\sqrt {x (-a+x) (-b+x)} \left (a b-(a+b+d) x+x^2\right )} \, dx=\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 } \]
[In]
[Out]
Time = 4.91 (sec) , antiderivative size = 532, normalized size of antiderivative = 14.00 \[ \int \frac {a b-x^2}{\sqrt {x (-a+x) (-b+x)} \left (a b-(a+b+d) x+x^2\right )} \, dx=\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}} \]
[In]
[Out]