3.2.5 \(\int \frac {1}{\sqrt {(b-x) (-a+x)}} \, dx\) [105]

3.2.5.1 Optimal result
3.2.5.2 Mathematica [A] (verified)
3.2.5.3 Rubi [A] (verified)
3.2.5.4 Maple [A] (verified)
3.2.5.5 Fricas [A] (verification not implemented)
3.2.5.6 Sympy [C] (verification not implemented)
3.2.5.7 Maxima [F(-2)]
3.2.5.8 Giac [B] (verification not implemented)
3.2.5.9 Mupad [F(-1)]
3.2.5.10 Reduce [B] (verification not implemented)

3.2.5.1 Optimal result

Integrand size = 15, antiderivative size = 32 \[ \int \frac {1}{\sqrt {(b-x) (-a+x)}} \, dx=-\arctan \left (\frac {a+b-2 x}{2 \sqrt {-a b+(a+b) x-x^2}}\right ) \]

output
-arctan(1/2*(a+b-2*x)/(-a*b+(a+b)*x-x^2)^(1/2))
 
3.2.5.2 Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.72 \[ \int \frac {1}{\sqrt {(b-x) (-a+x)}} \, dx=\frac {2 \sqrt {b-x} \sqrt {-a+x} \arctan \left (\frac {\sqrt {-a+x}}{\sqrt {b-x}}\right )}{\sqrt {(a-x) (-b+x)}} \]

input
Integrate[1/Sqrt[(b - x)*(-a + x)],x]
 
output
(2*Sqrt[b - x]*Sqrt[-a + x]*ArcTan[Sqrt[-a + x]/Sqrt[b - x]])/Sqrt[(a - x) 
*(-b + x)]
 
3.2.5.3 Rubi [A] (verified)

Time = 0.14 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {2048, 1092, 217}

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 {1}{\sqrt {(x-a) (b-x)}} \, dx\)

\(\Big \downarrow \) 2048

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

\(\Big \downarrow \) 1092

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

\(\Big \downarrow \) 217

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

input
Int[1/Sqrt[(b - x)*(-a + x)],x]
 
output
-ArcTan[(a + b - 2*x)/(2*Sqrt[-(a*b) + (a + b)*x - x^2])]
 

3.2.5.3.1 Defintions of rubi rules used

rule 217
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^( 
-1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] & 
& (LtQ[a, 0] || LtQ[b, 0])
 

rule 1092
Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Simp[2   Subst[I 
nt[1/(4*c - x^2), x], x, (b + 2*c*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a 
, b, c}, x]
 

rule 2048
Int[(u_.)*((e_.)*((a_.) + (b_.)*(x_)^(n_.))*((c_) + (d_.)*(x_)^(n_.)))^(p_) 
, x_Symbol] :> Int[u*(a*c*e + (b*c + a*d)*e*x^n + b*d*e*x^(2*n))^p, x] /; F 
reeQ[{a, b, c, d, e, n, p}, x]
 
3.2.5.4 Maple [A] (verified)

Time = 0.11 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.88

method result size
default \(\arctan \left (\frac {x -\frac {b}{2}-\frac {a}{2}}{\sqrt {-a b +\left (a +b \right ) x -x^{2}}}\right )\) \(28\)

input
int(1/((b-x)*(-a+x))^(1/2),x,method=_RETURNVERBOSE)
 
output
arctan((x-1/2*b-1/2*a)/(-a*b+(a+b)*x-x^2)^(1/2))
 
3.2.5.5 Fricas [A] (verification not implemented)

Time = 0.25 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.34 \[ \int \frac {1}{\sqrt {(b-x) (-a+x)}} \, dx=-\arctan \left (-\frac {\sqrt {-a b + {\left (a + b\right )} x - x^{2}} {\left (a + b - 2 \, x\right )}}{2 \, {\left (a b - {\left (a + b\right )} x + x^{2}\right )}}\right ) \]

input
integrate(1/((b-x)*(-a+x))^(1/2),x, algorithm="fricas")
 
output
-arctan(-1/2*sqrt(-a*b + (a + b)*x - x^2)*(a + b - 2*x)/(a*b - (a + b)*x + 
 x^2))
 
3.2.5.6 Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.90 (sec) , antiderivative size = 71, normalized size of antiderivative = 2.22 \[ \int \frac {1}{\sqrt {(b-x) (-a+x)}} \, dx=\begin {cases} - i \log {\left (a + b - 2 x + 2 i \sqrt {- a b - x^{2} + x \left (a + b\right )} \right )} & \text {for}\: a b - \frac {\left (a + b\right )^{2}}{4} \neq 0 \\\frac {\left (- \frac {a}{2} - \frac {b}{2} + x\right ) \log {\left (- \frac {a}{2} - \frac {b}{2} + x \right )}}{\sqrt {- \left (- \frac {a}{2} - \frac {b}{2} + x\right )^{2}}} & \text {otherwise} \end {cases} \]

input
integrate(1/((b-x)*(-a+x))**(1/2),x)
 
output
Piecewise((-I*log(a + b - 2*x + 2*I*sqrt(-a*b - x**2 + x*(a + b))), Ne(a*b 
 - (a + b)**2/4, 0)), ((-a/2 - b/2 + x)*log(-a/2 - b/2 + x)/sqrt(-(-a/2 - 
b/2 + x)**2), True))
 
3.2.5.7 Maxima [F(-2)]

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

input
integrate(1/((b-x)*(-a+x))^(1/2),x, algorithm="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(b-a>0)', see `assume?` for more 
details)Is
 
3.2.5.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 61 vs. \(2 (28) = 56\).

Time = 0.31 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.91 \[ \int \frac {1}{\sqrt {(b-x) (-a+x)}} \, dx=\frac {1}{8} \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \arcsin \left (\frac {a + b - 2 \, x}{a - b}\right ) \mathrm {sgn}\left (-a + b\right ) - \frac {1}{4} \, \sqrt {-a b + a x + b x - x^{2}} {\left (a + b - 2 \, x\right )} \]

input
integrate(1/((b-x)*(-a+x))^(1/2),x, algorithm="giac")
 
output
1/8*(a^2 - 2*a*b + b^2)*arcsin((a + b - 2*x)/(a - b))*sgn(-a + b) - 1/4*sq 
rt(-a*b + a*x + b*x - x^2)*(a + b - 2*x)
 
3.2.5.9 Mupad [F(-1)]

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

input
int(1/(-(a - x)*(b - x))^(1/2),x)
 
output
int(1/(-(a - x)*(b - x))^(1/2), x)
 
3.2.5.10 Reduce [B] (verification not implemented)

Time = 0.00 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.62 \[ \int \frac {1}{\sqrt {(b-x) (-a+x)}} \, dx=-2 \mathit {asinh} \left (\frac {\sqrt {-a +x}\, i}{\sqrt {-a +b}}\right ) i \]

input
int(1/sqrt( - a*b + a*x + b*x - x**2),x)
 
output
 - 2*asinh((sqrt( - a + x)*i)/sqrt( - a + b))*i