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

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

Optimal result

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

[Out]

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

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.316, Rules used = {2144, 464, 335, 304, 209, 212} \[ \int \frac {1}{x \sqrt {x+\sqrt {1+x^2}}} \, dx=2 \arctan \left (\sqrt {\sqrt {x^2+1}+x}\right )-2 \text {arctanh}\left (\sqrt {\sqrt {x^2+1}+x}\right )+\frac {2}{\sqrt {\sqrt {x^2+1}+x}} \]

[In]

Int[1/(x*Sqrt[x + Sqrt[1 + x^2]]),x]

[Out]

2/Sqrt[x + Sqrt[1 + x^2]] + 2*ArcTan[Sqrt[x + Sqrt[1 + x^2]]] - 2*ArcTanh[Sqrt[x + Sqrt[1 + x^2]]]

Rule 209

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

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 304

Int[(x_)^2/((a_) + (b_.)*(x_)^4), x_Symbol] :> With[{r = Numerator[Rt[-a/b, 2]], s = Denominator[Rt[-a/b, 2]]}
, Dist[s/(2*b), Int[1/(r + s*x^2), x], x] - Dist[s/(2*b), Int[1/(r - s*x^2), x], x]] /; FreeQ[{a, b}, x] &&  !
GtQ[a/b, 0]

Rule 335

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> With[{k = Denominator[m]}, Dist[k/c, Subst[I
nt[x^(k*(m + 1) - 1)*(a + b*(x^(k*n)/c^n))^p, x], x, (c*x)^(1/k)], x]] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0]
 && FractionQ[m] && IntBinomialQ[a, b, c, n, m, p, x]

Rule 464

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

Rule 2144

Int[((g_.) + (h_.)*(x_))^(m_.)*((e_.)*(x_) + (f_.)*Sqrt[(a_.) + (c_.)*(x_)^2])^(n_.), x_Symbol] :> Dist[1/(2^(
m + 1)*e^(m + 1)), Subst[Int[x^(n - m - 2)*(a*f^2 + x^2)*((-a)*f^2*h + 2*e*g*x + h*x^2)^m, x], x, e*x + f*Sqrt
[a + c*x^2]], x] /; FreeQ[{a, c, e, f, g, h, n}, x] && EqQ[e^2 - c*f^2, 0] && IntegerQ[m]

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

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.00 \[ \int \frac {1}{x \sqrt {x+\sqrt {1+x^2}}} \, dx=\frac {2}{\sqrt {x+\sqrt {1+x^2}}}+2 \arctan \left (\sqrt {x+\sqrt {1+x^2}}\right )-2 \text {arctanh}\left (\sqrt {x+\sqrt {1+x^2}}\right ) \]

[In]

Integrate[1/(x*Sqrt[x + Sqrt[1 + x^2]]),x]

[Out]

2/Sqrt[x + Sqrt[1 + x^2]] + 2*ArcTan[Sqrt[x + Sqrt[1 + x^2]]] - 2*ArcTanh[Sqrt[x + Sqrt[1 + x^2]]]

Maple [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 3.

Time = 0.10 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.41

method result size
meijerg \(-\frac {\sqrt {2}\, \operatorname {hypergeom}\left (\left [\frac {1}{4}, \frac {1}{4}, \frac {3}{4}\right ], \left [\frac {5}{4}, \frac {3}{2}\right ], -\frac {1}{x^{2}}\right )}{\sqrt {x}}\) \(22\)

[In]

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

[Out]

-2^(1/2)/x^(1/2)*hypergeom([1/4,1/4,3/4],[5/4,3/2],-1/x^2)

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 1.78 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.81 \[ \int \frac {1}{x \sqrt {x+\sqrt {1+x^2}}} \, dx=- \frac {\Gamma ^{2}\left (\frac {1}{4}\right ) \Gamma \left (\frac {3}{4}\right ) {{}_{3}F_{2}\left (\begin {matrix} \frac {1}{4}, \frac {1}{4}, \frac {3}{4} \\ \frac {5}{4}, \frac {3}{2} \end {matrix}\middle | {\frac {e^{i \pi }}{x^{2}}} \right )}}{4 \pi \sqrt {x} \Gamma \left (\frac {5}{4}\right )} \]

[In]

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

[Out]

-gamma(1/4)**2*gamma(3/4)*hyper((1/4, 1/4, 3/4), (5/4, 3/2), exp_polar(I*pi)/x**2)/(4*pi*sqrt(x)*gamma(5/4))

Maxima [F]

\[ \int \frac {1}{x \sqrt {x+\sqrt {1+x^2}}} \, dx=\int { \frac {1}{\sqrt {x + \sqrt {x^{2} + 1}} x} \,d x } \]

[In]

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

[Out]

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

Giac [F]

\[ \int \frac {1}{x \sqrt {x+\sqrt {1+x^2}}} \, dx=\int { \frac {1}{\sqrt {x + \sqrt {x^{2} + 1}} x} \,d x } \]

[In]

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

[Out]

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

Mupad [F(-1)]

Timed out. \[ \int \frac {1}{x \sqrt {x+\sqrt {1+x^2}}} \, dx=\int \frac {1}{x\,\sqrt {x+\sqrt {x^2+1}}} \,d x \]

[In]

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

[Out]

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