Optimal. Leaf size=19 \[ x \sec ^{-1}(x)-\tanh ^{-1}\left (\sqrt {1-\frac {1}{x^2}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.01, antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 2.000, Rules used = {5322, 272, 65,
212} \begin {gather*} x \sec ^{-1}(x)-\tanh ^{-1}\left (\sqrt {1-\frac {1}{x^2}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 65
Rule 212
Rule 272
Rule 5322
Rubi steps
\begin {align*} \int \sec ^{-1}(x) \, dx &=x \sec ^{-1}(x)-\int \frac {1}{\sqrt {1-\frac {1}{x^2}} x} \, dx\\ &=x \sec ^{-1}(x)+\frac {1}{2} \text {Subst}\left (\int \frac {1}{\sqrt {1-x} x} \, dx,x,\frac {1}{x^2}\right )\\ &=x \sec ^{-1}(x)-\text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sqrt {1-\frac {1}{x^2}}\right )\\ &=x \sec ^{-1}(x)-\tanh ^{-1}\left (\sqrt {1-\frac {1}{x^2}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(64\) vs. \(2(19)=38\).
time = 0.05, size = 64, normalized size = 3.37 \begin {gather*} x \sec ^{-1}(x)-\frac {\sqrt {-1+x^2} \left (-\log \left (1-\frac {x}{\sqrt {-1+x^2}}\right )+\log \left (1+\frac {x}{\sqrt {-1+x^2}}\right )\right )}{2 \sqrt {1-\frac {1}{x^2}} x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.01, size = 22, normalized size = 1.16
method | result | size |
lookup | \(x \,\mathrm {arcsec}\left (x \right )-\ln \left (x +x \sqrt {1-\frac {1}{x^{2}}}\right )\) | \(22\) |
default | \(x \,\mathrm {arcsec}\left (x \right )-\ln \left (x +x \sqrt {1-\frac {1}{x^{2}}}\right )\) | \(22\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 35 vs.
\(2 (17) = 34\).
time = 4.81, size = 35, normalized size = 1.84 \begin {gather*} x \operatorname {arcsec}\left (x\right ) - \frac {1}{2} \, \log \left (\sqrt {-\frac {1}{x^{2}} + 1} + 1\right ) + \frac {1}{2} \, \log \left (-\sqrt {-\frac {1}{x^{2}} + 1} + 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.81, size = 33, normalized size = 1.74 \begin {gather*} {\left (x - 2\right )} \operatorname {arcsec}\left (x\right ) + 4 \, \arctan \left (-x + \sqrt {x^{2} - 1}\right ) + \log \left (-x + \sqrt {x^{2} - 1}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [C] Result contains complex when optimal does not.
time = 1.11, size = 17, normalized size = 0.89 \begin {gather*} x \operatorname {asec}{\left (x \right )} - \begin {cases} \operatorname {acosh}{\left (x \right )} & \text {for}\: \left |{x^{2}}\right | > 1 \\- i \operatorname {asin}{\left (x \right )} & \text {otherwise} \end {cases} \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. 37 vs.
\(2 (17) = 34\).
time = 0.50, size = 37, normalized size = 1.95 \begin {gather*} x \arccos \left (\frac {1}{x}\right ) - \frac {1}{2} \, \log \left (\sqrt {-\frac {1}{x^{2}} + 1} + 1\right ) + \frac {1}{2} \, \log \left (-\sqrt {-\frac {1}{x^{2}} + 1} + 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.61, size = 21, normalized size = 1.11 \begin {gather*} x\,\mathrm {acos}\left (\frac {1}{x}\right )-\ln \left (x+\sqrt {x^2-1}\right )\,\mathrm {sign}\left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________