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]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {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]
[Out]
Rule 65
Rule 81
Rule 214
Rule 457
Rule 528
Rubi steps
\begin {align*} \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.11, 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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, 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]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 1.58, 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]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 92 vs.
\(2 (44) = 88\).
time = 2.57, 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]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.08, size = 46, normalized size = 0.79 \begin {gather*} \frac {\mathrm {atanh}\left (\frac {\sqrt {a-b+\frac {b}{x^2}}}{\sqrt {a-b}}\right )}{\sqrt {a-b}}+\frac {\sqrt {a-b+\frac {b}{x^2}}}{b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________