\(\int \sqrt {1+\frac {1}{x}} \, dx\) [312]

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

Optimal result

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

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.444, Rules used = {248, 43, 65, 213} \[ \int \sqrt {1+\frac {1}{x}} \, dx=\text {arctanh}\left (\sqrt {\frac {1}{x}+1}\right )+\sqrt {\frac {1}{x}+1} x \]

[In]

Int[Sqrt[1 + x^(-1)],x]

[Out]

Sqrt[1 + x^(-1)]*x + ArcTanh[Sqrt[1 + x^(-1)]]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^n/(b*(
m + 1))), x] - Dist[d*(n/(b*(m + 1))), Int[(a + b*x)^(m + 1)*(c + d*x)^(n - 1), x], x] /; FreeQ[{a, b, c, d, n
}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, -1] &&  !IntegerQ[n] && GtQ[n, 0]

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 213

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

Rule 248

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> -Subst[Int[(a + b/x^n)^p/x^2, x], x, 1/x] /; FreeQ[{a, b, p},
x] && ILtQ[n, 0]

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

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.00 \[ \int \sqrt {1+\frac {1}{x}} \, dx=\sqrt {1+\frac {1}{x}} x+\text {arctanh}\left (\sqrt {1+\frac {1}{x}}\right ) \]

[In]

Integrate[Sqrt[1 + x^(-1)],x]

[Out]

Sqrt[1 + x^(-1)]*x + ArcTanh[Sqrt[1 + x^(-1)]]

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(38\) vs. \(2(18)=36\).

Time = 0.11 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.77

method result size
trager \(\sqrt {-\frac {-1-x}{x}}\, x -\frac {\ln \left (2 \sqrt {-\frac {-1-x}{x}}\, x -2 x -1\right )}{2}\) \(39\)
default \(\frac {\sqrt {\frac {1+x}{x}}\, x \left (2 \sqrt {x^{2}+x}+\ln \left (\frac {1}{2}+x +\sqrt {x^{2}+x}\right )\right )}{2 \sqrt {x \left (1+x \right )}}\) \(41\)
risch \(x \sqrt {\frac {1+x}{x}}+\frac {\ln \left (\frac {1}{2}+x +\sqrt {x^{2}+x}\right ) \sqrt {\frac {1+x}{x}}\, \sqrt {x \left (1+x \right )}}{2+2 x}\) \(47\)

[In]

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

[Out]

(-(-1-x)/x)^(1/2)*x-1/2*ln(2*(-(-1-x)/x)^(1/2)*x-2*x-1)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 40 vs. \(2 (18) = 36\).

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.76 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.77 \[ \int \sqrt {1+\frac {1}{x}} \, dx=\sqrt {x} \sqrt {x + 1} + \operatorname {asinh}{\left (\sqrt {x} \right )} \]

[In]

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

[Out]

sqrt(x)*sqrt(x + 1) + asinh(sqrt(x))

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.55 \[ \int \sqrt {1+\frac {1}{x}} \, dx=x \sqrt {\frac {1}{x} + 1} + \frac {1}{2} \, \log \left (\sqrt {\frac {1}{x} + 1} + 1\right ) - \frac {1}{2} \, \log \left (\sqrt {\frac {1}{x} + 1} - 1\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.41 \[ \int \sqrt {1+\frac {1}{x}} \, dx=-\frac {1}{2} \, \log \left ({\left | -2 \, x + 2 \, \sqrt {x^{2} + x} - 1 \right |}\right ) \mathrm {sgn}\left (x\right ) + \sqrt {x^{2} + x} \mathrm {sgn}\left (x\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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