\(\int \frac {1}{\sqrt {c+b x+a x^2}} \, dx\) [428]

   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 [B] (verification not implemented)

Optimal result

Integrand size = 14, antiderivative size = 35 \[ \int \frac {1}{\sqrt {c+b x+a x^2}} \, dx=-\frac {\log \left (b+2 a x-2 \sqrt {a} \sqrt {c+b x+a x^2}\right )}{\sqrt {a}} \]

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.03, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {635, 212} \[ \int \frac {1}{\sqrt {c+b x+a x^2}} \, dx=\frac {\text {arctanh}\left (\frac {2 a x+b}{2 \sqrt {a} \sqrt {a x^2+b x+c}}\right )}{\sqrt {a}} \]

[In]

Int[1/Sqrt[c + b*x + a*x^2],x]

[Out]

ArcTanh[(b + 2*a*x)/(2*Sqrt[a]*Sqrt[c + b*x + a*x^2])]/Sqrt[a]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[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]

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

Mathematica [A] (verified)

Time = 0.09 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.00 \[ \int \frac {1}{\sqrt {c+b x+a x^2}} \, dx=-\frac {\log \left (b+2 a x-2 \sqrt {a} \sqrt {c+b x+a x^2}\right )}{\sqrt {a}} \]

[In]

Integrate[1/Sqrt[c + b*x + a*x^2],x]

[Out]

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

Maple [A] (verified)

Time = 1.50 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.86

method result size
default \(\frac {\ln \left (\frac {\frac {b}{2}+a x}{\sqrt {a}}+\sqrt {a \,x^{2}+b x +c}\right )}{\sqrt {a}}\) \(30\)

[In]

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

[Out]

ln((1/2*b+a*x)/a^(1/2)+(a*x^2+b*x+c)^(1/2))/a^(1/2)

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 85 vs. \(2 (34) = 68\).

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

[In]

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

[Out]

Piecewise((log(2*sqrt(a)*sqrt(a*x**2 + b*x + c) + 2*a*x + b)/sqrt(a), Ne(a, 0) & Ne(c - b**2/(4*a), 0)), ((x +
 b/(2*a))*log(x + b/(2*a))/sqrt(a*(x + b/(2*a))**2), Ne(a, 0)), (2*sqrt(b*x + c)/b, Ne(b, 0)), (x/sqrt(c), Tru
e))

Maxima [F(-2)]

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

[In]

integrate(1/(a*x^2+b*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(4*a*c-b^2>0)', see `assume?` f
or more deta

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 66 vs. \(2 (29) = 58\).

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 5.34 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.83 \[ \int \frac {1}{\sqrt {c+b x+a x^2}} \, dx=\frac {\ln \left (\frac {\frac {b}{2}+a\,x}{\sqrt {a}}+\sqrt {a\,x^2+b\,x+c}\right )}{\sqrt {a}} \]

[In]

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

[Out]

log((b/2 + a*x)/a^(1/2) + (c + b*x + a*x^2)^(1/2))/a^(1/2)