Integrand size = 63, antiderivative size = 60 \[ \int \frac {a b+a c-b c-2 a x+x^2}{\sqrt {(-a+x) (-b+x) (-c+x)} \left (a+b c d-(1+b d+c d) x+d x^2\right )} \, dx=\frac {2 \text {arctanh}\left (\frac {\sqrt {d} \sqrt {-a b c+(a b+a c+b c) x+(-a-b-c) x^2+x^3}}{a-x}\right )}{\sqrt {d}} \]
[Out]
Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.
Time = 14.57 (sec) , antiderivative size = 455, normalized size of antiderivative = 7.58, number of steps used = 16, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {6850, 6860, 122, 121, 175, 552, 551} \[ \int \frac {a b+a c-b c-2 a x+x^2}{\sqrt {(-a+x) (-b+x) (-c+x)} \left (a+b c d-(1+b d+c d) x+d x^2\right )} \, dx=-\frac {2 \sqrt {b-a} \sqrt {x-a} \sqrt {-\frac {b-x}{a-b}} \sqrt {-\frac {c-x}{a-c}} \operatorname {EllipticPi}\left (-\frac {2 (a-b) d}{-2 a d+b d+c d-\sqrt {b^2 d^2-4 a d+2 b (1-c d) d+(c d+1)^2}+1},\arcsin \left (\frac {\sqrt {x-a}}{\sqrt {b-a}}\right ),\frac {a-b}{a-c}\right )}{d \sqrt {-((a-x) (b-x) (c-x))}}-\frac {2 \sqrt {b-a} \sqrt {x-a} \sqrt {-\frac {b-x}{a-b}} \sqrt {-\frac {c-x}{a-c}} \operatorname {EllipticPi}\left (-\frac {2 (a-b) d}{-2 a d+b d+c d+\sqrt {b^2 d^2-4 a d+2 b (1-c d) d+(c d+1)^2}+1},\arcsin \left (\frac {\sqrt {x-a}}{\sqrt {b-a}}\right ),\frac {a-b}{a-c}\right )}{d \sqrt {-((a-x) (b-x) (c-x))}}+\frac {2 \sqrt {b-a} \sqrt {x-a} \sqrt {-\frac {b-x}{a-b}} \sqrt {-\frac {c-x}{a-c}} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {x-a}}{\sqrt {b-a}}\right ),\frac {a-b}{a-c}\right )}{d \sqrt {-((a-x) (b-x) (c-x))}} \]
[In]
[Out]
Rule 121
Rule 122
Rule 175
Rule 551
Rule 552
Rule 6850
Rule 6860
Rubi steps \begin{align*} \text {integral}& = \frac {\left (\sqrt {-a+x} \sqrt {-b+x} \sqrt {-c+x}\right ) \int \frac {a b+a c-b c-2 a x+x^2}{\sqrt {-a+x} \sqrt {-b+x} \sqrt {-c+x} \left (a+b c d-(1+b d+c d) x+d x^2\right )} \, dx}{\sqrt {(-a+x) (-b+x) (-c+x)}} \\ & = \frac {\left (\sqrt {-a+x} \sqrt {-b+x} \sqrt {-c+x}\right ) \int \left (\frac {1}{d \sqrt {-a+x} \sqrt {-b+x} \sqrt {-c+x}}-\frac {2 b c d+a (1-b d-c d)-(1-2 a d+b d+c d) x}{d \sqrt {-a+x} \sqrt {-b+x} \sqrt {-c+x} \left (a+b c d+(-1-b d-c d) x+d x^2\right )}\right ) \, dx}{\sqrt {(-a+x) (-b+x) (-c+x)}} \\ & = \frac {\left (\sqrt {-a+x} \sqrt {-b+x} \sqrt {-c+x}\right ) \int \frac {1}{\sqrt {-a+x} \sqrt {-b+x} \sqrt {-c+x}} \, dx}{d \sqrt {(-a+x) (-b+x) (-c+x)}}-\frac {\left (\sqrt {-a+x} \sqrt {-b+x} \sqrt {-c+x}\right ) \int \frac {2 b c d+a (1-b d-c d)-(1-2 a d+b d+c d) x}{\sqrt {-a+x} \sqrt {-b+x} \sqrt {-c+x} \left (a+b c d+(-1-b d-c d) x+d x^2\right )} \, dx}{d \sqrt {(-a+x) (-b+x) (-c+x)}} \\ & = -\frac {\left (\sqrt {-a+x} \sqrt {-b+x} \sqrt {-c+x}\right ) \int \left (\frac {-1+2 a d-b d-c d-\sqrt {1-4 a d+2 b d+2 c d+b^2 d^2-2 b c d^2+c^2 d^2}}{\sqrt {-a+x} \sqrt {-b+x} \sqrt {-c+x} \left (-1-b d-c d-\sqrt {1-4 a d+2 b d+2 c d+b^2 d^2-2 b c d^2+c^2 d^2}+2 d x\right )}+\frac {-1+2 a d-b d-c d+\sqrt {1-4 a d+2 b d+2 c d+b^2 d^2-2 b c d^2+c^2 d^2}}{\sqrt {-a+x} \sqrt {-b+x} \sqrt {-c+x} \left (-1-b d-c d+\sqrt {1-4 a d+2 b d+2 c d+b^2 d^2-2 b c d^2+c^2 d^2}+2 d x\right )}\right ) \, dx}{d \sqrt {(-a+x) (-b+x) (-c+x)}}+\frac {\left (\sqrt {-a+x} \sqrt {\frac {-b+x}{a-b}} \sqrt {-c+x}\right ) \int \frac {1}{\sqrt {-a+x} \sqrt {-c+x} \sqrt {-\frac {b}{a-b}+\frac {x}{a-b}}} \, dx}{d \sqrt {(-a+x) (-b+x) (-c+x)}} \\ & = -\frac {\left (\left (-1+2 a d-b d-c d-\sqrt {-4 a d+b^2 d^2+2 b d (1-c d)+(1+c d)^2}\right ) \sqrt {-a+x} \sqrt {-b+x} \sqrt {-c+x}\right ) \int \frac {1}{\sqrt {-a+x} \sqrt {-b+x} \sqrt {-c+x} \left (-1-b d-c d-\sqrt {1-4 a d+2 b d+2 c d+b^2 d^2-2 b c d^2+c^2 d^2}+2 d x\right )} \, dx}{d \sqrt {(-a+x) (-b+x) (-c+x)}}-\frac {\left (\left (-1+2 a d-b d-c d+\sqrt {-4 a d+b^2 d^2+2 b d (1-c d)+(1+c d)^2}\right ) \sqrt {-a+x} \sqrt {-b+x} \sqrt {-c+x}\right ) \int \frac {1}{\sqrt {-a+x} \sqrt {-b+x} \sqrt {-c+x} \left (-1-b d-c d+\sqrt {1-4 a d+2 b d+2 c d+b^2 d^2-2 b c d^2+c^2 d^2}+2 d x\right )} \, dx}{d \sqrt {(-a+x) (-b+x) (-c+x)}}+\frac {\left (\sqrt {-a+x} \sqrt {\frac {-b+x}{a-b}} \sqrt {\frac {-c+x}{a-c}}\right ) \int \frac {1}{\sqrt {-a+x} \sqrt {-\frac {b}{a-b}+\frac {x}{a-b}} \sqrt {-\frac {c}{a-c}+\frac {x}{a-c}}} \, dx}{d \sqrt {(-a+x) (-b+x) (-c+x)}} \\ & = \frac {2 \sqrt {-a+b} \sqrt {-\frac {b-x}{a-b}} \sqrt {-\frac {c-x}{a-c}} \sqrt {-a+x} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {-a+x}}{\sqrt {-a+b}}\right ),\frac {a-b}{a-c}\right )}{d \sqrt {-((a-x) (b-x) (c-x))}}+\frac {\left (2 \left (-1+2 a d-b d-c d-\sqrt {-4 a d+b^2 d^2+2 b d (1-c d)+(1+c d)^2}\right ) \sqrt {-a+x} \sqrt {-b+x} \sqrt {-c+x}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a-b+x^2} \sqrt {a-c+x^2} \left (1-2 a d+b d+c d+\sqrt {-4 a d+b^2 d^2+2 b d (1-c d)+(1+c d)^2}-2 d x^2\right )} \, dx,x,\sqrt {-a+x}\right )}{d \sqrt {(-a+x) (-b+x) (-c+x)}}+\frac {\left (2 \left (-1+2 a d-b d-c d+\sqrt {-4 a d+b^2 d^2+2 b d (1-c d)+(1+c d)^2}\right ) \sqrt {-a+x} \sqrt {-b+x} \sqrt {-c+x}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a-b+x^2} \sqrt {a-c+x^2} \left (1-2 a d+b d+c d-\sqrt {-4 a d+b^2 d^2+2 b d (1-c d)+(1+c d)^2}-2 d x^2\right )} \, dx,x,\sqrt {-a+x}\right )}{d \sqrt {(-a+x) (-b+x) (-c+x)}} \\ & = \frac {2 \sqrt {-a+b} \sqrt {-\frac {b-x}{a-b}} \sqrt {-\frac {c-x}{a-c}} \sqrt {-a+x} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {-a+x}}{\sqrt {-a+b}}\right ),\frac {a-b}{a-c}\right )}{d \sqrt {-((a-x) (b-x) (c-x))}}+\frac {\left (2 \left (-1+2 a d-b d-c d-\sqrt {-4 a d+b^2 d^2+2 b d (1-c d)+(1+c d)^2}\right ) \sqrt {-a+x} \sqrt {\frac {-b+x}{a-b}} \sqrt {-c+x}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a-c+x^2} \sqrt {1+\frac {x^2}{a-b}} \left (1-2 a d+b d+c d+\sqrt {-4 a d+b^2 d^2+2 b d (1-c d)+(1+c d)^2}-2 d x^2\right )} \, dx,x,\sqrt {-a+x}\right )}{d \sqrt {(-a+x) (-b+x) (-c+x)}}+\frac {\left (2 \left (-1+2 a d-b d-c d+\sqrt {-4 a d+b^2 d^2+2 b d (1-c d)+(1+c d)^2}\right ) \sqrt {-a+x} \sqrt {\frac {-b+x}{a-b}} \sqrt {-c+x}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a-c+x^2} \sqrt {1+\frac {x^2}{a-b}} \left (1-2 a d+b d+c d-\sqrt {-4 a d+b^2 d^2+2 b d (1-c d)+(1+c d)^2}-2 d x^2\right )} \, dx,x,\sqrt {-a+x}\right )}{d \sqrt {(-a+x) (-b+x) (-c+x)}} \\ & = \frac {2 \sqrt {-a+b} \sqrt {-\frac {b-x}{a-b}} \sqrt {-\frac {c-x}{a-c}} \sqrt {-a+x} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {-a+x}}{\sqrt {-a+b}}\right ),\frac {a-b}{a-c}\right )}{d \sqrt {-((a-x) (b-x) (c-x))}}+\frac {\left (2 \left (-1+2 a d-b d-c d-\sqrt {-4 a d+b^2 d^2+2 b d (1-c d)+(1+c d)^2}\right ) \sqrt {-a+x} \sqrt {\frac {-b+x}{a-b}} \sqrt {\frac {-c+x}{a-c}}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1+\frac {x^2}{a-b}} \sqrt {1+\frac {x^2}{a-c}} \left (1-2 a d+b d+c d+\sqrt {-4 a d+b^2 d^2+2 b d (1-c d)+(1+c d)^2}-2 d x^2\right )} \, dx,x,\sqrt {-a+x}\right )}{d \sqrt {(-a+x) (-b+x) (-c+x)}}+\frac {\left (2 \left (-1+2 a d-b d-c d+\sqrt {-4 a d+b^2 d^2+2 b d (1-c d)+(1+c d)^2}\right ) \sqrt {-a+x} \sqrt {\frac {-b+x}{a-b}} \sqrt {\frac {-c+x}{a-c}}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1+\frac {x^2}{a-b}} \sqrt {1+\frac {x^2}{a-c}} \left (1-2 a d+b d+c d-\sqrt {-4 a d+b^2 d^2+2 b d (1-c d)+(1+c d)^2}-2 d x^2\right )} \, dx,x,\sqrt {-a+x}\right )}{d \sqrt {(-a+x) (-b+x) (-c+x)}} \\ & = \frac {2 \sqrt {-a+b} \sqrt {-\frac {b-x}{a-b}} \sqrt {-\frac {c-x}{a-c}} \sqrt {-a+x} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {-a+x}}{\sqrt {-a+b}}\right ),\frac {a-b}{a-c}\right )}{d \sqrt {-((a-x) (b-x) (c-x))}}-\frac {2 \sqrt {-a+b} \sqrt {-\frac {b-x}{a-b}} \sqrt {-\frac {c-x}{a-c}} \sqrt {-a+x} \operatorname {EllipticPi}\left (-\frac {2 (a-b) d}{1-2 a d+b d+c d-\sqrt {-4 a d+b^2 d^2+2 b d (1-c d)+(1+c d)^2}},\arcsin \left (\frac {\sqrt {-a+x}}{\sqrt {-a+b}}\right ),\frac {a-b}{a-c}\right )}{d \sqrt {-((a-x) (b-x) (c-x))}}-\frac {2 \sqrt {-a+b} \sqrt {-\frac {b-x}{a-b}} \sqrt {-\frac {c-x}{a-c}} \sqrt {-a+x} \operatorname {EllipticPi}\left (-\frac {2 (a-b) d}{1-2 a d+b d+c d+\sqrt {-4 a d+b^2 d^2+2 b d (1-c d)+(1+c d)^2}},\arcsin \left (\frac {\sqrt {-a+x}}{\sqrt {-a+b}}\right ),\frac {a-b}{a-c}\right )}{d \sqrt {-((a-x) (b-x) (c-x))}} \\ \end{align*}
Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.
Time = 33.10 (sec) , antiderivative size = 308, normalized size of antiderivative = 5.13 \[ \int \frac {a b+a c-b c-2 a x+x^2}{\sqrt {(-a+x) (-b+x) (-c+x)} \left (a+b c d-(1+b d+c d) x+d x^2\right )} \, dx=-\frac {2 i \sqrt {\frac {b-x}{a-x}} \sqrt {\frac {c-x}{a-x}} (-a+x)^{3/2} \left (\operatorname {EllipticF}\left (i \text {arcsinh}\left (\frac {\sqrt {a-b}}{\sqrt {-a+x}}\right ),\frac {a-c}{a-b}\right )-\operatorname {EllipticPi}\left (\frac {2 (a-c) d}{-1+2 a d-b d-c d+\sqrt {-4 a d+b^2 d^2-2 b d (-1+c d)+(1+c d)^2}},i \text {arcsinh}\left (\frac {\sqrt {a-b}}{\sqrt {-a+x}}\right ),\frac {a-c}{a-b}\right )-\operatorname {EllipticPi}\left (-\frac {2 (a-c) d}{1-2 a d+b d+c d+\sqrt {-4 a d+b^2 d^2-2 b d (-1+c d)+(1+c d)^2}},i \text {arcsinh}\left (\frac {\sqrt {a-b}}{\sqrt {-a+x}}\right ),\frac {a-c}{a-b}\right )\right )}{\sqrt {a-b} d \sqrt {(-a+x) (-b+x) (-c+x)}} \]
[In]
[Out]
Result contains higher order function than in optimal. Order 4 vs. order 3.
Time = 2.59 (sec) , antiderivative size = 9198, normalized size of antiderivative = 153.30
method | result | size |
default | \(\text {Expression too large to display}\) | \(9198\) |
elliptic | \(\text {Expression too large to display}\) | \(9394\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 107 vs. \(2 (49) = 98\).
Time = 16.76 (sec) , antiderivative size = 379, normalized size of antiderivative = 6.32 \[ \int \frac {a b+a c-b c-2 a x+x^2}{\sqrt {(-a+x) (-b+x) (-c+x)} \left (a+b c d-(1+b d+c d) x+d x^2\right )} \, dx=\left [\frac {\log \left (\frac {b^{2} c^{2} d^{2} + d^{2} x^{4} - 6 \, a b c d - 2 \, {\left ({\left (b + c\right )} d^{2} - 3 \, d\right )} x^{3} + {\left ({\left (b^{2} + 4 \, b c + c^{2}\right )} d^{2} - 6 \, {\left (a + b + c\right )} d + 1\right )} x^{2} + a^{2} - 4 \, \sqrt {-a b c - {\left (a + b + c\right )} x^{2} + x^{3} + {\left (a b + {\left (a + b\right )} c\right )} x} {\left (b c d + d x^{2} - {\left ({\left (b + c\right )} d - 1\right )} x - a\right )} \sqrt {d} - 2 \, {\left ({\left (b^{2} c + b c^{2}\right )} d^{2} - 3 \, {\left (a b + {\left (a + b\right )} c\right )} d + a\right )} x}{b^{2} c^{2} d^{2} + d^{2} x^{4} + 2 \, a b c d - 2 \, {\left ({\left (b + c\right )} d^{2} + d\right )} x^{3} + {\left ({\left (b^{2} + 4 \, b c + c^{2}\right )} d^{2} + 2 \, {\left (a + b + c\right )} d + 1\right )} x^{2} + a^{2} - 2 \, {\left ({\left (b^{2} c + b c^{2}\right )} d^{2} + {\left (a b + {\left (a + b\right )} c\right )} d + a\right )} x}\right )}{2 \, \sqrt {d}}, \frac {\sqrt {-d} \arctan \left (-\frac {\sqrt {-a b c - {\left (a + b + c\right )} x^{2} + x^{3} + {\left (a b + {\left (a + b\right )} c\right )} x} {\left (b c d + d x^{2} - {\left ({\left (b + c\right )} d - 1\right )} x - a\right )} \sqrt {-d}}{2 \, {\left (a b c d + {\left (a + b + c\right )} d x^{2} - d x^{3} - {\left (a b + {\left (a + b\right )} c\right )} d x\right )}}\right )}{d}\right ] \]
[In]
[Out]
Timed out. \[ \int \frac {a b+a c-b c-2 a x+x^2}{\sqrt {(-a+x) (-b+x) (-c+x)} \left (a+b c d-(1+b d+c d) x+d x^2\right )} \, dx=\text {Timed out} \]
[In]
[Out]
Exception generated. \[ \int \frac {a b+a c-b c-2 a x+x^2}{\sqrt {(-a+x) (-b+x) (-c+x)} \left (a+b c d-(1+b d+c d) x+d x^2\right )} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
\[ \int \frac {a b+a c-b c-2 a x+x^2}{\sqrt {(-a+x) (-b+x) (-c+x)} \left (a+b c d-(1+b d+c d) x+d x^2\right )} \, dx=\int { \frac {a b + a c - b c - 2 \, a x + x^{2}}{\sqrt {-{\left (a - x\right )} {\left (b - x\right )} {\left (c - x\right )}} {\left (b c d + d x^{2} - {\left (b d + c d + 1\right )} x + a\right )}} \,d x } \]
[In]
[Out]
Time = 5.76 (sec) , antiderivative size = 690, normalized size of antiderivative = 11.50 \[ \int \frac {a b+a c-b c-2 a x+x^2}{\sqrt {(-a+x) (-b+x) (-c+x)} \left (a+b c d-(1+b d+c d) x+d x^2\right )} \, dx=\frac {2\,\left (a-c\right )\,\mathrm {F}\left (\mathrm {asin}\left (\sqrt {-\frac {c-x}{a-c}}\right )\middle |\frac {a-c}{b-c}\right )\,\sqrt {\frac {a-x}{a-c}}\,\sqrt {-\frac {c-x}{a-c}}\,\sqrt {\frac {b-x}{b-c}}}{d\,\sqrt {x^3+\left (-a-b-c\right )\,x^2+\left (a\,b+a\,c+b\,c\right )\,x-a\,b\,c}}+\frac {\left (a-c\right )\,\sqrt {\frac {a-x}{a-c}}\,\sqrt {-\frac {c-x}{a-c}}\,\sqrt {\frac {b-x}{b-c}}\,\Pi \left (-\frac {a-c}{c-\frac {b\,d+c\,d+\sqrt {b^2\,d^2-2\,b\,c\,d^2+2\,b\,d+c^2\,d^2+2\,c\,d-4\,a\,d+1}+1}{2\,d}};\mathrm {asin}\left (\sqrt {-\frac {c-x}{a-c}}\right )\middle |\frac {a-c}{b-c}\right )\,\left (b\,d-2\,a\,d+c\,d+\sqrt {b^2\,d^2-2\,b\,c\,d^2+2\,b\,d+c^2\,d^2+2\,c\,d-4\,a\,d+1}+1\right )}{d^2\,\left (c-\frac {b\,d+c\,d+\sqrt {b^2\,d^2-2\,b\,c\,d^2+2\,b\,d+c^2\,d^2+2\,c\,d-4\,a\,d+1}+1}{2\,d}\right )\,\sqrt {x^3+\left (-a-b-c\right )\,x^2+\left (a\,b+a\,c+b\,c\right )\,x-a\,b\,c}}+\frac {\left (a-c\right )\,\sqrt {\frac {a-x}{a-c}}\,\sqrt {-\frac {c-x}{a-c}}\,\sqrt {\frac {b-x}{b-c}}\,\Pi \left (-\frac {a-c}{c-\frac {b\,d+c\,d-\sqrt {b^2\,d^2-2\,b\,c\,d^2+2\,b\,d+c^2\,d^2+2\,c\,d-4\,a\,d+1}+1}{2\,d}};\mathrm {asin}\left (\sqrt {-\frac {c-x}{a-c}}\right )\middle |\frac {a-c}{b-c}\right )\,\left (b\,d-2\,a\,d+c\,d-\sqrt {b^2\,d^2-2\,b\,c\,d^2+2\,b\,d+c^2\,d^2+2\,c\,d-4\,a\,d+1}+1\right )}{d^2\,\left (c-\frac {b\,d+c\,d-\sqrt {b^2\,d^2-2\,b\,c\,d^2+2\,b\,d+c^2\,d^2+2\,c\,d-4\,a\,d+1}+1}{2\,d}\right )\,\sqrt {x^3+\left (-a-b-c\right )\,x^2+\left (a\,b+a\,c+b\,c\right )\,x-a\,b\,c}} \]
[In]
[Out]