Optimal. Leaf size=107 \[ -\frac {1}{\sqrt {x^2}}-\frac {\sqrt {-1+x^2} \sec ^{-1}(x)}{x}-\frac {2 i \sqrt {x^2} \sec ^{-1}(x) \tan ^{-1}\left (e^{i \sec ^{-1}(x)}\right )}{x}+\frac {i \sqrt {x^2} \text {Li}_2\left (-i e^{i \sec ^{-1}(x)}\right )}{x}-\frac {i \sqrt {x^2} \text {Li}_2\left (i e^{i \sec ^{-1}(x)}\right )}{x} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 116, normalized size of antiderivative = 1.08, number of steps
used = 9, number of rules used = 7, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.467, Rules used = {5350, 4784,
4804, 4266, 2317, 2438, 8} \begin {gather*} \frac {i \sqrt {x^2} \text {PolyLog}\left (2,-i e^{i \sec ^{-1}(x)}\right )}{x}-\frac {i \sqrt {x^2} \text {PolyLog}\left (2,i e^{i \sec ^{-1}(x)}\right )}{x}-\frac {2 i \sqrt {x^2} \sec ^{-1}(x) \text {ArcTan}\left (e^{i \sec ^{-1}(x)}\right )}{x}-\frac {1}{\sqrt {x^2}}-\frac {\sqrt {1-\frac {1}{x^2}} \sqrt {x^2} \sec ^{-1}(x)}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2317
Rule 2438
Rule 4266
Rule 4784
Rule 4804
Rule 5350
Rubi steps
\begin {align*} \int \frac {\sqrt {-1+x^2} \sec ^{-1}(x)}{x^2} \, dx &=-\frac {\sqrt {x^2} \text {Subst}\left (\int \frac {\sqrt {1-x^2} \cos ^{-1}(x)}{x} \, dx,x,\frac {1}{x}\right )}{x}\\ &=-\frac {\sqrt {1-\frac {1}{x^2}} \sqrt {x^2} \sec ^{-1}(x)}{x}-\frac {\sqrt {x^2} \text {Subst}\left (\int 1 \, dx,x,\frac {1}{x}\right )}{x}-\frac {\sqrt {x^2} \text {Subst}\left (\int \frac {\cos ^{-1}(x)}{x \sqrt {1-x^2}} \, dx,x,\frac {1}{x}\right )}{x}\\ &=-\frac {1}{\sqrt {x^2}}-\frac {\sqrt {1-\frac {1}{x^2}} \sqrt {x^2} \sec ^{-1}(x)}{x}+\frac {\sqrt {x^2} \text {Subst}\left (\int x \sec (x) \, dx,x,\sec ^{-1}(x)\right )}{x}\\ &=-\frac {1}{\sqrt {x^2}}-\frac {\sqrt {1-\frac {1}{x^2}} \sqrt {x^2} \sec ^{-1}(x)}{x}-\frac {2 i \sqrt {x^2} \sec ^{-1}(x) \tan ^{-1}\left (e^{i \sec ^{-1}(x)}\right )}{x}-\frac {\sqrt {x^2} \text {Subst}\left (\int \log \left (1-i e^{i x}\right ) \, dx,x,\sec ^{-1}(x)\right )}{x}+\frac {\sqrt {x^2} \text {Subst}\left (\int \log \left (1+i e^{i x}\right ) \, dx,x,\sec ^{-1}(x)\right )}{x}\\ &=-\frac {1}{\sqrt {x^2}}-\frac {\sqrt {1-\frac {1}{x^2}} \sqrt {x^2} \sec ^{-1}(x)}{x}-\frac {2 i \sqrt {x^2} \sec ^{-1}(x) \tan ^{-1}\left (e^{i \sec ^{-1}(x)}\right )}{x}+\frac {\left (i \sqrt {x^2}\right ) \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{i \sec ^{-1}(x)}\right )}{x}-\frac {\left (i \sqrt {x^2}\right ) \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{i \sec ^{-1}(x)}\right )}{x}\\ &=-\frac {1}{\sqrt {x^2}}-\frac {\sqrt {1-\frac {1}{x^2}} \sqrt {x^2} \sec ^{-1}(x)}{x}-\frac {2 i \sqrt {x^2} \sec ^{-1}(x) \tan ^{-1}\left (e^{i \sec ^{-1}(x)}\right )}{x}+\frac {i \sqrt {x^2} \text {Li}_2\left (-i e^{i \sec ^{-1}(x)}\right )}{x}-\frac {i \sqrt {x^2} \text {Li}_2\left (i e^{i \sec ^{-1}(x)}\right )}{x}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.13, size = 116, normalized size = 1.08 \begin {gather*} -\frac {\sqrt {1-\frac {1}{x^2}} \left (1+\sqrt {1-\frac {1}{x^2}} x \sec ^{-1}(x)-x \sec ^{-1}(x) \log \left (1-i e^{i \sec ^{-1}(x)}\right )+x \sec ^{-1}(x) \log \left (1+i e^{i \sec ^{-1}(x)}\right )-i x \text {Li}_2\left (-i e^{i \sec ^{-1}(x)}\right )+i x \text {Li}_2\left (i e^{i \sec ^{-1}(x)}\right )\right )}{\sqrt {-1+x^2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 707 vs. \(2 (119 ) = 238\).
time = 0.46, size = 708, normalized size = 6.62
method | result | size |
default | \(\frac {\sqrt {x^{2}-1}\, \left (\sqrt {\frac {x^{2}-1}{x^{2}}}\, x^{3}-3 i x^{2}-4 \sqrt {\frac {x^{2}-1}{x^{2}}}\, x +4 i\right )}{4 \left (-i \sqrt {\frac {x^{2}-1}{x^{2}}}\, x +x^{2}-1\right ) x}-\frac {\left (i \sqrt {\frac {x^{2}-1}{x^{2}}}\, x^{3}-2 i \sqrt {\frac {x^{2}-1}{x^{2}}}\, x +2 x^{2}-2\right ) \mathrm {arcsec}\left (x \right )}{4 x \sqrt {x^{2}-1}}-\frac {\sqrt {x^{2}-1}\, \left (\sqrt {\frac {x^{2}-1}{x^{2}}}\, x -i\right ) x}{2 \left (-i \sqrt {\frac {x^{2}-1}{x^{2}}}\, x +x^{2}-1\right )}+\frac {\left (i \sqrt {\frac {x^{2}-1}{x^{2}}}\, x^{3}-2 i \sqrt {\frac {x^{2}-1}{x^{2}}}\, x -2 x^{2}+2\right ) \mathrm {arcsec}\left (x \right )}{4 \sqrt {x^{2}-1}\, x}+\frac {i \sqrt {x^{2}-1}\, x^{3}}{4 i \sqrt {\frac {x^{2}-1}{x^{2}}}\, x^{3}-8 i \sqrt {\frac {x^{2}-1}{x^{2}}}\, x +8 x^{2}-8}-\frac {\left (i x^{2}+\sqrt {\frac {x^{2}-1}{x^{2}}}\, x -i\right ) \mathrm {arcsec}\left (x \right ) \ln \left (1+i \left (\frac {1}{x}+i \sqrt {1-\frac {1}{x^{2}}}\right )\right )}{2 \sqrt {x^{2}-1}}+\frac {\left (i x^{2}+\sqrt {\frac {x^{2}-1}{x^{2}}}\, x -i\right ) \mathrm {arcsec}\left (x \right ) \ln \left (1-i \left (\frac {1}{x}+i \sqrt {1-\frac {1}{x^{2}}}\right )\right )}{2 \sqrt {x^{2}-1}}-\frac {\left (-i \sqrt {\frac {x^{2}-1}{x^{2}}}\, x +x^{2}-1\right ) \dilog \left (1+i \left (\frac {1}{x}+i \sqrt {1-\frac {1}{x^{2}}}\right )\right )}{2 \sqrt {x^{2}-1}}+\frac {\left (-i \sqrt {\frac {x^{2}-1}{x^{2}}}\, x +x^{2}-1\right ) \dilog \left (1-i \left (\frac {1}{x}+i \sqrt {1-\frac {1}{x^{2}}}\right )\right )}{2 \sqrt {x^{2}-1}}+\frac {\left (i x^{2}-\sqrt {\frac {x^{2}-1}{x^{2}}}\, x -i\right ) \mathrm {arcsec}\left (x \right ) \ln \left (1+i \left (\frac {1}{x}+i \sqrt {1-\frac {1}{x^{2}}}\right )\right )}{2 \sqrt {x^{2}-1}}-\frac {\left (i x^{2}-\sqrt {\frac {x^{2}-1}{x^{2}}}\, x -i\right ) \mathrm {arcsec}\left (x \right ) \ln \left (1-i \left (\frac {1}{x}+i \sqrt {1-\frac {1}{x^{2}}}\right )\right )}{2 \sqrt {x^{2}-1}}+\frac {\left (i \sqrt {\frac {x^{2}-1}{x^{2}}}\, x +x^{2}-1\right ) \dilog \left (1+i \left (\frac {1}{x}+i \sqrt {1-\frac {1}{x^{2}}}\right )\right )}{2 \sqrt {x^{2}-1}}-\frac {\left (i \sqrt {\frac {x^{2}-1}{x^{2}}}\, x +x^{2}-1\right ) \dilog \left (1-i \left (\frac {1}{x}+i \sqrt {1-\frac {1}{x^{2}}}\right )\right )}{2 \sqrt {x^{2}-1}}\) | \(708\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sqrt {\left (x - 1\right ) \left (x + 1\right )} \operatorname {asec}{\left (x \right )}}{x^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\mathrm {acos}\left (\frac {1}{x}\right )\,\sqrt {x^2-1}}{x^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________