Integrand size = 66, antiderivative size = 69 \[ \int \frac {(-a+x) (-b+x) \left (3 a b-2 (a+b) x+x^2\right )}{x^2 \sqrt {x (-a+x) (-b+x)} \left (-a b+(a+b) x-x^2+d x^3\right )} \, dx=\frac {2 \sqrt {a b x+(-a-b) x^2+x^3}}{x^2}-2 \sqrt {d} \text {arctanh}\left (\frac {\sqrt {a b x+(-a-b) x^2+x^3}}{\sqrt {d} x^2}\right ) \]
2*(a*b*x+(-a-b)*x^2+x^3)^(1/2)/x^2-2*d^(1/2)*arctanh((a*b*x+(-a-b)*x^2+x^3 )^(1/2)/d^(1/2)/x^2)
Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.
Time = 22.64 (sec) , antiderivative size = 4112, normalized size of antiderivative = 59.59 \[ \int \frac {(-a+x) (-b+x) \left (3 a b-2 (a+b) x+x^2\right )}{x^2 \sqrt {x (-a+x) (-b+x)} \left (-a b+(a+b) x-x^2+d x^3\right )} \, dx=\text {Result too large to show} \]
Integrate[((-a + x)*(-b + x)*(3*a*b - 2*(a + b)*x + x^2))/(x^2*Sqrt[x*(-a + x)*(-b + x)]*(-(a*b) + (a + b)*x - x^2 + d*x^3)),x]
(2*Sqrt[x*(-a + x)*(-b + x)]*(1 - (I*x*Sqrt[(-b + x)/(a - b)]*(3*a^6*d^2*E llipticF[I*ArcSinh[Sqrt[-1 + x/a]], a/(a - b)] - a^3*(-1 + 3*a*d)*(-a + b + 3*a^2*d)*EllipticF[I*ArcSinh[Sqrt[-1 + x/a]], a/(a - b)] + a^3*(-a + b + 3*a^2*d)*(-1 + 2*a*d + 2*b*d)*(EllipticPi[a/Root[-(a^3*d) + (-a + b + 3*a ^2*d)*#1 + (1 - 3*a*d)*#1^2 + d*#1^3 & , 1], I*ArcSinh[Sqrt[-1 + x/a]], a/ (a - b)] - EllipticPi[a/Root[-(a^3*d) + (-a + b + 3*a^2*d)*#1 + (1 - 3*a*d )*#1^2 + d*#1^3 & , 2], I*ArcSinh[Sqrt[-1 + x/a]], a/(a - b)]) + a^3*(-1 + 3*a*d)*(b + 4*a^2*d + a*(-1 + b*d))*(EllipticPi[a/Root[-(a^3*d) + (-a + b + 3*a^2*d)*#1 + (1 - 3*a*d)*#1^2 + d*#1^3 & , 2], I*ArcSinh[Sqrt[-1 + x/a ]], a/(a - b)] - EllipticPi[a/Root[-(a^3*d) + (-a + b + 3*a^2*d)*#1 + (1 - 3*a*d)*#1^2 + d*#1^3 & , 3], I*ArcSinh[Sqrt[-1 + x/a]], a/(a - b)]) - 3*a ^5*(2*a - b)*d^2*EllipticPi[a/Root[-(a^3*d) + (-a + b + 3*a^2*d)*#1 + (1 - 3*a*d)*#1^2 + d*#1^3 & , 3], I*ArcSinh[Sqrt[-1 + x/a]], a/(a - b)] + a^2* (2*a - b)*(-1 + 3*a*d)*(-a + b + 3*a^2*d)*EllipticPi[a/Root[-(a^3*d) + (-a + b + 3*a^2*d)*#1 + (1 - 3*a*d)*#1^2 + d*#1^3 & , 3], I*ArcSinh[Sqrt[-1 + x/a]], a/(a - b)] - 2*a^2*(2*a - b)*d^2*EllipticPi[a/Root[-(a^3*d) + (-a + b + 3*a^2*d)*#1 + (1 - 3*a*d)*#1^2 + d*#1^3 & , 3], I*ArcSinh[Sqrt[-1 + x/a]], a/(a - b)]*Root[-(a^3*d) + (-a + b + 3*a^2*d)*#1 + (1 - 3*a*d)*#1^2 + d*#1^3 & , 1]*Root[-(a^3*d) + (-a + b + 3*a^2*d)*#1 + (1 - 3*a*d)*#1^2 + d*#1^3 & , 2]^2 - a^2*(2*a - b)*d^2*(EllipticPi[a/Root[-(a^3*d) + (-a...
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {(x-a) (x-b) \left (-2 x (a+b)+3 a b+x^2\right )}{x^2 \sqrt {x (x-a) (x-b)} \left (x (a+b)-a b+d x^3-x^2\right )} \, dx\) |
\(\Big \downarrow \) 2467 |
\(\displaystyle \frac {\sqrt {x} \sqrt {-x (a+b)+a b+x^2} \int -\frac {(a-x) (b-x) \left (x^2-2 (a+b) x+3 a b\right )}{x^{5/2} \sqrt {x^2-(a+b) x+a b} \left (-d x^3+x^2-(a+b) x+a b\right )}dx}{\sqrt {x (a-x) (b-x)}}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\frac {\sqrt {x} \sqrt {-x (a+b)+a b+x^2} \int \frac {(a-x) (b-x) \left (x^2-2 (a+b) x+3 a b\right )}{x^{5/2} \sqrt {x^2-(a+b) x+a b} \left (-d x^3+x^2-(a+b) x+a b\right )}dx}{\sqrt {x (a-x) (b-x)}}\) |
\(\Big \downarrow \) 2035 |
\(\displaystyle -\frac {2 \sqrt {x} \sqrt {-x (a+b)+a b+x^2} \int \frac {(a-x) (b-x) \left (x^2-2 (a+b) x+3 a b\right )}{x^2 \sqrt {x^2-(a+b) x+a b} \left (-d x^3+x^2-(a+b) x+a b\right )}d\sqrt {x}}{\sqrt {x (a-x) (b-x)}}\) |
\(\Big \downarrow \) 7293 |
\(\displaystyle -\frac {2 \sqrt {x} \sqrt {-x (a+b)+a b+x^2} \int \left (\frac {3 a b}{x^2 \sqrt {x^2-(a+b) x+a b}}-\frac {2 (a+b)}{x \sqrt {x^2-(a+b) x+a b}}+\frac {(-2 a d-2 b d+1) x^2-(-3 b d a+a+b) x+a b}{\sqrt {x^2-(a+b) x+a b} \left (-d x^3+x^2-a \left (\frac {b}{a}+1\right ) x+a b\right )}\right )d\sqrt {x}}{\sqrt {x (a-x) (b-x)}}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {2 \sqrt {x} \sqrt {-x (a+b)+a b+x^2} \left (a b \int \frac {1}{\sqrt {x^2-(a+b) x+a b} \left (-d x^3+x^2-a \left (\frac {b}{a}+1\right ) x+a b\right )}d\sqrt {x}-(a (1-3 b d)+b) \int \frac {x}{\sqrt {x^2-(a+b) x+a b} \left (-d x^3+x^2-a \left (\frac {b}{a}+1\right ) x+a b\right )}d\sqrt {x}+(-2 a d-2 b d+1) \int \frac {x^2}{\sqrt {x^2-(a+b) x+a b} \left (-d x^3+x^2-a \left (\frac {b}{a}+1\right ) x+a b\right )}d\sqrt {x}-\frac {(a+b) \left (\sqrt {a} \sqrt {b}+x\right ) \sqrt {\frac {-x (a+b)+a b+x^2}{\left (\sqrt {a} \sqrt {b}+x\right )^2}} \operatorname {EllipticF}\left (2 \arctan \left (\frac {\sqrt {x}}{\sqrt [4]{a} \sqrt [4]{b}}\right ),\frac {1}{4} \left (\frac {a+b}{\sqrt {a} \sqrt {b}}+2\right )\right )}{a^{3/4} b^{3/4} \sqrt {-x (a+b)+a b+x^2}}-\frac {\left (\sqrt {a} \sqrt {b}-2 (a+b)\right ) \left (\sqrt {a} \sqrt {b}+x\right ) \sqrt {\frac {-x (a+b)+a b+x^2}{\left (\sqrt {a} \sqrt {b}+x\right )^2}} \operatorname {EllipticF}\left (2 \arctan \left (\frac {\sqrt {x}}{\sqrt [4]{a} \sqrt [4]{b}}\right ),\frac {1}{4} \left (\frac {a+b}{\sqrt {a} \sqrt {b}}+2\right )\right )}{2 a^{3/4} b^{3/4} \sqrt {-x (a+b)+a b+x^2}}-\frac {\sqrt {-x (a+b)+a b+x^2}}{x^{3/2}}\right )}{\sqrt {x (a-x) (b-x)}}\) |
Int[((-a + x)*(-b + x)*(3*a*b - 2*(a + b)*x + x^2))/(x^2*Sqrt[x*(-a + x)*( -b + x)]*(-(a*b) + (a + b)*x - x^2 + d*x^3)),x]
3.10.7.3.1 Defintions of rubi rules used
Int[(Fx_)*(x_)^(m_), x_Symbol] :> With[{k = Denominator[m]}, Simp[k Subst [Int[x^(k*(m + 1) - 1)*SubstPower[Fx, x, k], x], x, x^(1/k)], x]] /; Fracti onQ[m] && AlgebraicFunctionQ[Fx, x]
Int[(Fx_.)*(Px_)^(p_), x_Symbol] :> With[{r = Expon[Px, x, Min]}, Simp[Px^F racPart[p]/(x^(r*FracPart[p])*ExpandToSum[Px/x^r, x]^FracPart[p]) Int[x^( p*r)*ExpandToSum[Px/x^r, x]^p*Fx, x], x] /; IGtQ[r, 0]] /; FreeQ[p, x] && P olyQ[Px, x] && !IntegerQ[p] && !MonomialQ[Px, x] && !PolyQ[Fx, x]
Result contains higher order function than in optimal. Order 9 vs. order 3.
Time = 3.36 (sec) , antiderivative size = 321, normalized size of antiderivative = 4.65
method | result | size |
elliptic | \(\frac {2 \sqrt {a b x -a \,x^{2}-b \,x^{2}+x^{3}}}{x^{2}}-\frac {2 b \sqrt {-\frac {-b +x}{b}}\, \sqrt {\frac {-a +x}{-a +b}}\, \sqrt {\frac {x}{b}}\, \operatorname {EllipticF}\left (\sqrt {-\frac {-b +x}{b}}, \sqrt {\frac {b}{-a +b}}\right )}{\sqrt {a b x -a \,x^{2}-b \,x^{2}+x^{3}}}-\frac {2 \left (\munderset {\underline {\hspace {1.25 ex}}\alpha =\operatorname {RootOf}\left (d \,\textit {\_Z}^{3}-\textit {\_Z}^{2}+\left (a +b \right ) \textit {\_Z} -a b \right )}{\sum }\frac {\left (2 \underline {\hspace {1.25 ex}}\alpha ^{2} a d +2 \underline {\hspace {1.25 ex}}\alpha ^{2} b d -3 \underline {\hspace {1.25 ex}}\alpha a b d -\underline {\hspace {1.25 ex}}\alpha ^{2}+\underline {\hspace {1.25 ex}}\alpha a +\underline {\hspace {1.25 ex}}\alpha b -a b \right ) \left (\underline {\hspace {1.25 ex}}\alpha ^{2} d +\underline {\hspace {1.25 ex}}\alpha b d +d \,b^{2}-\underline {\hspace {1.25 ex}}\alpha +a \right ) \sqrt {-\frac {-b +x}{b}}\, \sqrt {\frac {-a +x}{-a +b}}\, \sqrt {\frac {x}{b}}\, \operatorname {EllipticPi}\left (\sqrt {-\frac {-b +x}{b}}, \frac {\underline {\hspace {1.25 ex}}\alpha ^{2} d +\underline {\hspace {1.25 ex}}\alpha b d +d \,b^{2}-\underline {\hspace {1.25 ex}}\alpha +a}{b^{2} d}, \sqrt {\frac {b}{-a +b}}\right )}{\left (-3 \underline {\hspace {1.25 ex}}\alpha ^{2} d +2 \underline {\hspace {1.25 ex}}\alpha -a -b \right ) \sqrt {x \left (a b -a x -b x +x^{2}\right )}}\right )}{b^{2} d}\) | \(321\) |
risch | \(\frac {2 \left (a -x \right ) \left (b -x \right )}{x \sqrt {x \left (-a +x \right ) \left (-b +x \right )}}+d \left (-\frac {2 a \sqrt {-\frac {-a +x}{a}}\, \sqrt {\frac {-b +x}{a -b}}\, \sqrt {\frac {x}{a}}\, \operatorname {EllipticF}\left (\sqrt {-\frac {-a +x}{a}}, \sqrt {\frac {a}{a -b}}\right )}{d \sqrt {a b x -a \,x^{2}-b \,x^{2}+x^{3}}}+\frac {2 \left (\munderset {\underline {\hspace {1.25 ex}}\alpha =\operatorname {RootOf}\left (d \,\textit {\_Z}^{3}-\textit {\_Z}^{2}+\left (a +b \right ) \textit {\_Z} -a b \right )}{\sum }\frac {\left (-2 \underline {\hspace {1.25 ex}}\alpha ^{2} a d -2 \underline {\hspace {1.25 ex}}\alpha ^{2} b d +3 \underline {\hspace {1.25 ex}}\alpha a b d +\underline {\hspace {1.25 ex}}\alpha ^{2}-\underline {\hspace {1.25 ex}}\alpha a -\underline {\hspace {1.25 ex}}\alpha b +a b \right ) \left (\underline {\hspace {1.25 ex}}\alpha ^{2} d +\underline {\hspace {1.25 ex}}\alpha a d +a^{2} d -\underline {\hspace {1.25 ex}}\alpha +b \right ) \sqrt {-\frac {-a +x}{a}}\, \sqrt {\frac {-b +x}{a -b}}\, \sqrt {\frac {x}{a}}\, \operatorname {EllipticPi}\left (\sqrt {-\frac {-a +x}{a}}, \frac {\underline {\hspace {1.25 ex}}\alpha ^{2} d +\underline {\hspace {1.25 ex}}\alpha a d +a^{2} d -\underline {\hspace {1.25 ex}}\alpha +b}{d \,a^{2}}, \sqrt {\frac {a}{a -b}}\right )}{\left (-3 \underline {\hspace {1.25 ex}}\alpha ^{2} d +2 \underline {\hspace {1.25 ex}}\alpha -a -b \right ) \sqrt {x \left (a b -a x -b x +x^{2}\right )}}\right )}{d^{2} a^{2}}\right )\) | \(328\) |
default | \(-\left (-2 a -2 b \right ) \left (-\frac {2 \left (a b -a x -b x +x^{2}\right )}{a b \sqrt {x \left (a b -a x -b x +x^{2}\right )}}-\frac {2 \left (\frac {a +b}{a b}+\frac {-a -b}{a b}\right ) b \sqrt {-\frac {-b +x}{b}}\, \sqrt {\frac {-a +x}{-a +b}}\, \sqrt {\frac {x}{b}}\, \operatorname {EllipticF}\left (\sqrt {-\frac {-b +x}{b}}, \sqrt {\frac {b}{-a +b}}\right )}{\sqrt {a b x -a \,x^{2}-b \,x^{2}+x^{3}}}-\frac {2 \sqrt {-\frac {-b +x}{b}}\, \sqrt {\frac {-a +x}{-a +b}}\, \sqrt {\frac {x}{b}}\, \left (\left (-a +b \right ) \operatorname {EllipticE}\left (\sqrt {-\frac {-b +x}{b}}, \sqrt {\frac {b}{-a +b}}\right )+a \operatorname {EllipticF}\left (\sqrt {-\frac {-b +x}{b}}, \sqrt {\frac {b}{-a +b}}\right )\right )}{a \sqrt {a b x -a \,x^{2}-b \,x^{2}+x^{3}}}\right )-3 a b \left (-\frac {2 \sqrt {a b x -a \,x^{2}-b \,x^{2}+x^{3}}}{3 a b \,x^{2}}-\frac {4 \left (a b -a x -b x +x^{2}\right ) \left (a +b \right )}{3 a^{2} b^{2} \sqrt {x \left (a b -a x -b x +x^{2}\right )}}-\frac {2 \left (-\frac {1}{3 a b}+\frac {2 \left (a +b \right )^{2}}{3 a^{2} b^{2}}+\frac {2 \left (-a -b \right ) \left (a +b \right )}{3 a^{2} b^{2}}\right ) b \sqrt {-\frac {-b +x}{b}}\, \sqrt {\frac {-a +x}{-a +b}}\, \sqrt {\frac {x}{b}}\, \operatorname {EllipticF}\left (\sqrt {-\frac {-b +x}{b}}, \sqrt {\frac {b}{-a +b}}\right )}{\sqrt {a b x -a \,x^{2}-b \,x^{2}+x^{3}}}-\frac {4 \left (a +b \right ) \sqrt {-\frac {-b +x}{b}}\, \sqrt {\frac {-a +x}{-a +b}}\, \sqrt {\frac {x}{b}}\, \left (\left (-a +b \right ) \operatorname {EllipticE}\left (\sqrt {-\frac {-b +x}{b}}, \sqrt {\frac {b}{-a +b}}\right )+a \operatorname {EllipticF}\left (\sqrt {-\frac {-b +x}{b}}, \sqrt {\frac {b}{-a +b}}\right )\right )}{3 a^{2} b \sqrt {a b x -a \,x^{2}-b \,x^{2}+x^{3}}}\right )+\frac {2 \left (\munderset {\underline {\hspace {1.25 ex}}\alpha =\operatorname {RootOf}\left (d \,\textit {\_Z}^{3}-\textit {\_Z}^{2}+\left (a +b \right ) \textit {\_Z} -a b \right )}{\sum }\frac {\left (-2 \underline {\hspace {1.25 ex}}\alpha ^{2} a d -2 \underline {\hspace {1.25 ex}}\alpha ^{2} b d +3 \underline {\hspace {1.25 ex}}\alpha a b d +\underline {\hspace {1.25 ex}}\alpha ^{2}-\underline {\hspace {1.25 ex}}\alpha a -\underline {\hspace {1.25 ex}}\alpha b +a b \right ) \left (\underline {\hspace {1.25 ex}}\alpha ^{2} d +\underline {\hspace {1.25 ex}}\alpha b d +d \,b^{2}-\underline {\hspace {1.25 ex}}\alpha +a \right ) \sqrt {-\frac {-b +x}{b}}\, \sqrt {\frac {-a +x}{-a +b}}\, \sqrt {\frac {x}{b}}\, \operatorname {EllipticPi}\left (\sqrt {-\frac {-b +x}{b}}, \frac {\underline {\hspace {1.25 ex}}\alpha ^{2} d +\underline {\hspace {1.25 ex}}\alpha b d +d \,b^{2}-\underline {\hspace {1.25 ex}}\alpha +a}{b^{2} d}, \sqrt {\frac {b}{-a +b}}\right )}{\left (-3 \underline {\hspace {1.25 ex}}\alpha ^{2} d +2 \underline {\hspace {1.25 ex}}\alpha -a -b \right ) \sqrt {x \left (a b -a x -b x +x^{2}\right )}}\right )}{b^{2} d}\) | \(818\) |
int((-a+x)*(-b+x)*(3*a*b-2*(a+b)*x+x^2)/x^2/(x*(-a+x)*(-b+x))^(1/2)/(-a*b+ (a+b)*x-x^2+d*x^3),x,method=_RETURNVERBOSE)
2*(a*b*x-a*x^2-b*x^2+x^3)^(1/2)/x^2-2*b*(-(-b+x)/b)^(1/2)*((-a+x)/(-a+b))^ (1/2)*(x/b)^(1/2)/(a*b*x-a*x^2-b*x^2+x^3)^(1/2)*EllipticF((-(-b+x)/b)^(1/2 ),(b/(-a+b))^(1/2))-2/b^2/d*sum((2*_alpha^2*a*d+2*_alpha^2*b*d-3*_alpha*a* b*d-_alpha^2+_alpha*a+_alpha*b-a*b)/(-3*_alpha^2*d+2*_alpha-a-b)*(_alpha^2 *d+_alpha*b*d+b^2*d-_alpha+a)*(-(-b+x)/b)^(1/2)*((-a+x)/(-a+b))^(1/2)*(x/b )^(1/2)/(x*(a*b-a*x-b*x+x^2))^(1/2)*EllipticPi((-(-b+x)/b)^(1/2),(_alpha^2 *d+_alpha*b*d+b^2*d-_alpha+a)/b^2/d,(b/(-a+b))^(1/2)),_alpha=RootOf(d*_Z^3 -_Z^2+(a+b)*_Z-a*b))
Time = 1.11 (sec) , antiderivative size = 338, normalized size of antiderivative = 4.90 \[ \int \frac {(-a+x) (-b+x) \left (3 a b-2 (a+b) x+x^2\right )}{x^2 \sqrt {x (-a+x) (-b+x)} \left (-a b+(a+b) x-x^2+d x^3\right )} \, dx=\left [\frac {\sqrt {d} x^{2} \log \left (\frac {d^{2} x^{6} + 6 \, d x^{5} - {\left (6 \, {\left (a + b\right )} d - 1\right )} x^{4} + a^{2} b^{2} + 2 \, {\left (3 \, a b d - a - b\right )} x^{3} + {\left (a^{2} + 4 \, a b + b^{2}\right )} x^{2} - 4 \, {\left (d x^{4} + a b x - {\left (a + b\right )} x^{2} + x^{3}\right )} \sqrt {a b x - {\left (a + b\right )} x^{2} + x^{3}} \sqrt {d} - 2 \, {\left (a^{2} b + a b^{2}\right )} x}{d^{2} x^{6} - 2 \, d x^{5} + {\left (2 \, {\left (a + b\right )} d + 1\right )} x^{4} + a^{2} b^{2} - 2 \, {\left (a b d + a + b\right )} x^{3} + {\left (a^{2} + 4 \, a b + b^{2}\right )} x^{2} - 2 \, {\left (a^{2} b + a b^{2}\right )} x}\right ) + 4 \, \sqrt {a b x - {\left (a + b\right )} x^{2} + x^{3}}}{2 \, x^{2}}, \frac {\sqrt {-d} x^{2} \arctan \left (\frac {{\left (d x^{3} + a b - {\left (a + b\right )} x + x^{2}\right )} \sqrt {a b x - {\left (a + b\right )} x^{2} + x^{3}} \sqrt {-d}}{2 \, {\left (a b d x^{2} - {\left (a + b\right )} d x^{3} + d x^{4}\right )}}\right ) + 2 \, \sqrt {a b x - {\left (a + b\right )} x^{2} + x^{3}}}{x^{2}}\right ] \]
integrate((-a+x)*(-b+x)*(3*a*b-2*(a+b)*x+x^2)/x^2/(x*(-a+x)*(-b+x))^(1/2)/ (-a*b+(a+b)*x-x^2+d*x^3),x, algorithm="fricas")
[1/2*(sqrt(d)*x^2*log((d^2*x^6 + 6*d*x^5 - (6*(a + b)*d - 1)*x^4 + a^2*b^2 + 2*(3*a*b*d - a - b)*x^3 + (a^2 + 4*a*b + b^2)*x^2 - 4*(d*x^4 + a*b*x - (a + b)*x^2 + x^3)*sqrt(a*b*x - (a + b)*x^2 + x^3)*sqrt(d) - 2*(a^2*b + a* b^2)*x)/(d^2*x^6 - 2*d*x^5 + (2*(a + b)*d + 1)*x^4 + a^2*b^2 - 2*(a*b*d + a + b)*x^3 + (a^2 + 4*a*b + b^2)*x^2 - 2*(a^2*b + a*b^2)*x)) + 4*sqrt(a*b* x - (a + b)*x^2 + x^3))/x^2, (sqrt(-d)*x^2*arctan(1/2*(d*x^3 + a*b - (a + b)*x + x^2)*sqrt(a*b*x - (a + b)*x^2 + x^3)*sqrt(-d)/(a*b*d*x^2 - (a + b)* d*x^3 + d*x^4)) + 2*sqrt(a*b*x - (a + b)*x^2 + x^3))/x^2]
Timed out. \[ \int \frac {(-a+x) (-b+x) \left (3 a b-2 (a+b) x+x^2\right )}{x^2 \sqrt {x (-a+x) (-b+x)} \left (-a b+(a+b) x-x^2+d x^3\right )} \, dx=\text {Timed out} \]
integrate((-a+x)*(-b+x)*(3*a*b-2*(a+b)*x+x**2)/x**2/(x*(-a+x)*(-b+x))**(1/ 2)/(-a*b+(a+b)*x-x**2+d*x**3),x)
\[ \int \frac {(-a+x) (-b+x) \left (3 a b-2 (a+b) x+x^2\right )}{x^2 \sqrt {x (-a+x) (-b+x)} \left (-a b+(a+b) x-x^2+d x^3\right )} \, dx=\int { \frac {{\left (3 \, a b - 2 \, {\left (a + b\right )} x + x^{2}\right )} {\left (a - x\right )} {\left (b - x\right )}}{{\left (d x^{3} - a b + {\left (a + b\right )} x - x^{2}\right )} \sqrt {{\left (a - x\right )} {\left (b - x\right )} x} x^{2}} \,d x } \]
integrate((-a+x)*(-b+x)*(3*a*b-2*(a+b)*x+x^2)/x^2/(x*(-a+x)*(-b+x))^(1/2)/ (-a*b+(a+b)*x-x^2+d*x^3),x, algorithm="maxima")
integrate((3*a*b - 2*(a + b)*x + x^2)*(a - x)*(b - x)/((d*x^3 - a*b + (a + b)*x - x^2)*sqrt((a - x)*(b - x)*x)*x^2), x)
\[ \int \frac {(-a+x) (-b+x) \left (3 a b-2 (a+b) x+x^2\right )}{x^2 \sqrt {x (-a+x) (-b+x)} \left (-a b+(a+b) x-x^2+d x^3\right )} \, dx=\int { \frac {{\left (3 \, a b - 2 \, {\left (a + b\right )} x + x^{2}\right )} {\left (a - x\right )} {\left (b - x\right )}}{{\left (d x^{3} - a b + {\left (a + b\right )} x - x^{2}\right )} \sqrt {{\left (a - x\right )} {\left (b - x\right )} x} x^{2}} \,d x } \]
integrate((-a+x)*(-b+x)*(3*a*b-2*(a+b)*x+x^2)/x^2/(x*(-a+x)*(-b+x))^(1/2)/ (-a*b+(a+b)*x-x^2+d*x^3),x, algorithm="giac")
integrate((3*a*b - 2*(a + b)*x + x^2)*(a - x)*(b - x)/((d*x^3 - a*b + (a + b)*x - x^2)*sqrt((a - x)*(b - x)*x)*x^2), x)
Time = 9.44 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.41 \[ \int \frac {(-a+x) (-b+x) \left (3 a b-2 (a+b) x+x^2\right )}{x^2 \sqrt {x (-a+x) (-b+x)} \left (-a b+(a+b) x-x^2+d x^3\right )} \, dx=\sqrt {d}\,\ln \left (\frac {a\,b-a\,x-b\,x+d\,x^3+x^2-2\,\sqrt {d}\,x\,\sqrt {x\,\left (a-x\right )\,\left (b-x\right )}}{a\,x-a\,b+b\,x+d\,x^3-x^2}\right )+\frac {2\,\sqrt {x^3-b\,x^2-a\,x^2+a\,b\,x}}{x^2} \]
int(-((a - x)*(b - x)*(3*a*b + x^2 - 2*x*(a + b)))/(x^2*(x*(a - x)*(b - x) )^(1/2)*(a*b - d*x^3 + x^2 - x*(a + b))),x)