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

3.6.66.1 Optimal result
3.6.66.2 Mathematica [A] (verified)
3.6.66.3 Rubi [F]
3.6.66.4 Maple [C] (verified)
3.6.66.5 Fricas [B] (verification not implemented)
3.6.66.6 Sympy [F(-1)]
3.6.66.7 Maxima [F(-2)]
3.6.66.8 Giac [F]
3.6.66.9 Mupad [B] (verification not implemented)

3.6.66.1 Optimal result

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

output
2*arctanh((a*b*x+(-a-b)*x^2+x^3)^(1/2)/d^(1/2)/(a-x))/d^(1/2)
 
3.6.66.2 Mathematica [A] (verified)

Time = 15.24 (sec) , antiderivative size = 37, normalized size of antiderivative = 0.84 \[ \int \frac {a b-2 a x+x^2}{\sqrt {x (-a+x) (-b+x)} \left (a d-(b+d) x+x^2\right )} \, dx=\frac {2 \text {arctanh}\left (\frac {\sqrt {x (-a+x) (-b+x)}}{\sqrt {d} (a-x)}\right )}{\sqrt {d}} \]

input
Integrate[(a*b - 2*a*x + x^2)/(Sqrt[x*(-a + x)*(-b + x)]*(a*d - (b + d)*x 
+ x^2)),x]
 
output
(2*ArcTanh[Sqrt[x*(-a + x)*(-b + x)]/(Sqrt[d]*(a - x))])/Sqrt[d]
 
3.6.66.3 Rubi [F]

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 {a b-2 a x+x^2}{\sqrt {x (x-a) (x-b)} \left (a d-x (b+d)+x^2\right )} \, dx\)

\(\Big \downarrow \) 2467

\(\displaystyle \frac {\sqrt {x} \sqrt {-x (a+b)+a b+x^2} \int \frac {x^2-2 a x+a b}{\sqrt {x} \sqrt {x^2-(a+b) x+a b} \left (x^2-(b+d) x+a d\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 {x^2-2 a x+a b}{\sqrt {x^2-(a+b) x+a b} \left (x^2-(b+d) x+a d\right )}d\sqrt {x}}{\sqrt {x (a-x) (b-x)}}\)

\(\Big \downarrow \) 7279

\(\displaystyle \frac {2 \sqrt {x} \sqrt {-x (a+b)+a b+x^2} \int \left (\frac {a (b-d)-(2 a-b-d) x}{\sqrt {x^2-(a+b) x+a b} \left (x^2+(-b-d) x+a d\right )}+\frac {1}{\sqrt {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 {a (b-d)-(2 a-b-d) x}{\sqrt {x^2-(a+b) x+a b} \left (x^2-(b+d) x+a d\right )}+\frac {1}{\sqrt {x^2-(a+b) x+a b}}\right )d\sqrt {x}}{\sqrt {x (a-x) (b-x)}}\)

\(\Big \downarrow \) 7299

\(\displaystyle \frac {2 \sqrt {x} \sqrt {-x (a+b)+a b+x^2} \int \left (\frac {a (b-d)-(2 a-b-d) x}{\sqrt {x^2-(a+b) x+a b} \left (x^2-(b+d) x+a d\right )}+\frac {1}{\sqrt {x^2-(a+b) x+a b}}\right )d\sqrt {x}}{\sqrt {x (a-x) (b-x)}}\)

input
Int[(a*b - 2*a*x + x^2)/(Sqrt[x*(-a + x)*(-b + x)]*(a*d - (b + d)*x + x^2) 
),x]
 
output
$Aborted
 

3.6.66.3.1 Defintions of rubi rules used

rule 2035
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]
 

rule 2467
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]
 

rule 7279
Int[(u_)/((a_.) + (b_.)*(x_)^(n_.) + (c_.)*(x_)^(n2_.)), x_Symbol] :> With[ 
{v = RationalFunctionExpand[u/(a + b*x^n + c*x^(2*n)), x]}, Int[v, x] /; Su 
mQ[v]] /; FreeQ[{a, b, c}, x] && EqQ[n2, 2*n] && IGtQ[n, 0]
 

rule 7293
Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v] 
]
 

rule 7299
Int[u_, x_] :> CannotIntegrate[u, x]
 
3.6.66.4 Maple [C] (verified)

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

Time = 1.45 (sec) , antiderivative size = 2291, normalized size of antiderivative = 52.07

method result size
default \(\text {Expression too large to display}\) \(2291\)
elliptic \(\text {Expression too large to display}\) \(2296\)

input
int((a*b-2*a*x+x^2)/(x*(-a+x)*(-b+x))^(1/2)/(a*d-(b+d)*x+x^2),x,method=_RE 
TURNVERBOSE)
 
output
-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))+4/(-4*a*d+b^2+2 
*b*d+d^2)^(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/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+b^2+2*b*d+d^2)^(1/2))*EllipticPi((-(-b+x)/b)^(1/ 
2),b/(1/2*b-1/2*d-1/2*(-4*a*d+b^2+2*b*d+d^2)^(1/2)),(b/(-a+b))^(1/2))-1/(- 
4*a*d+b^2+2*b*d+d^2)^(1/2)*b*(1-x/b)^(1/2)*(-1/(-a+b)*a+1/(-a+b)*x)^(1/...
 
3.6.66.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 73 vs. \(2 (35) = 70\).

Time = 0.41 (sec) , antiderivative size = 224, normalized size of antiderivative = 5.09 \[ \int \frac {a b-2 a x+x^2}{\sqrt {x (-a+x) (-b+x)} \left (a d-(b+d) x+x^2\right )} \, dx=\left [\frac {\log \left (\frac {a^{2} d^{2} - 2 \, {\left (b - 3 \, d\right )} x^{3} + x^{4} + {\left (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 d + {\left (b - d\right )} x - x^{2}\right )} \sqrt {d} + 2 \, {\left (3 \, a b d - a d^{2}\right )} x}{a^{2} d^{2} - 2 \, {\left (b + d\right )} x^{3} + x^{4} + {\left (b^{2} + 2 \, {\left (a + b\right )} d + d^{2}\right )} x^{2} - 2 \, {\left (a b d + a d^{2}\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 d + {\left (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 ] \]

input
integrate((a*b-2*a*x+x^2)/(x*(-a+x)*(-b+x))^(1/2)/(a*d-(b+d)*x+x^2),x, alg 
orithm="fricas")
 
output
[1/2*log((a^2*d^2 - 2*(b - 3*d)*x^3 + x^4 + (b^2 - 6*(a + b)*d + d^2)*x^2 
+ 4*sqrt(a*b*x - (a + b)*x^2 + x^3)*(a*d + (b - d)*x - x^2)*sqrt(d) + 2*(3 
*a*b*d - a*d^2)*x)/(a^2*d^2 - 2*(b + d)*x^3 + x^4 + (b^2 + 2*(a + b)*d + d 
^2)*x^2 - 2*(a*b*d + a*d^2)*x))/sqrt(d), sqrt(-d)*arctan(-1/2*sqrt(a*b*x - 
 (a + b)*x^2 + x^3)*(a*d + (b - d)*x - x^2)*sqrt(-d)/(a*b*d*x - (a + b)*d* 
x^2 + d*x^3))/d]
 
3.6.66.6 Sympy [F(-1)]

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

input
integrate((a*b-2*a*x+x**2)/(x*(-a+x)*(-b+x))**(1/2)/(a*d-(b+d)*x+x**2),x)
 
output
Timed out
 
3.6.66.7 Maxima [F(-2)]

Exception generated. \[ \int \frac {a b-2 a x+x^2}{\sqrt {x (-a+x) (-b+x)} \left (a d-(b+d) x+x^2\right )} \, dx=\text {Exception raised: ValueError} \]

input
integrate((a*b-2*a*x+x^2)/(x*(-a+x)*(-b+x))^(1/2)/(a*d-(b+d)*x+x^2),x, alg 
orithm="maxima")
 
output
Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume((d+b)^2-4*a*d>0)', see `assume?` 
 for more
 
3.6.66.8 Giac [F]

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

input
integrate((a*b-2*a*x+x^2)/(x*(-a+x)*(-b+x))^(1/2)/(a*d-(b+d)*x+x^2),x, alg 
orithm="giac")
 
output
integrate((a*b - 2*a*x + x^2)/(sqrt((a - x)*(b - x)*x)*(a*d - (b + d)*x + 
x^2)), x)
 
3.6.66.9 Mupad [B] (verification not implemented)

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

input
int((a*b - 2*a*x + x^2)/((x*(a - x)*(b - x))^(1/2)*(a*d + x^2 - x*(b + d)) 
),x)
 
output
(2*b*(x/b)^(1/2)*((b - x)/b)^(1/2)*((a - x)/(a - b))^(1/2)*ellipticPi(b/(b 
/2 - d/2 + (2*b*d - 4*a*d + b^2 + d^2)^(1/2)/2), asin(((b - x)/b)^(1/2)), 
-b/(a - b))*((b/2 + d/2 - (2*b*d - 4*a*d + b^2 + d^2)^(1/2)/2)*(b - 2*a + 
d) + a*b - a*d))/((x^3 - x^2*(a + b) + a*b*x)^(1/2)*(b/2 - d/2 + (2*b*d - 
4*a*d + b^2 + d^2)^(1/2)/2)*(2*b*d - 4*a*d + b^2 + d^2)^(1/2)) - (2*b*elli 
pticF(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) + (2*b*(x/b)^(1/ 
2)*((b - x)/b)^(1/2)*((a - x)/(a - b))^(1/2)*ellipticPi(-b/(d/2 - b/2 + (2 
*b*d - 4*a*d + b^2 + d^2)^(1/2)/2), asin(((b - x)/b)^(1/2)), -b/(a - b))*( 
(b/2 + d/2 + (2*b*d - 4*a*d + b^2 + d^2)^(1/2)/2)*(b - 2*a + d) + a*b - a* 
d))/((x^3 - x^2*(a + b) + a*b*x)^(1/2)*(d/2 - b/2 + (2*b*d - 4*a*d + b^2 + 
 d^2)^(1/2)/2)*(2*b*d - 4*a*d + b^2 + d^2)^(1/2))