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

3.21.58.1 Optimal result
3.21.58.2 Mathematica [A] (verified)
3.21.58.3 Rubi [A] (verified)
3.21.58.4 Maple [F]
3.21.58.5 Fricas [C] (verification not implemented)
3.21.58.6 Sympy [F]
3.21.58.7 Maxima [F]
3.21.58.8 Giac [F]
3.21.58.9 Mupad [F(-1)]

3.21.58.1 Optimal result

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

output
(x-(x^2-1)^(1/2))^(1/2)*(-1/x+(x+(x^2-1)^(1/2))^(1/2)*(-1/2*arctan((-1/2*2 
^(1/2)+1/2*x*2^(1/2)+1/2*(x^2-1)^(1/2)*2^(1/2))/(x+(x^2-1)^(1/2))^(1/2))*2 
^(1/2)-1/2*arctanh((1/2*2^(1/2)+1/2*x*2^(1/2)+1/2*(x^2-1)^(1/2)*2^(1/2))/( 
x+(x^2-1)^(1/2))^(1/2))*2^(1/2)))
 
3.21.58.2 Mathematica [A] (verified)

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

input
Integrate[Sqrt[x - Sqrt[-1 + x^2]]/x^2,x]
 
output
-(Sqrt[x - Sqrt[-1 + x^2]]/x) + ArcTan[(-1 + x - Sqrt[-1 + x^2])/(Sqrt[2]* 
Sqrt[x - Sqrt[-1 + x^2]])]/Sqrt[2] + ArcTanh[(-1 - x + Sqrt[-1 + x^2])/(Sq 
rt[2]*Sqrt[x - Sqrt[-1 + x^2]])]/Sqrt[2]
 
3.21.58.3 Rubi [A] (verified)

Time = 0.36 (sec) , antiderivative size = 212, normalized size of antiderivative = 1.44, number of steps used = 13, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.571, Rules used = {2544, 25, 362, 266, 826, 1476, 1082, 217, 1479, 25, 27, 1103}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\sqrt {x-\sqrt {x^2-1}}}{x^2} \, dx\)

\(\Big \downarrow \) 2544

\(\displaystyle 2 \int -\frac {\sqrt {x-\sqrt {x^2-1}} \left (1-\left (x-\sqrt {x^2-1}\right )^2\right )}{\left (\left (x-\sqrt {x^2-1}\right )^2+1\right )^2}d\left (x-\sqrt {x^2-1}\right )\)

\(\Big \downarrow \) 25

\(\displaystyle -2 \int \frac {\sqrt {x-\sqrt {x^2-1}} \left (1-\left (x-\sqrt {x^2-1}\right )^2\right )}{\left (\left (x-\sqrt {x^2-1}\right )^2+1\right )^2}d\left (x-\sqrt {x^2-1}\right )\)

\(\Big \downarrow \) 362

\(\displaystyle 2 \left (\frac {1}{2} \int \frac {\sqrt {x-\sqrt {x^2-1}}}{\left (x-\sqrt {x^2-1}\right )^2+1}d\left (x-\sqrt {x^2-1}\right )-\frac {\left (x-\sqrt {x^2-1}\right )^{3/2}}{\left (x-\sqrt {x^2-1}\right )^2+1}\right )\)

\(\Big \downarrow \) 266

\(\displaystyle 2 \left (\int \frac {x-\sqrt {x^2-1}}{\left (x-\sqrt {x^2-1}\right )^2+1}d\sqrt {x-\sqrt {x^2-1}}-\frac {\left (x-\sqrt {x^2-1}\right )^{3/2}}{\left (x-\sqrt {x^2-1}\right )^2+1}\right )\)

\(\Big \downarrow \) 826

\(\displaystyle 2 \left (\frac {1}{2} \int \frac {x-\sqrt {x^2-1}+1}{\left (x-\sqrt {x^2-1}\right )^2+1}d\sqrt {x-\sqrt {x^2-1}}-\frac {1}{2} \int \frac {-x+\sqrt {x^2-1}+1}{\left (x-\sqrt {x^2-1}\right )^2+1}d\sqrt {x-\sqrt {x^2-1}}-\frac {\left (x-\sqrt {x^2-1}\right )^{3/2}}{\left (x-\sqrt {x^2-1}\right )^2+1}\right )\)

\(\Big \downarrow \) 1476

\(\displaystyle 2 \left (\frac {1}{2} \left (\frac {1}{2} \int \frac {1}{x-\sqrt {x^2-1}-\sqrt {2} \sqrt {x-\sqrt {x^2-1}}+1}d\sqrt {x-\sqrt {x^2-1}}+\frac {1}{2} \int \frac {1}{x-\sqrt {x^2-1}+\sqrt {2} \sqrt {x-\sqrt {x^2-1}}+1}d\sqrt {x-\sqrt {x^2-1}}\right )-\frac {1}{2} \int \frac {-x+\sqrt {x^2-1}+1}{\left (x-\sqrt {x^2-1}\right )^2+1}d\sqrt {x-\sqrt {x^2-1}}-\frac {\left (x-\sqrt {x^2-1}\right )^{3/2}}{\left (x-\sqrt {x^2-1}\right )^2+1}\right )\)

\(\Big \downarrow \) 1082

\(\displaystyle 2 \left (\frac {1}{2} \left (\frac {\int \frac {1}{-x+\sqrt {x^2-1}-1}d\left (1-\sqrt {2} \sqrt {x-\sqrt {x^2-1}}\right )}{\sqrt {2}}-\frac {\int \frac {1}{-x+\sqrt {x^2-1}-1}d\left (\sqrt {2} \sqrt {x-\sqrt {x^2-1}}+1\right )}{\sqrt {2}}\right )-\frac {1}{2} \int \frac {-x+\sqrt {x^2-1}+1}{\left (x-\sqrt {x^2-1}\right )^2+1}d\sqrt {x-\sqrt {x^2-1}}-\frac {\left (x-\sqrt {x^2-1}\right )^{3/2}}{\left (x-\sqrt {x^2-1}\right )^2+1}\right )\)

\(\Big \downarrow \) 217

\(\displaystyle 2 \left (-\frac {1}{2} \int \frac {-x+\sqrt {x^2-1}+1}{\left (x-\sqrt {x^2-1}\right )^2+1}d\sqrt {x-\sqrt {x^2-1}}+\frac {1}{2} \left (\frac {\arctan \left (\sqrt {2} \sqrt {x-\sqrt {x^2-1}}+1\right )}{\sqrt {2}}-\frac {\arctan \left (1-\sqrt {2} \sqrt {x-\sqrt {x^2-1}}\right )}{\sqrt {2}}\right )-\frac {\left (x-\sqrt {x^2-1}\right )^{3/2}}{\left (x-\sqrt {x^2-1}\right )^2+1}\right )\)

\(\Big \downarrow \) 1479

\(\displaystyle 2 \left (\frac {1}{2} \left (\frac {\int -\frac {\sqrt {2}-2 \sqrt {x-\sqrt {x^2-1}}}{x-\sqrt {x^2-1}-\sqrt {2} \sqrt {x-\sqrt {x^2-1}}+1}d\sqrt {x-\sqrt {x^2-1}}}{2 \sqrt {2}}+\frac {\int -\frac {\sqrt {2} \left (\sqrt {2} \sqrt {x-\sqrt {x^2-1}}+1\right )}{x-\sqrt {x^2-1}+\sqrt {2} \sqrt {x-\sqrt {x^2-1}}+1}d\sqrt {x-\sqrt {x^2-1}}}{2 \sqrt {2}}\right )+\frac {1}{2} \left (\frac {\arctan \left (\sqrt {2} \sqrt {x-\sqrt {x^2-1}}+1\right )}{\sqrt {2}}-\frac {\arctan \left (1-\sqrt {2} \sqrt {x-\sqrt {x^2-1}}\right )}{\sqrt {2}}\right )-\frac {\left (x-\sqrt {x^2-1}\right )^{3/2}}{\left (x-\sqrt {x^2-1}\right )^2+1}\right )\)

\(\Big \downarrow \) 25

\(\displaystyle 2 \left (\frac {1}{2} \left (-\frac {\int \frac {\sqrt {2}-2 \sqrt {x-\sqrt {x^2-1}}}{x-\sqrt {x^2-1}-\sqrt {2} \sqrt {x-\sqrt {x^2-1}}+1}d\sqrt {x-\sqrt {x^2-1}}}{2 \sqrt {2}}-\frac {\int \frac {\sqrt {2} \left (\sqrt {2} \sqrt {x-\sqrt {x^2-1}}+1\right )}{x-\sqrt {x^2-1}+\sqrt {2} \sqrt {x-\sqrt {x^2-1}}+1}d\sqrt {x-\sqrt {x^2-1}}}{2 \sqrt {2}}\right )+\frac {1}{2} \left (\frac {\arctan \left (\sqrt {2} \sqrt {x-\sqrt {x^2-1}}+1\right )}{\sqrt {2}}-\frac {\arctan \left (1-\sqrt {2} \sqrt {x-\sqrt {x^2-1}}\right )}{\sqrt {2}}\right )-\frac {\left (x-\sqrt {x^2-1}\right )^{3/2}}{\left (x-\sqrt {x^2-1}\right )^2+1}\right )\)

\(\Big \downarrow \) 27

\(\displaystyle 2 \left (\frac {1}{2} \left (-\frac {\int \frac {\sqrt {2}-2 \sqrt {x-\sqrt {x^2-1}}}{x-\sqrt {x^2-1}-\sqrt {2} \sqrt {x-\sqrt {x^2-1}}+1}d\sqrt {x-\sqrt {x^2-1}}}{2 \sqrt {2}}-\frac {1}{2} \int \frac {\sqrt {2} \sqrt {x-\sqrt {x^2-1}}+1}{x-\sqrt {x^2-1}+\sqrt {2} \sqrt {x-\sqrt {x^2-1}}+1}d\sqrt {x-\sqrt {x^2-1}}\right )+\frac {1}{2} \left (\frac {\arctan \left (\sqrt {2} \sqrt {x-\sqrt {x^2-1}}+1\right )}{\sqrt {2}}-\frac {\arctan \left (1-\sqrt {2} \sqrt {x-\sqrt {x^2-1}}\right )}{\sqrt {2}}\right )-\frac {\left (x-\sqrt {x^2-1}\right )^{3/2}}{\left (x-\sqrt {x^2-1}\right )^2+1}\right )\)

\(\Big \downarrow \) 1103

\(\displaystyle 2 \left (\frac {1}{2} \left (\frac {\arctan \left (\sqrt {2} \sqrt {x-\sqrt {x^2-1}}+1\right )}{\sqrt {2}}-\frac {\arctan \left (1-\sqrt {2} \sqrt {x-\sqrt {x^2-1}}\right )}{\sqrt {2}}\right )-\frac {\left (x-\sqrt {x^2-1}\right )^{3/2}}{\left (x-\sqrt {x^2-1}\right )^2+1}+\frac {1}{2} \left (\frac {\log \left (-\sqrt {x^2-1}-\sqrt {2} \sqrt {x-\sqrt {x^2-1}}+x+1\right )}{2 \sqrt {2}}-\frac {\log \left (-\sqrt {x^2-1}+\sqrt {2} \sqrt {x-\sqrt {x^2-1}}+x+1\right )}{2 \sqrt {2}}\right )\right )\)

input
Int[Sqrt[x - Sqrt[-1 + x^2]]/x^2,x]
 
output
2*(-((x - Sqrt[-1 + x^2])^(3/2)/(1 + (x - Sqrt[-1 + x^2])^2)) + (-(ArcTan[ 
1 - Sqrt[2]*Sqrt[x - Sqrt[-1 + x^2]]]/Sqrt[2]) + ArcTan[1 + Sqrt[2]*Sqrt[x 
 - Sqrt[-1 + x^2]]]/Sqrt[2])/2 + (Log[1 + x - Sqrt[-1 + x^2] - Sqrt[2]*Sqr 
t[x - Sqrt[-1 + x^2]]]/(2*Sqrt[2]) - Log[1 + x - Sqrt[-1 + x^2] + Sqrt[2]* 
Sqrt[x - Sqrt[-1 + x^2]]]/(2*Sqrt[2]))/2)
 

3.21.58.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

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

rule 266
Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{k = De 
nominator[m]}, Simp[k/c   Subst[Int[x^(k*(m + 1) - 1)*(a + b*(x^(2*k)/c^2)) 
^p, x], x, (c*x)^(1/k)], x]] /; FreeQ[{a, b, c, p}, x] && FractionQ[m] && I 
ntBinomialQ[a, b, c, 2, m, p, x]
 

rule 362
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2), x 
_Symbol] :> Simp[(-(b*c - a*d))*(e*x)^(m + 1)*((a + b*x^2)^(p + 1)/(2*a*b*e 
*(p + 1))), x] - Simp[(a*d*(m + 1) - b*c*(m + 2*p + 3))/(2*a*b*(p + 1))   I 
nt[(e*x)^m*(a + b*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e, m}, x] && N 
eQ[b*c - a*d, 0] && LtQ[p, -1] && (( !IntegerQ[p + 1/2] && NeQ[p, -5/4]) || 
  !RationalQ[m] || (ILtQ[p + 1/2, 0] && LeQ[-1, m, -2*(p + 1)]))
 

rule 826
Int[(x_)^2/((a_) + (b_.)*(x_)^4), x_Symbol] :> With[{r = Numerator[Rt[a/b, 
2]], s = Denominator[Rt[a/b, 2]]}, Simp[1/(2*s)   Int[(r + s*x^2)/(a + b*x^ 
4), x], x] - Simp[1/(2*s)   Int[(r - s*x^2)/(a + b*x^4), x], x]] /; FreeQ[{ 
a, b}, x] && (GtQ[a/b, 0] || (PosQ[a/b] && AtomQ[SplitProduct[SumBaseQ, a]] 
 && AtomQ[SplitProduct[SumBaseQ, b]]))
 

rule 1082
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = 1 - 4*S 
implify[a*(c/b^2)]}, Simp[-2/b   Subst[Int[1/(q - x^2), x], x, 1 + 2*c*(x/b 
)], x] /; RationalQ[q] && (EqQ[q^2, 1] ||  !RationalQ[b^2 - 4*a*c])] /; Fre 
eQ[{a, b, c}, x]
 

rule 1103
Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S 
imp[d*(Log[RemoveContent[a + b*x + c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, 
e}, x] && EqQ[2*c*d - b*e, 0]
 

rule 1476
Int[((d_) + (e_.)*(x_)^2)/((a_) + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[ 
2*(d/e), 2]}, Simp[e/(2*c)   Int[1/Simp[d/e + q*x + x^2, x], x], x] + Simp[ 
e/(2*c)   Int[1/Simp[d/e - q*x + x^2, x], x], x]] /; FreeQ[{a, c, d, e}, x] 
 && EqQ[c*d^2 - a*e^2, 0] && PosQ[d*e]
 

rule 1479
Int[((d_) + (e_.)*(x_)^2)/((a_) + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[ 
-2*(d/e), 2]}, Simp[e/(2*c*q)   Int[(q - 2*x)/Simp[d/e + q*x - x^2, x], x], 
 x] + Simp[e/(2*c*q)   Int[(q + 2*x)/Simp[d/e - q*x - x^2, x], x], x]] /; F 
reeQ[{a, c, d, e}, x] && EqQ[c*d^2 - a*e^2, 0] && NegQ[d*e]
 

rule 2544
Int[((g_.) + (h_.)*(x_))^(m_.)*((e_.)*(x_) + (f_.)*Sqrt[(a_.) + (c_.)*(x_)^ 
2])^(n_.), x_Symbol] :> Simp[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] && I 
ntegerQ[m]
 
3.21.58.4 Maple [F]

\[\int \frac {\sqrt {x -\sqrt {x^{2}-1}}}{x^{2}}d x\]

input
int((x-(x^2-1)^(1/2))^(1/2)/x^2,x)
 
output
int((x-(x^2-1)^(1/2))^(1/2)/x^2,x)
 
3.21.58.5 Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

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

input
integrate((x-(x^2-1)^(1/2))^(1/2)/x^2,x, algorithm="fricas")
 
output
1/4*((I - 1)*sqrt(2)*x*log((I + 1)*sqrt(2) + 2*sqrt(x - sqrt(x^2 - 1))) - 
(I + 1)*sqrt(2)*x*log(-(I - 1)*sqrt(2) + 2*sqrt(x - sqrt(x^2 - 1))) + (I + 
 1)*sqrt(2)*x*log((I - 1)*sqrt(2) + 2*sqrt(x - sqrt(x^2 - 1))) - (I - 1)*s 
qrt(2)*x*log(-(I + 1)*sqrt(2) + 2*sqrt(x - sqrt(x^2 - 1))) - 4*sqrt(x - sq 
rt(x^2 - 1)))/x
 
3.21.58.6 Sympy [F]

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

input
integrate((x-(x**2-1)**(1/2))**(1/2)/x**2,x)
 
output
Integral(sqrt(x - sqrt(x**2 - 1))/x**2, x)
 
3.21.58.7 Maxima [F]

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

input
integrate((x-(x^2-1)^(1/2))^(1/2)/x^2,x, algorithm="maxima")
 
output
integrate(sqrt(x - sqrt(x^2 - 1))/x^2, x)
 
3.21.58.8 Giac [F]

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

input
integrate((x-(x^2-1)^(1/2))^(1/2)/x^2,x, algorithm="giac")
 
output
integrate(sqrt(x - sqrt(x^2 - 1))/x^2, x)
 
3.21.58.9 Mupad [F(-1)]

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

input
int((x - (x^2 - 1)^(1/2))^(1/2)/x^2,x)
 
output
int((x - (x^2 - 1)^(1/2))^(1/2)/x^2, x)