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

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (verified)
   Fricas [A] (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 = 18, antiderivative size = 44 \[ \int \frac {\sqrt {-1+\frac {1}{x^2}} \left (-1+x^2\right )}{x} \, dx=\frac {3}{2} \sqrt {-1+\frac {1}{x^2}}-\frac {1}{2} \left (-1+\frac {1}{x^2}\right )^{3/2} x^2-\frac {3}{2} \arctan \left (\sqrt {-1+\frac {1}{x^2}}\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 44, 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.333, Rules used = {25, 272, 43, 52, 65, 209} \[ \int \frac {\sqrt {-1+\frac {1}{x^2}} \left (-1+x^2\right )}{x} \, dx=-\frac {3}{2} \arctan \left (\sqrt {\frac {1}{x^2}-1}\right )-\frac {1}{2} \left (\frac {1}{x^2}-1\right )^{3/2} x^2+\frac {3}{2} \sqrt {\frac {1}{x^2}-1} \]

[In]

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

[Out]

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

Rule 25

Int[(u_.)*((a_) + (b_.)*(x_)^(n_.))^(m_.)*((c_) + (d_.)*(x_)^(q_.))^(p_.), x_Symbol] :> Dist[(d/a)^p, Int[u*((
a + b*x^n)^(m + p)/x^(n*p)), x], x] /; FreeQ[{a, b, c, d, m, n}, x] && EqQ[q, -n] && IntegerQ[p] && EqQ[a*c -
b*d, 0] &&  !(IntegerQ[m] && NegQ[n])

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 52

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

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 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 272

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

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [C] (verified)

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

Time = 0.18 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.20

method result size
trager \(2 \left (\frac {x^{2}}{4}+\frac {1}{2}\right ) \sqrt {-\frac {x^{2}-1}{x^{2}}}-\frac {3 \operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right ) \ln \left (\left (\sqrt {-\frac {x^{2}-1}{x^{2}}}+\operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right )\right ) x \right )}{2}\) \(53\)
default \(\frac {\sqrt {-\frac {x^{2}-1}{x^{2}}}\, \left (2 \left (-x^{2}+1\right )^{\frac {3}{2}}+3 x^{2} \sqrt {-x^{2}+1}+3 \arcsin \left (x \right ) x \right )}{2 \sqrt {-x^{2}+1}}\) \(55\)
risch \(\frac {\left (x^{4}+x^{2}-2\right ) \sqrt {-\frac {x^{2}-1}{x^{2}}}}{2 x^{2}-2}-\frac {3 \arcsin \left (x \right ) \sqrt {-\frac {x^{2}-1}{x^{2}}}\, x \sqrt {-x^{2}+1}}{2 \left (x^{2}-1\right )}\) \(64\)

[In]

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

[Out]

2*(1/4*x^2+1/2)*(-(x^2-1)/x^2)^(1/2)-3/2*RootOf(_Z^2+1)*ln(((-(x^2-1)/x^2)^(1/2)+RootOf(_Z^2+1))*x)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 43, normalized size of antiderivative = 0.98 \[ \int \frac {\sqrt {-1+\frac {1}{x^2}} \left (-1+x^2\right )}{x} \, dx=\frac {1}{2} \, {\left (x^{2} + 2\right )} \sqrt {-\frac {x^{2} - 1}{x^{2}}} - 3 \, \arctan \left (\frac {x \sqrt {-\frac {x^{2} - 1}{x^{2}}} - 1}{x}\right ) \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 10.70 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.89 \[ \int \frac {\sqrt {-1+\frac {1}{x^2}} \left (-1+x^2\right )}{x} \, dx=\frac {x^{2} \sqrt {-1 + \frac {1}{x^{2}}}}{2} + \sqrt {-1 + \frac {1}{x^{2}}} - \frac {3 \operatorname {atan}{\left (\sqrt {-1 + \frac {1}{x^{2}}} \right )}}{2} \]

[In]

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

[Out]

x**2*sqrt(-1 + x**(-2))/2 + sqrt(-1 + x**(-2)) - 3*atan(sqrt(-1 + x**(-2)))/2

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.34 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.30 \[ \int \frac {\sqrt {-1+\frac {1}{x^2}} \left (-1+x^2\right )}{x} \, dx=\frac {1}{2} \, \sqrt {-x^{2} + 1} x \mathrm {sgn}\left (x\right ) + \frac {3}{2} \, \arcsin \left (x\right ) \mathrm {sgn}\left (x\right ) - \frac {x \mathrm {sgn}\left (x\right )}{2 \, {\left (\sqrt {-x^{2} + 1} - 1\right )}} + \frac {{\left (\sqrt {-x^{2} + 1} - 1\right )} \mathrm {sgn}\left (x\right )}{2 \, x} \]

[In]

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

[Out]

1/2*sqrt(-x^2 + 1)*x*sgn(x) + 3/2*arcsin(x)*sgn(x) - 1/2*x*sgn(x)/(sqrt(-x^2 + 1) - 1) + 1/2*(sqrt(-x^2 + 1) -
 1)*sgn(x)/x

Mupad [B] (verification not implemented)

Time = 18.11 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.68 \[ \int \frac {\sqrt {-1+\frac {1}{x^2}} \left (-1+x^2\right )}{x} \, dx=\sqrt {\frac {1}{x^2}-1}-\frac {3\,\mathrm {atan}\left (\sqrt {\frac {1}{x^2}-1}\right )}{2}+\frac {x^2\,\sqrt {\frac {1}{x^2}-1}}{2} \]

[In]

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

[Out]

(1/x^2 - 1)^(1/2) - (3*atan((1/x^2 - 1)^(1/2)))/2 + (x^2*(1/x^2 - 1)^(1/2))/2