3.9.12 \(\int \frac {-1+x^2}{\sqrt {a+b (-1+\frac {1}{x^2})} x^3} \, dx\) [812]

Optimal. Leaf size=58 \[ \frac {\sqrt {a-b \left (1-\frac {1}{x^2}\right )}}{b}+\frac {\tanh ^{-1}\left (\frac {\sqrt {a-b \left (1-\frac {1}{x^2}\right )}}{\sqrt {a-b}}\right )}{\sqrt {a-b}} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.10, antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {2003, 528, 457, 81, 65, 214} \begin {gather*} \frac {\sqrt {a-b \left (1-\frac {1}{x^2}\right )}}{b}+\frac {\tanh ^{-1}\left (\frac {\sqrt {a-b \left (1-\frac {1}{x^2}\right )}}{\sqrt {a-b}}\right )}{\sqrt {a-b}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

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 214

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

Rule 457

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

Rule 528

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

Rule 2003

Int[(Pq_)*(u_)^(p_.)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[(c*x)^m*Pq*ExpandToSum[u, x]^p, x] /; FreeQ[{c, m, p
}, x] && PolyQ[Pq, x] && BinomialQ[u, x] &&  !BinomialMatchQ[u, x]

Rubi steps

\begin {align*} \int \frac {-1+x^2}{\sqrt {a+b \left (-1+\frac {1}{x^2}\right )} x^3} \, dx &=\int \frac {-1+x^2}{\sqrt {a-b+\frac {b}{x^2}} x^3} \, dx\\ &=\int \frac {1-\frac {1}{x^2}}{\sqrt {a-b+\frac {b}{x^2}} x} \, dx\\ &=-\left (\frac {1}{2} \text {Subst}\left (\int \frac {1-x}{x \sqrt {a-b+b x}} \, dx,x,\frac {1}{x^2}\right )\right )\\ &=\frac {\sqrt {a-b \left (1-\frac {1}{x^2}\right )}}{b}-\frac {1}{2} \text {Subst}\left (\int \frac {1}{x \sqrt {a-b+b x}} \, dx,x,\frac {1}{x^2}\right )\\ &=\frac {\sqrt {a-b \left (1-\frac {1}{x^2}\right )}}{b}-\frac {\text {Subst}\left (\int \frac {1}{-\frac {a-b}{b}+\frac {x^2}{b}} \, dx,x,\sqrt {a+b \left (-1+\frac {1}{x^2}\right )}\right )}{b}\\ &=\frac {\sqrt {a-b \left (1-\frac {1}{x^2}\right )}}{b}+\frac {\tanh ^{-1}\left (\frac {\sqrt {a-b \left (1-\frac {1}{x^2}\right )}}{\sqrt {a-b}}\right )}{\sqrt {a-b}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.00, size = 103, normalized size = 1.78 \begin {gather*} \frac {\sqrt {a-b} \left (b+a x^2-b x^2\right )-b x \sqrt {b+a x^2-b x^2} \log \left (-\sqrt {a-b} x+\sqrt {b+(a-b) x^2}\right )}{\sqrt {a-b} b \sqrt {a+b \left (-1+\frac {1}{x^2}\right )} x^2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(Sqrt[a - b]*(b + a*x^2 - b*x^2) - b*x*Sqrt[b + a*x^2 - b*x^2]*Log[-(Sqrt[a - b]*x) + Sqrt[b + (a - b)*x^2]])/
(Sqrt[a - b]*b*Sqrt[a + b*(-1 + x^(-2))]*x^2)

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(101\) vs. \(2(50)=100\).
time = 0.05, size = 102, normalized size = 1.76

method result size
default \(\frac {\sqrt {a \,x^{2}-b \,x^{2}+b}\, \left (\ln \left (x \sqrt {a -b}+\sqrt {a \,x^{2}-b \,x^{2}+b}\right ) b x +\sqrt {a \,x^{2}-b \,x^{2}+b}\, \sqrt {a -b}\right )}{\sqrt {\frac {a \,x^{2}-b \,x^{2}+b}{x^{2}}}\, x^{2} \sqrt {a -b}\, b}\) \(102\)
risch \(\frac {a \,x^{2}-b \,x^{2}+b}{b \,x^{2} \sqrt {\frac {a \,x^{2}-b \,x^{2}+b}{x^{2}}}}+\frac {\ln \left (x \sqrt {a -b}+\sqrt {x^{2} \left (a -b \right )+b}\right ) \sqrt {a \,x^{2}-b \,x^{2}+b}}{\sqrt {a -b}\, \sqrt {\frac {a \,x^{2}-b \,x^{2}+b}{x^{2}}}\, x}\) \(110\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(a*x^2-b*x^2+b)^(1/2)*(ln(x*(a-b)^(1/2)+(a*x^2-b*x^2+b)^(1/2))*b*x+(a*x^2-b*x^2+b)^(1/2)*(a-b)^(1/2))/((a*x^2-
b*x^2+b)/x^2)^(1/2)/x^2/(a-b)^(1/2)/b

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a-4*b>0)', see `assume?` for
 more detail

________________________________________________________________________________________

Fricas [A]
time = 0.41, size = 180, normalized size = 3.10 \begin {gather*} \left [\frac {\sqrt {a - b} b \log \left (-2 \, {\left (a - b\right )} x^{2} - 2 \, \sqrt {a - b} x^{2} \sqrt {\frac {{\left (a - b\right )} x^{2} + b}{x^{2}}} - b\right ) + 2 \, {\left (a - b\right )} \sqrt {\frac {{\left (a - b\right )} x^{2} + b}{x^{2}}}}{2 \, {\left (a b - b^{2}\right )}}, \frac {\sqrt {-a + b} b \arctan \left (-\frac {\sqrt {-a + b} x^{2} \sqrt {\frac {{\left (a - b\right )} x^{2} + b}{x^{2}}}}{{\left (a - b\right )} x^{2} + b}\right ) + {\left (a - b\right )} \sqrt {\frac {{\left (a - b\right )} x^{2} + b}{x^{2}}}}{a b - b^{2}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 3.65, size = 70, normalized size = 1.21 \begin {gather*} - \frac {\begin {cases} - \frac {1}{\sqrt {a} x^{2}} & \text {for}\: b = 0 \\- \frac {2 \sqrt {a - b + \frac {b}{x^{2}}}}{b} & \text {otherwise} \end {cases}}{2} - \frac {\operatorname {atan}{\left (\frac {1}{\sqrt {- \frac {1}{a - b}} \sqrt {a - b + \frac {b}{x^{2}}}} \right )}}{\sqrt {- \frac {1}{a - b}} \left (a - b\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**2-1)/x**3/(a+b*(-1+1/x**2))**(1/2),x)

[Out]

-Piecewise((-1/(sqrt(a)*x**2), Eq(b, 0)), (-2*sqrt(a - b + b/x**2)/b, True))/2 - atan(1/(sqrt(-1/(a - b))*sqrt
(a - b + b/x**2)))/(sqrt(-1/(a - b))*(a - b))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 92 vs. \(2 (44) = 88\).
time = 2.56, size = 92, normalized size = 1.59 \begin {gather*} -\frac {\log \left ({\left (\sqrt {a - b} x - \sqrt {a x^{2} - b x^{2} + b}\right )}^{2}\right )}{2 \, \sqrt {a - b} \mathrm {sgn}\left (x\right )} - \frac {2 \, \sqrt {a - b}}{{\left ({\left (\sqrt {a - b} x - \sqrt {a x^{2} - b x^{2} + b}\right )}^{2} - b\right )} \mathrm {sgn}\left (x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 4.04, size = 62, normalized size = 1.07 \begin {gather*} \frac {\sqrt {a+b\,\left (\frac {1}{x^2}-1\right )}}{b}+\frac {\ln \left (x^2\,\left (2\,a-2\,b+2\,\sqrt {a-b}\,\sqrt {a+b\,\left (\frac {1}{x^2}-1\right )}+\frac {b}{x^2}\right )\right )}{2\,\sqrt {a-b}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(a + b*(1/x^2 - 1))^(1/2)/b + log(x^2*(2*a - 2*b + 2*(a - b)^(1/2)*(a + b*(1/x^2 - 1))^(1/2) + b/x^2))/(2*(a -
 b)^(1/2))

________________________________________________________________________________________