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

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

Optimal result

Integrand size = 32, antiderivative size = 63 \[ \int \frac {1}{x \sqrt {a^2+x^2} \sqrt {x+\sqrt {a^2+x^2}}} \, dx=-\frac {2 \arctan \left (\frac {\sqrt {x+\sqrt {a^2+x^2}}}{\sqrt {a}}\right )}{a^{3/2}}-\frac {2 \text {arctanh}\left (\frac {\sqrt {x+\sqrt {a^2+x^2}}}{\sqrt {a}}\right )}{a^{3/2}} \]

[Out]

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

Rubi [A] (verified)

Time = 0.16 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.156, Rules used = {2145, 335, 218, 212, 209} \[ \int \frac {1}{x \sqrt {a^2+x^2} \sqrt {x+\sqrt {a^2+x^2}}} \, dx=-\frac {2 \arctan \left (\frac {\sqrt {\sqrt {a^2+x^2}+x}}{\sqrt {a}}\right )}{a^{3/2}}-\frac {2 \text {arctanh}\left (\frac {\sqrt {\sqrt {a^2+x^2}+x}}{\sqrt {a}}\right )}{a^{3/2}} \]

[In]

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

[Out]

(-2*ArcTan[Sqrt[x + Sqrt[a^2 + x^2]]/Sqrt[a]])/a^(3/2) - (2*ArcTanh[Sqrt[x + Sqrt[a^2 + x^2]]/Sqrt[a]])/a^(3/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 218

Int[((a_) + (b_.)*(x_)^4)^(-1), x_Symbol] :> With[{r = Numerator[Rt[-a/b, 2]], s = Denominator[Rt[-a/b, 2]]},
Dist[r/(2*a), Int[1/(r - s*x^2), x], x] + Dist[r/(2*a), Int[1/(r + s*x^2), x], x]] /; FreeQ[{a, b}, x] &&  !Gt
Q[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 2145

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

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

Mathematica [A] (verified)

Time = 0.11 (sec) , antiderivative size = 56, normalized size of antiderivative = 0.89 \[ \int \frac {1}{x \sqrt {a^2+x^2} \sqrt {x+\sqrt {a^2+x^2}}} \, dx=-\frac {2 \left (\arctan \left (\frac {\sqrt {x+\sqrt {a^2+x^2}}}{\sqrt {a}}\right )+\text {arctanh}\left (\frac {\sqrt {x+\sqrt {a^2+x^2}}}{\sqrt {a}}\right )\right )}{a^{3/2}} \]

[In]

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

[Out]

(-2*(ArcTan[Sqrt[x + Sqrt[a^2 + x^2]]/Sqrt[a]] + ArcTanh[Sqrt[x + Sqrt[a^2 + x^2]]/Sqrt[a]]))/a^(3/2)

Maple [F]

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

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 105 vs. \(2 (47) = 94\).

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

[In]

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

[Out]

[-(2*sqrt(a)*arctan(sqrt(x + sqrt(a^2 + x^2))/sqrt(a)) - sqrt(a)*log((a^2 + sqrt(a^2 + x^2)*a - ((a - x)*sqrt(
a) + sqrt(a^2 + x^2)*sqrt(a))*sqrt(x + sqrt(a^2 + x^2)))/x))/a^2, (2*sqrt(-a)*arctan(sqrt(-a)*sqrt(x + sqrt(a^
2 + x^2))/a) - sqrt(-a)*log(-(a^2 - sqrt(a^2 + x^2)*a - (sqrt(-a)*(a + x) - sqrt(a^2 + x^2)*sqrt(-a))*sqrt(x +
 sqrt(a^2 + x^2)))/x))/a^2]

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

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

[In]

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

[Out]

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

Maxima [F]

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

[In]

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

[Out]

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

Giac [F]

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

[In]

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

[Out]

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

Mupad [F(-1)]

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

[In]

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

[Out]

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