\(\int \frac {1}{\sqrt {(a+b x) (c-d x)}} \, dx\) [956]

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

Optimal result

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

[Out]

-arctan(1/2*(-2*b*d*x-a*d+b*c)/b^(1/2)/d^(1/2)/(a*c+(-a*d+b*c)*x-b*d*x^2)^(1/2))/b^(1/2)/d^(1/2)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {1976, 635, 210} \[ \int \frac {1}{\sqrt {(a+b x) (c-d x)}} \, dx=-\frac {\arctan \left (\frac {-a d+b c-2 b d x}{2 \sqrt {b} \sqrt {d} \sqrt {x (b c-a d)+a c-b d x^2}}\right )}{\sqrt {b} \sqrt {d}} \]

[In]

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

[Out]

-(ArcTan[(b*c - a*d - 2*b*d*x)/(2*Sqrt[b]*Sqrt[d]*Sqrt[a*c + (b*c - a*d)*x - b*d*x^2])]/(Sqrt[b]*Sqrt[d]))

Rule 210

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 635

Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(4*c - x^2), x], x, (b + 2*c*x)
/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 1976

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] /; FreeQ[{a, b, c, d, e, n, p}, x]

Rubi steps \begin{align*} \text {integral}& = \int \frac {1}{\sqrt {a c+(b c-a d) x-b d x^2}} \, dx \\ & = 2 \text {Subst}\left (\int \frac {1}{-4 b d-x^2} \, dx,x,\frac {b c-a d-2 b d x}{\sqrt {a c+(b c-a d) x-b d x^2}}\right ) \\ & = -\frac {\tan ^{-1}\left (\frac {b c-a d-2 b d x}{2 \sqrt {b} \sqrt {d} \sqrt {a c+(b c-a d) x-b d x^2}}\right )}{\sqrt {b} \sqrt {d}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.09 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.20 \[ \int \frac {1}{\sqrt {(a+b x) (c-d x)}} \, dx=-\frac {2 \sqrt {a+b x} \sqrt {c-d x} \arctan \left (\frac {\sqrt {b} \sqrt {c-d x}}{\sqrt {d} \sqrt {a+b x}}\right )}{\sqrt {b} \sqrt {d} \sqrt {(a+b x) (c-d x)}} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 1.18 (sec) , antiderivative size = 55, normalized size of antiderivative = 0.85

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

[In]

int(1/((b*x+a)*(-d*x+c))^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/(b*d)^(1/2)*arctan((b*d)^(1/2)*(x-1/2*(-a*d+b*c)/b/d)/(a*c+(-a*d+b*c)*x-b*d*x^2)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 202, normalized size of antiderivative = 3.11 \[ \int \frac {1}{\sqrt {(a+b x) (c-d x)}} \, dx=\left [-\frac {\sqrt {-b d} \log \left (8 \, b^{2} d^{2} x^{2} + b^{2} c^{2} - 6 \, a b c d + a^{2} d^{2} - 4 \, \sqrt {-b d x^{2} + a c + {\left (b c - a d\right )} x} {\left (2 \, b d x - b c + a d\right )} \sqrt {-b d} - 8 \, {\left (b^{2} c d - a b d^{2}\right )} x\right )}{2 \, b d}, -\frac {\sqrt {b d} \arctan \left (\frac {\sqrt {-b d x^{2} + a c + {\left (b c - a d\right )} x} {\left (2 \, b d x - b c + a d\right )} \sqrt {b d}}{2 \, {\left (b^{2} d^{2} x^{2} - a b c d - {\left (b^{2} c d - a b d^{2}\right )} x\right )}}\right )}{b d}\right ] \]

[In]

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

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 162 vs. \(2 (60) = 120\).

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

[In]

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

[Out]

Piecewise((log(-a*d + b*c - 2*b*d*x + 2*sqrt(-b*d)*sqrt(a*c - b*d*x**2 + x*(-a*d + b*c)))/sqrt(-b*d), Ne(b*d,
0) & Ne(a*c + (a*d - b*c)**2/(4*b*d), 0)), ((x + (a*d - b*c)/(2*b*d))*log(x + (a*d - b*c)/(2*b*d))/sqrt(-b*d*(
x + (a*d - b*c)/(2*b*d))**2), Ne(b*d, 0)), (2*sqrt(a*c + x*(-a*d + b*c))/(-a*d + b*c), Ne(a*d - b*c, 0)), (x/s
qrt(a*c), True))

Maxima [F(-2)]

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

[In]

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

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(a*d-b*c>0)', see `assume?` for
 more detail

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 131 vs. \(2 (53) = 106\).

Time = 0.32 (sec) , antiderivative size = 131, normalized size of antiderivative = 2.02 \[ \int \frac {1}{\sqrt {(a+b x) (c-d x)}} \, dx=\frac {1}{4} \, \sqrt {-b d x^{2} + b c x - a d x + a c} {\left (2 \, x - \frac {b c - a d}{b d}\right )} - \frac {{\left (b^{2} c^{2} + 2 \, a b c d + a^{2} d^{2}\right )} \log \left ({\left | -b c + a d - 2 \, \sqrt {-b d} {\left (\sqrt {-b d} x - \sqrt {-b d x^{2} + b c x - a d x + a c}\right )} \right |}\right )}{8 \, \sqrt {-b d} b d} \]

[In]

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

[Out]

1/4*sqrt(-b*d*x^2 + b*c*x - a*d*x + a*c)*(2*x - (b*c - a*d)/(b*d)) - 1/8*(b^2*c^2 + 2*a*b*c*d + a^2*d^2)*log(a
bs(-b*c + a*d - 2*sqrt(-b*d)*(sqrt(-b*d)*x - sqrt(-b*d*x^2 + b*c*x - a*d*x + a*c))))/(sqrt(-b*d)*b*d)

Mupad [F(-1)]

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

[In]

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

[Out]

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