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

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

Optimal result

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

[Out]

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

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.316, Rules used = {378, 1412, 797, 81, 65, 213} \[ \int \frac {\sqrt {1+\sqrt {1+x^2}}}{x} \, dx=2 \sqrt {\sqrt {x^2+1}+1}-\sqrt {2} \text {arctanh}\left (\frac {\sqrt {\sqrt {x^2+1}+1}}{\sqrt {2}}\right ) \]

[In]

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

[Out]

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

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 81

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[b*(c + d*x)^
(n + 1)*((e + f*x)^(p + 1)/(d*f*(n + p + 2))), x] + Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p + 1)))/(
d*f*(n + p + 2)), Int[(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && NeQ[n + p + 2,
0]

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 378

Int[((a_) + (b_.)*(v_)^(n_))^(p_.)*(x_)^(m_.), x_Symbol] :> With[{c = Coefficient[v, x, 0], d = Coefficient[v,
 x, 1]}, Dist[1/d^(m + 1), Subst[Int[SimplifyIntegrand[(x - c)^m*(a + b*x^n)^p, x], x], x, v], x] /; NeQ[c, 0]
] /; FreeQ[{a, b, n, p}, x] && LinearQ[v, x] && IntegerQ[m]

Rule 797

Int[((d_) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[(d + e*x)^(m +
 p)*(f + g*x)*(a/d + (c/e)*x)^p, x] /; FreeQ[{a, c, d, e, f, g, m}, x] && EqQ[c*d^2 + a*e^2, 0] && (IntegerQ[p
] || (GtQ[a, 0] && GtQ[d, 0] && EqQ[m + p, 0]))

Rule 1412

Int[((a_) + (c_.)*(x_)^(n2_.))^(p_.)*((d_) + (e_.)*(x_)^(n_))^(q_.), x_Symbol] :> With[{g = Denominator[n]}, D
ist[g, Subst[Int[x^(g - 1)*(d + e*x^(g*n))^q*(a + c*x^(2*g*n))^p, x], x, x^(1/g)], x]] /; FreeQ[{a, c, d, e, p
, q}, x] && EqQ[n2, 2*n] && FractionQ[n]

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [C] (verified)

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

Time = 0.13 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.09

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

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [F(-1)]

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

[In]

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

[Out]

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