\(\int \frac {1}{\sqrt {x+x^2}} \, dx\) [154]

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

Optimal result

Integrand size = 9, antiderivative size = 14 \[ \int \frac {1}{\sqrt {x+x^2}} \, dx=2 \text {arctanh}\left (\frac {x}{\sqrt {x+x^2}}\right ) \]

[Out]

2*arctanh(x/(x^2+x)^(1/2))

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {634, 212} \[ \int \frac {1}{\sqrt {x+x^2}} \, dx=2 \text {arctanh}\left (\frac {x}{\sqrt {x^2+x}}\right ) \]

[In]

Int[1/Sqrt[x + x^2],x]

[Out]

2*ArcTanh[x/Sqrt[x + x^2]]

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 634

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

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(39\) vs. \(2(14)=28\).

Time = 0.02 (sec) , antiderivative size = 39, normalized size of antiderivative = 2.79 \[ \int \frac {1}{\sqrt {x+x^2}} \, dx=-\frac {2 \sqrt {x} \sqrt {1+x} \log \left (-\sqrt {x}+\sqrt {1+x}\right )}{\sqrt {x (1+x)}} \]

[In]

Integrate[1/Sqrt[x + x^2],x]

[Out]

(-2*Sqrt[x]*Sqrt[1 + x]*Log[-Sqrt[x] + Sqrt[1 + x]])/Sqrt[x*(1 + x)]

Maple [A] (verified)

Time = 0.08 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.50

method result size
meijerg \(2 \,\operatorname {arcsinh}\left (\sqrt {x}\right )\) \(7\)
default \(\ln \left (x +\frac {1}{2}+\sqrt {x^{2}+x}\right )\) \(12\)
pseudoelliptic \(2 \,\operatorname {arctanh}\left (\frac {\sqrt {x \left (1+x \right )}}{x}\right )\) \(15\)
trager \(\ln \left (1+2 x +2 \sqrt {x^{2}+x}\right )\) \(16\)

[In]

int(1/(x^2+x)^(1/2),x,method=_RETURNVERBOSE)

[Out]

2*arcsinh(x^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.21 \[ \int \frac {1}{\sqrt {x+x^2}} \, dx=-\log \left (-2 \, x + 2 \, \sqrt {x^{2} + x} - 1\right ) \]

[In]

integrate(1/(x^2+x)^(1/2),x, algorithm="fricas")

[Out]

-log(-2*x + 2*sqrt(x^2 + x) - 1)

Sympy [A] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.07 \[ \int \frac {1}{\sqrt {x+x^2}} \, dx=\log {\left (2 x + 2 \sqrt {x^{2} + x} + 1 \right )} \]

[In]

integrate(1/(x**2+x)**(1/2),x)

[Out]

log(2*x + 2*sqrt(x**2 + x) + 1)

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.07 \[ \int \frac {1}{\sqrt {x+x^2}} \, dx=\log \left (2 \, x + 2 \, \sqrt {x^{2} + x} + 1\right ) \]

[In]

integrate(1/(x^2+x)^(1/2),x, algorithm="maxima")

[Out]

log(2*x + 2*sqrt(x^2 + x) + 1)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 33 vs. \(2 (12) = 24\).

Time = 0.27 (sec) , antiderivative size = 33, normalized size of antiderivative = 2.36 \[ \int \frac {1}{\sqrt {x+x^2}} \, dx=\frac {1}{4} \, \sqrt {x^{2} + x} {\left (2 \, x + 1\right )} + \frac {1}{8} \, \log \left ({\left | -2 \, x + 2 \, \sqrt {x^{2} + x} - 1 \right |}\right ) \]

[In]

integrate(1/(x^2+x)^(1/2),x, algorithm="giac")

[Out]

1/4*sqrt(x^2 + x)*(2*x + 1) + 1/8*log(abs(-2*x + 2*sqrt(x^2 + x) - 1))

Mupad [B] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.79 \[ \int \frac {1}{\sqrt {x+x^2}} \, dx=\ln \left (x+\sqrt {x\,\left (x+1\right )}+\frac {1}{2}\right ) \]

[In]

int(1/(x + x^2)^(1/2),x)

[Out]

log(x + (x*(x + 1))^(1/2) + 1/2)