\(\int \frac {-a^2 b+a (2 a+b) x-3 a x^2+x^3}{x (-b+x) \sqrt {x (-a+x) (-b+x)} (a-(1+b d) x+d x^2)} \, dx\) [1061]

   Optimal result
   Rubi [F]
   Mathematica [A] (verified)
   Maple [C] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [F]
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 68, antiderivative size = 80 \[ \int \frac {-a^2 b+a (2 a+b) x-3 a x^2+x^3}{x (-b+x) \sqrt {x (-a+x) (-b+x)} \left (a-(1+b d) x+d x^2\right )} \, dx=\frac {2 \sqrt {a b x+(-a-b) x^2+x^3}}{x (-b+x)}+2 \sqrt {d} \text {arctanh}\left (\frac {\sqrt {d} \sqrt {a b x+(-a-b) x^2+x^3}}{a-x}\right ) \]

[Out]

2*(a*b*x+(-a-b)*x^2+x^3)^(1/2)/x/(-b+x)+2*d^(1/2)*arctanh(d^(1/2)*(a*b*x+(-a-b)*x^2+x^3)^(1/2)/(a-x))

Rubi [F]

\[ \int \frac {-a^2 b+a (2 a+b) x-3 a x^2+x^3}{x (-b+x) \sqrt {x (-a+x) (-b+x)} \left (a-(1+b d) x+d x^2\right )} \, dx=\int \frac {-a^2 b+a (2 a+b) x-3 a x^2+x^3}{x (-b+x) \sqrt {x (-a+x) (-b+x)} \left (a-(1+b d) x+d x^2\right )} \, dx \]

[In]

Int[(-(a^2*b) + a*(2*a + b)*x - 3*a*x^2 + x^3)/(x*(-b + x)*Sqrt[x*(-a + x)*(-b + x)]*(a - (1 + b*d)*x + d*x^2)
),x]

[Out]

(-4*Sqrt[(a - x)*(b - x)*x])/(b^2*d*x) + (2*Sqrt[(a - x)*(b - x)*x])/(b*d*(b - x)*x) - (4*Sqrt[a]*Sqrt[(a - x)
*(b - x)*x]*Sqrt[1 - x/a]*EllipticE[ArcSin[Sqrt[x]/Sqrt[a]], a/b])/(b^2*d*(a - x)*Sqrt[x]*Sqrt[1 - x/b]) + (2*
Sqrt[a]*Sqrt[(a - x)*(b - x)*x]*Sqrt[1 - x/a]*Sqrt[1 - x/b]*EllipticF[ArcSin[Sqrt[x]/Sqrt[a]], a/b])/(b*d*(a -
 x)*(b - x)*Sqrt[x]) + ((1 - 2*a*d + b*d + Sqrt[-4*a*d + (1 + b*d)^2])*Sqrt[(a - x)*(b - x)*x]*Defer[Int][Sqrt
[a - x]/((b - x)^(3/2)*x^(3/2)*(-1 - b*d - Sqrt[1 - 4*a*d + 2*b*d + b^2*d^2] + 2*d*x)), x])/(d*Sqrt[a - x]*Sqr
t[b - x]*Sqrt[x]) + ((1 - 2*a*d + b*d - Sqrt[-4*a*d + (1 + b*d)^2])*Sqrt[(a - x)*(b - x)*x]*Defer[Int][Sqrt[a
- x]/((b - x)^(3/2)*x^(3/2)*(-1 - b*d + Sqrt[1 - 4*a*d + 2*b*d + b^2*d^2] + 2*d*x)), x])/(d*Sqrt[a - x]*Sqrt[b
 - x]*Sqrt[x])

Rubi steps \begin{align*} \text {integral}& = \int \frac {\sqrt {(a-x) (b-x) x} \left (a b-2 a x+x^2\right )}{(b-x)^2 x^2 \left (a-(1+b d) x+d x^2\right )} \, dx \\ & = \frac {\sqrt {(a-x) (b-x) x} \int \frac {\sqrt {a-x} \left (a b-2 a x+x^2\right )}{(b-x)^{3/2} x^{3/2} \left (a-(1+b d) x+d x^2\right )} \, dx}{\sqrt {a-x} \sqrt {b-x} \sqrt {x}} \\ & = \frac {\sqrt {(a-x) (b-x) x} \int \left (\frac {\sqrt {a-x}}{d (b-x)^{3/2} x^{3/2}}-\frac {\sqrt {a-x} (a-a b d-(1-2 a d+b d) x)}{d (b-x)^{3/2} x^{3/2} \left (a+(-1-b d) x+d x^2\right )}\right ) \, dx}{\sqrt {a-x} \sqrt {b-x} \sqrt {x}} \\ & = \frac {\sqrt {(a-x) (b-x) x} \int \frac {\sqrt {a-x}}{(b-x)^{3/2} x^{3/2}} \, dx}{d \sqrt {a-x} \sqrt {b-x} \sqrt {x}}-\frac {\sqrt {(a-x) (b-x) x} \int \frac {\sqrt {a-x} (a-a b d-(1-2 a d+b d) x)}{(b-x)^{3/2} x^{3/2} \left (a+(-1-b d) x+d x^2\right )} \, dx}{d \sqrt {a-x} \sqrt {b-x} \sqrt {x}} \\ & = \frac {2 \sqrt {(a-x) (b-x) x}}{b d (b-x) x}-\frac {\sqrt {(a-x) (b-x) x} \int \left (\frac {\left (-1+2 a d-b d-\sqrt {-4 a d+(1+b d)^2}\right ) \sqrt {a-x}}{(b-x)^{3/2} x^{3/2} \left (-1-b d-\sqrt {1-4 a d+2 b d+b^2 d^2}+2 d x\right )}+\frac {\left (-1+2 a d-b d+\sqrt {-4 a d+(1+b d)^2}\right ) \sqrt {a-x}}{(b-x)^{3/2} x^{3/2} \left (-1-b d+\sqrt {1-4 a d+2 b d+b^2 d^2}+2 d x\right )}\right ) \, dx}{d \sqrt {a-x} \sqrt {b-x} \sqrt {x}}-\frac {\left (2 \sqrt {(a-x) (b-x) x}\right ) \int \frac {-a+\frac {x}{2}}{\sqrt {a-x} \sqrt {b-x} x^{3/2}} \, dx}{b d \sqrt {a-x} \sqrt {b-x} \sqrt {x}} \\ & = -\frac {4 \sqrt {(a-x) (b-x) x}}{b^2 d x}+\frac {2 \sqrt {(a-x) (b-x) x}}{b d (b-x) x}+\frac {\left (4 \sqrt {(a-x) (b-x) x}\right ) \int \frac {-\frac {a b}{4}+\frac {a x}{2}}{\sqrt {a-x} \sqrt {b-x} \sqrt {x}} \, dx}{a b^2 d \sqrt {a-x} \sqrt {b-x} \sqrt {x}}-\frac {\left (\left (-1+2 a d-b d-\sqrt {-4 a d+(1+b d)^2}\right ) \sqrt {(a-x) (b-x) x}\right ) \int \frac {\sqrt {a-x}}{(b-x)^{3/2} x^{3/2} \left (-1-b d-\sqrt {1-4 a d+2 b d+b^2 d^2}+2 d x\right )} \, dx}{d \sqrt {a-x} \sqrt {b-x} \sqrt {x}}-\frac {\left (\left (-1+2 a d-b d+\sqrt {-4 a d+(1+b d)^2}\right ) \sqrt {(a-x) (b-x) x}\right ) \int \frac {\sqrt {a-x}}{(b-x)^{3/2} x^{3/2} \left (-1-b d+\sqrt {1-4 a d+2 b d+b^2 d^2}+2 d x\right )} \, dx}{d \sqrt {a-x} \sqrt {b-x} \sqrt {x}} \\ & = -\frac {4 \sqrt {(a-x) (b-x) x}}{b^2 d x}+\frac {2 \sqrt {(a-x) (b-x) x}}{b d (b-x) x}-\frac {\left (2 \sqrt {(a-x) (b-x) x}\right ) \int \frac {\sqrt {b-x}}{\sqrt {a-x} \sqrt {x}} \, dx}{b^2 d \sqrt {a-x} \sqrt {b-x} \sqrt {x}}+\frac {\sqrt {(a-x) (b-x) x} \int \frac {1}{\sqrt {a-x} \sqrt {b-x} \sqrt {x}} \, dx}{b d \sqrt {a-x} \sqrt {b-x} \sqrt {x}}-\frac {\left (\left (-1+2 a d-b d-\sqrt {-4 a d+(1+b d)^2}\right ) \sqrt {(a-x) (b-x) x}\right ) \int \frac {\sqrt {a-x}}{(b-x)^{3/2} x^{3/2} \left (-1-b d-\sqrt {1-4 a d+2 b d+b^2 d^2}+2 d x\right )} \, dx}{d \sqrt {a-x} \sqrt {b-x} \sqrt {x}}-\frac {\left (\left (-1+2 a d-b d+\sqrt {-4 a d+(1+b d)^2}\right ) \sqrt {(a-x) (b-x) x}\right ) \int \frac {\sqrt {a-x}}{(b-x)^{3/2} x^{3/2} \left (-1-b d+\sqrt {1-4 a d+2 b d+b^2 d^2}+2 d x\right )} \, dx}{d \sqrt {a-x} \sqrt {b-x} \sqrt {x}} \\ & = -\frac {4 \sqrt {(a-x) (b-x) x}}{b^2 d x}+\frac {2 \sqrt {(a-x) (b-x) x}}{b d (b-x) x}-\frac {\left (\left (-1+2 a d-b d-\sqrt {-4 a d+(1+b d)^2}\right ) \sqrt {(a-x) (b-x) x}\right ) \int \frac {\sqrt {a-x}}{(b-x)^{3/2} x^{3/2} \left (-1-b d-\sqrt {1-4 a d+2 b d+b^2 d^2}+2 d x\right )} \, dx}{d \sqrt {a-x} \sqrt {b-x} \sqrt {x}}-\frac {\left (\left (-1+2 a d-b d+\sqrt {-4 a d+(1+b d)^2}\right ) \sqrt {(a-x) (b-x) x}\right ) \int \frac {\sqrt {a-x}}{(b-x)^{3/2} x^{3/2} \left (-1-b d+\sqrt {1-4 a d+2 b d+b^2 d^2}+2 d x\right )} \, dx}{d \sqrt {a-x} \sqrt {b-x} \sqrt {x}}-\frac {\left (2 \sqrt {(a-x) (b-x) x} \sqrt {1-\frac {x}{a}}\right ) \int \frac {\sqrt {1-\frac {x}{b}}}{\sqrt {x} \sqrt {1-\frac {x}{a}}} \, dx}{b^2 d (a-x) \sqrt {x} \sqrt {1-\frac {x}{b}}}+\frac {\left (\sqrt {(a-x) (b-x) 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}{b d (a-x) (b-x) \sqrt {x}} \\ & = -\frac {4 \sqrt {(a-x) (b-x) x}}{b^2 d x}+\frac {2 \sqrt {(a-x) (b-x) x}}{b d (b-x) x}-\frac {4 \sqrt {a} \sqrt {(a-x) (b-x) x} \sqrt {1-\frac {x}{a}} E\left (\arcsin \left (\frac {\sqrt {x}}{\sqrt {a}}\right )|\frac {a}{b}\right )}{b^2 d (a-x) \sqrt {x} \sqrt {1-\frac {x}{b}}}+\frac {2 \sqrt {a} \sqrt {(a-x) (b-x) 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 )}{b d (a-x) (b-x) \sqrt {x}}-\frac {\left (\left (-1+2 a d-b d-\sqrt {-4 a d+(1+b d)^2}\right ) \sqrt {(a-x) (b-x) x}\right ) \int \frac {\sqrt {a-x}}{(b-x)^{3/2} x^{3/2} \left (-1-b d-\sqrt {1-4 a d+2 b d+b^2 d^2}+2 d x\right )} \, dx}{d \sqrt {a-x} \sqrt {b-x} \sqrt {x}}-\frac {\left (\left (-1+2 a d-b d+\sqrt {-4 a d+(1+b d)^2}\right ) \sqrt {(a-x) (b-x) x}\right ) \int \frac {\sqrt {a-x}}{(b-x)^{3/2} x^{3/2} \left (-1-b d+\sqrt {1-4 a d+2 b d+b^2 d^2}+2 d x\right )} \, dx}{d \sqrt {a-x} \sqrt {b-x} \sqrt {x}} \\ \end{align*}

Mathematica [A] (verified)

Time = 14.29 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.74 \[ \int \frac {-a^2 b+a (2 a+b) x-3 a x^2+x^3}{x (-b+x) \sqrt {x (-a+x) (-b+x)} \left (a-(1+b d) x+d x^2\right )} \, dx=\frac {2 (-a+x)}{\sqrt {x (-a+x) (-b+x)}}-2 \sqrt {d} \text {arctanh}\left (\frac {-a+x}{\sqrt {d} \sqrt {x (-a+x) (-b+x)}}\right ) \]

[In]

Integrate[(-(a^2*b) + a*(2*a + b)*x - 3*a*x^2 + x^3)/(x*(-b + x)*Sqrt[x*(-a + x)*(-b + x)]*(a - (1 + b*d)*x +
d*x^2)),x]

[Out]

(2*(-a + x))/Sqrt[x*(-a + x)*(-b + x)] - 2*Sqrt[d]*ArcTanh[(-a + x)/(Sqrt[d]*Sqrt[x*(-a + x)*(-b + x)])]

Maple [C] (verified)

Result contains higher order function than in optimal. Order 4 vs. order 3.

Time = 3.91 (sec) , antiderivative size = 2557, normalized size of antiderivative = 31.96

method result size
elliptic \(\text {Expression too large to display}\) \(2557\)
risch \(\text {Expression too large to display}\) \(2838\)
default \(\text {Expression too large to display}\) \(2937\)

[In]

int((-a^2*b+a*(2*a+b)*x-3*a*x^2+x^3)/x/(-b+x)/(x*(-a+x)*(-b+x))^(1/2)/(a-(b*d+1)*x+d*x^2),x,method=_RETURNVERB
OSE)

[Out]

-2*(a*b-a*x-b*x+x^2)/b/(x*(a*b-a*x-b*x+x^2))^(1/2)+2*(-a*x+x^2)/b/((-b+x)*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-4*a*d+2*b*d+1)^(1/2)-1)/d),(b/(-a+b))^(1/2))/d-4/(b^2*d^2
-4*a*d+2*b*d+1)^(1/2)*b*(1-x/b)^(1/2)*(-1/(-a+b)*a+1/(-a+b)*x)^(1/2)*(x/b)^(1/2)/(a*b*x-a*x^2-b*x^2+x^3)^(1/2)
/(1/2*b+1/2/d*(b^2*d^2-4*a*d+2*b*d+1)^(1/2)-1/2/d)*EllipticPi((-(-b+x)/b)^(1/2),b/(b+1/2*(-d*b+(b^2*d^2-4*a*d+
2*b*d+1)^(1/2)-1)/d),(b/(-a+b))^(1/2))*a+1/(b^2*d^2-4*a*d+2*b*d+1)^(1/2)*b*(1-x/b)^(1/2)*(-1/(-a+b)*a+1/(-a+b)
*x)^(1/2)*(x/b)^(1/2)/(a*b*x-a*x^2-b*x^2+x^3)^(1/2)/(1/2*b+1/2/d*(b^2*d^2-4*a*d+2*b*d+1)^(1/2)-1/2/d)*Elliptic
Pi((-(-b+x)/b)^(1/2),b/(b+1/2*(-d*b+(b^2*d^2-4*a*d+2*b*d+1)^(1/2)-1)/d),(b/(-a+b))^(1/2))/d

Fricas [A] (verification not implemented)

none

Time = 0.48 (sec) , antiderivative size = 312, normalized size of antiderivative = 3.90 \[ \int \frac {-a^2 b+a (2 a+b) x-3 a x^2+x^3}{x (-b+x) \sqrt {x (-a+x) (-b+x)} \left (a-(1+b d) x+d x^2\right )} \, dx=\left [\frac {{\left (b x - x^{2}\right )} \sqrt {d} \log \left (\frac {d^{2} x^{4} - 2 \, {\left (b d^{2} - 3 \, d\right )} x^{3} + {\left (b^{2} d^{2} - 6 \, {\left (a + b\right )} d + 1\right )} x^{2} + a^{2} - 4 \, \sqrt {a b x - {\left (a + b\right )} x^{2} + x^{3}} {\left (d x^{2} - {\left (b d - 1\right )} x - a\right )} \sqrt {d} + 2 \, {\left (3 \, a b d - a\right )} x}{d^{2} x^{4} - 2 \, {\left (b d^{2} + d\right )} x^{3} + {\left (b^{2} d^{2} + 2 \, {\left (a + b\right )} d + 1\right )} x^{2} + a^{2} - 2 \, {\left (a b d + a\right )} x}\right ) - 4 \, \sqrt {a b x - {\left (a + b\right )} x^{2} + x^{3}}}{2 \, {\left (b x - x^{2}\right )}}, \frac {{\left (b x - x^{2}\right )} \sqrt {-d} \arctan \left (\frac {\sqrt {a b x - {\left (a + b\right )} x^{2} + x^{3}} {\left (d x^{2} - {\left (b d - 1\right )} x - a\right )} \sqrt {-d}}{2 \, {\left (a b d x - {\left (a + b\right )} d x^{2} + d x^{3}\right )}}\right ) - 2 \, \sqrt {a b x - {\left (a + b\right )} x^{2} + x^{3}}}{b x - x^{2}}\right ] \]

[In]

integrate((-a^2*b+a*(2*a+b)*x-3*a*x^2+x^3)/x/(-b+x)/(x*(-a+x)*(-b+x))^(1/2)/(a-(b*d+1)*x+d*x^2),x, algorithm="
fricas")

[Out]

[1/2*((b*x - x^2)*sqrt(d)*log((d^2*x^4 - 2*(b*d^2 - 3*d)*x^3 + (b^2*d^2 - 6*(a + b)*d + 1)*x^2 + a^2 - 4*sqrt(
a*b*x - (a + b)*x^2 + x^3)*(d*x^2 - (b*d - 1)*x - a)*sqrt(d) + 2*(3*a*b*d - a)*x)/(d^2*x^4 - 2*(b*d^2 + d)*x^3
 + (b^2*d^2 + 2*(a + b)*d + 1)*x^2 + a^2 - 2*(a*b*d + a)*x)) - 4*sqrt(a*b*x - (a + b)*x^2 + x^3))/(b*x - x^2),
 ((b*x - x^2)*sqrt(-d)*arctan(1/2*sqrt(a*b*x - (a + b)*x^2 + x^3)*(d*x^2 - (b*d - 1)*x - a)*sqrt(-d)/(a*b*d*x
- (a + b)*d*x^2 + d*x^3)) - 2*sqrt(a*b*x - (a + b)*x^2 + x^3))/(b*x - x^2)]

Sympy [F(-1)]

Timed out. \[ \int \frac {-a^2 b+a (2 a+b) x-3 a x^2+x^3}{x (-b+x) \sqrt {x (-a+x) (-b+x)} \left (a-(1+b d) x+d x^2\right )} \, dx=\text {Timed out} \]

[In]

integrate((-a**2*b+a*(2*a+b)*x-3*a*x**2+x**3)/x/(-b+x)/(x*(-a+x)*(-b+x))**(1/2)/(a-(b*d+1)*x+d*x**2),x)

[Out]

Timed out

Maxima [F]

\[ \int \frac {-a^2 b+a (2 a+b) x-3 a x^2+x^3}{x (-b+x) \sqrt {x (-a+x) (-b+x)} \left (a-(1+b d) x+d x^2\right )} \, dx=\int { \frac {a^{2} b - {\left (2 \, a + b\right )} a x + 3 \, a x^{2} - x^{3}}{\sqrt {{\left (a - x\right )} {\left (b - x\right )} x} {\left (d x^{2} - {\left (b d + 1\right )} x + a\right )} {\left (b - x\right )} x} \,d x } \]

[In]

integrate((-a^2*b+a*(2*a+b)*x-3*a*x^2+x^3)/x/(-b+x)/(x*(-a+x)*(-b+x))^(1/2)/(a-(b*d+1)*x+d*x^2),x, algorithm="
maxima")

[Out]

integrate((a^2*b - (2*a + b)*a*x + 3*a*x^2 - x^3)/(sqrt((a - x)*(b - x)*x)*(d*x^2 - (b*d + 1)*x + a)*(b - x)*x
), x)

Giac [F]

\[ \int \frac {-a^2 b+a (2 a+b) x-3 a x^2+x^3}{x (-b+x) \sqrt {x (-a+x) (-b+x)} \left (a-(1+b d) x+d x^2\right )} \, dx=\int { \frac {a^{2} b - {\left (2 \, a + b\right )} a x + 3 \, a x^{2} - x^{3}}{\sqrt {{\left (a - x\right )} {\left (b - x\right )} x} {\left (d x^{2} - {\left (b d + 1\right )} x + a\right )} {\left (b - x\right )} x} \,d x } \]

[In]

integrate((-a^2*b+a*(2*a+b)*x-3*a*x^2+x^3)/x/(-b+x)/(x*(-a+x)*(-b+x))^(1/2)/(a-(b*d+1)*x+d*x^2),x, algorithm="
giac")

[Out]

integrate((a^2*b - (2*a + b)*a*x + 3*a*x^2 - x^3)/(sqrt((a - x)*(b - x)*x)*(d*x^2 - (b*d + 1)*x + a)*(b - x)*x
), x)

Mupad [B] (verification not implemented)

Time = 5.69 (sec) , antiderivative size = 628, normalized size of antiderivative = 7.85 \[ \int \frac {-a^2 b+a (2 a+b) x-3 a x^2+x^3}{x (-b+x) \sqrt {x (-a+x) (-b+x)} \left (a-(1+b d) x+d x^2\right )} \, dx=\frac {2\,a\,\left (\frac {\mathrm {E}\left (\mathrm {asin}\left (\sqrt {\frac {b-x}{b}}\right )\middle |-\frac {b}{a-b}\right )-\frac {\sqrt {\frac {b-x}{a-b}+1}\,\sqrt {\frac {b-x}{b}}}{\sqrt {1-\frac {b-x}{b}}}}{\frac {b}{a-b}+1}-\mathrm {F}\left (\mathrm {asin}\left (\sqrt {\frac {b-x}{b}}\right )\middle |-\frac {b}{a-b}\right )\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 {b\,\sqrt {\frac {x}{b}}\,\sqrt {\frac {b-x}{b}}\,\sqrt {\frac {a-x}{a-b}}\,\Pi \left (\frac {b}{b-\frac {b\,d-\sqrt {b^2\,d^2+2\,b\,d-4\,a\,d+1}+1}{2\,d}};\mathrm {asin}\left (\sqrt {\frac {b-x}{b}}\right )\middle |-\frac {b}{a-b}\right )\,\left (2\,a\,d-b\,d+\sqrt {b^2\,d^2+2\,b\,d-4\,a\,d+1}-1\right )}{d\,\left (b-\frac {b\,d-\sqrt {b^2\,d^2+2\,b\,d-4\,a\,d+1}+1}{2\,d}\right )\,\sqrt {x^3+\left (-a-b\right )\,x^2+a\,b\,x}}+\frac {2\,a\,\left (a-b\right )\,\sqrt {\frac {x}{a}}\,\left (\mathrm {E}\left (\mathrm {asin}\left (\sqrt {\frac {x}{a}}\right )\middle |\frac {a}{b}\right )-\frac {a\,\sin \left (2\,\mathrm {asin}\left (\sqrt {\frac {x}{a}}\right )\right )}{2\,b\,\sqrt {1-\frac {x}{b}}}\right )\,\sqrt {\frac {a-x}{a}}\,\sqrt {\frac {b-x}{b}}}{b\,\left (\frac {a}{b}-1\right )\,\sqrt {x^3+\left (-a-b\right )\,x^2+a\,b\,x}}-\frac {b\,\sqrt {\frac {x}{b}}\,\sqrt {\frac {b-x}{b}}\,\sqrt {\frac {a-x}{a-b}}\,\Pi \left (\frac {b}{b-\frac {b\,d+\sqrt {b^2\,d^2+2\,b\,d-4\,a\,d+1}+1}{2\,d}};\mathrm {asin}\left (\sqrt {\frac {b-x}{b}}\right )\middle |-\frac {b}{a-b}\right )\,\left (b\,d-2\,a\,d+\sqrt {b^2\,d^2+2\,b\,d-4\,a\,d+1}+1\right )}{d\,\left (b-\frac {b\,d+\sqrt {b^2\,d^2+2\,b\,d-4\,a\,d+1}+1}{2\,d}\right )\,\sqrt {x^3+\left (-a-b\right )\,x^2+a\,b\,x}} \]

[In]

int((a^2*b + 3*a*x^2 - x^3 - a*x*(2*a + b))/(x*(b - x)*(x*(a - x)*(b - x))^(1/2)*(a - x*(b*d + 1) + d*x^2)),x)

[Out]

(2*a*((ellipticE(asin(((b - x)/b)^(1/2)), -b/(a - b)) - (((b - x)/(a - b) + 1)^(1/2)*((b - x)/b)^(1/2))/(1 - (
b - x)/b)^(1/2))/(b/(a - b) + 1) - ellipticF(asin(((b - x)/b)^(1/2)), -b/(a - b)))*(x/b)^(1/2)*((b - x)/b)^(1/
2)*((a - x)/(a - b))^(1/2))/(x^3 - x^2*(a + b) + a*b*x)^(1/2) + (b*(x/b)^(1/2)*((b - x)/b)^(1/2)*((a - x)/(a -
 b))^(1/2)*ellipticPi(b/(b - (b*d - (2*b*d - 4*a*d + b^2*d^2 + 1)^(1/2) + 1)/(2*d)), asin(((b - x)/b)^(1/2)),
-b/(a - b))*(2*a*d - b*d + (2*b*d - 4*a*d + b^2*d^2 + 1)^(1/2) - 1))/(d*(b - (b*d - (2*b*d - 4*a*d + b^2*d^2 +
 1)^(1/2) + 1)/(2*d))*(x^3 - x^2*(a + b) + a*b*x)^(1/2)) + (2*a*(a - b)*(x/a)^(1/2)*(ellipticE(asin((x/a)^(1/2
)), a/b) - (a*sin(2*asin((x/a)^(1/2))))/(2*b*(1 - x/b)^(1/2)))*((a - x)/a)^(1/2)*((b - x)/b)^(1/2))/(b*(a/b -
1)*(x^3 - x^2*(a + b) + a*b*x)^(1/2)) - (b*(x/b)^(1/2)*((b - x)/b)^(1/2)*((a - x)/(a - b))^(1/2)*ellipticPi(b/
(b - (b*d + (2*b*d - 4*a*d + b^2*d^2 + 1)^(1/2) + 1)/(2*d)), asin(((b - x)/b)^(1/2)), -b/(a - b))*(b*d - 2*a*d
 + (2*b*d - 4*a*d + b^2*d^2 + 1)^(1/2) + 1))/(d*(b - (b*d + (2*b*d - 4*a*d + b^2*d^2 + 1)^(1/2) + 1)/(2*d))*(x
^3 - x^2*(a + b) + a*b*x)^(1/2))