Optimal. Leaf size=310 \[ \sec ^{-1}(a+b x)^2 \log \left (1-\frac {a e^{i \sec ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )+\sec ^{-1}(a+b x)^2 \log \left (1-\frac {a e^{i \sec ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )-\sec ^{-1}(a+b x)^2 \log \left (1+e^{2 i \sec ^{-1}(a+b x)}\right )-2 i \sec ^{-1}(a+b x) \text {PolyLog}\left (2,\frac {a e^{i \sec ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )-2 i \sec ^{-1}(a+b x) \text {PolyLog}\left (2,\frac {a e^{i \sec ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )+i \sec ^{-1}(a+b x) \text {PolyLog}\left (2,-e^{2 i \sec ^{-1}(a+b x)}\right )+2 \text {PolyLog}\left (3,\frac {a e^{i \sec ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )+2 \text {PolyLog}\left (3,\frac {a e^{i \sec ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )-\frac {1}{2} \text {PolyLog}\left (3,-e^{2 i \sec ^{-1}(a+b x)}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.36, antiderivative size = 310, normalized size of antiderivative = 1.00, number of steps
used = 17, number of rules used = 9, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.750, Rules used = {5366, 4647,
4626, 3800, 2221, 2611, 2320, 6724, 4616} \begin {gather*} -2 i \sec ^{-1}(a+b x) \text {Li}_2\left (\frac {a e^{i \sec ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )-2 i \sec ^{-1}(a+b x) \text {Li}_2\left (\frac {a e^{i \sec ^{-1}(a+b x)}}{\sqrt {1-a^2}+1}\right )+2 \text {Li}_3\left (\frac {a e^{i \sec ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )+2 \text {Li}_3\left (\frac {a e^{i \sec ^{-1}(a+b x)}}{\sqrt {1-a^2}+1}\right )+\sec ^{-1}(a+b x)^2 \log \left (1-\frac {a e^{i \sec ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )+\sec ^{-1}(a+b x)^2 \log \left (1-\frac {a e^{i \sec ^{-1}(a+b x)}}{\sqrt {1-a^2}+1}\right )+i \sec ^{-1}(a+b x) \text {Li}_2\left (-e^{2 i \sec ^{-1}(a+b x)}\right )-\frac {1}{2} \text {Li}_3\left (-e^{2 i \sec ^{-1}(a+b x)}\right )-\sec ^{-1}(a+b x)^2 \log \left (1+e^{2 i \sec ^{-1}(a+b x)}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2221
Rule 2320
Rule 2611
Rule 3800
Rule 4616
Rule 4626
Rule 4647
Rule 5366
Rule 6724
Rubi steps
\begin {align*} \int \frac {\sec ^{-1}(a+b x)^2}{x} \, dx &=\text {Subst}\left (\int \frac {x^2 \sec (x) \tan (x)}{-a+\sec (x)} \, dx,x,\sec ^{-1}(a+b x)\right )\\ &=\text {Subst}\left (\int \frac {x^2 \tan (x)}{1-a \cos (x)} \, dx,x,\sec ^{-1}(a+b x)\right )\\ &=a \text {Subst}\left (\int \frac {x^2 \sin (x)}{1-a \cos (x)} \, dx,x,\sec ^{-1}(a+b x)\right )+\text {Subst}\left (\int x^2 \tan (x) \, dx,x,\sec ^{-1}(a+b x)\right )\\ &=-\left (2 i \text {Subst}\left (\int \frac {e^{2 i x} x^2}{1+e^{2 i x}} \, dx,x,\sec ^{-1}(a+b x)\right )\right )-(i a) \text {Subst}\left (\int \frac {e^{i x} x^2}{1-\sqrt {1-a^2}-a e^{i x}} \, dx,x,\sec ^{-1}(a+b x)\right )-(i a) \text {Subst}\left (\int \frac {e^{i x} x^2}{1+\sqrt {1-a^2}-a e^{i x}} \, dx,x,\sec ^{-1}(a+b x)\right )\\ &=\sec ^{-1}(a+b x)^2 \log \left (1-\frac {a e^{i \sec ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )+\sec ^{-1}(a+b x)^2 \log \left (1-\frac {a e^{i \sec ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )-\sec ^{-1}(a+b x)^2 \log \left (1+e^{2 i \sec ^{-1}(a+b x)}\right )-2 \text {Subst}\left (\int x \log \left (1-\frac {a e^{i x}}{1-\sqrt {1-a^2}}\right ) \, dx,x,\sec ^{-1}(a+b x)\right )-2 \text {Subst}\left (\int x \log \left (1-\frac {a e^{i x}}{1+\sqrt {1-a^2}}\right ) \, dx,x,\sec ^{-1}(a+b x)\right )+2 \text {Subst}\left (\int x \log \left (1+e^{2 i x}\right ) \, dx,x,\sec ^{-1}(a+b x)\right )\\ &=\sec ^{-1}(a+b x)^2 \log \left (1-\frac {a e^{i \sec ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )+\sec ^{-1}(a+b x)^2 \log \left (1-\frac {a e^{i \sec ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )-\sec ^{-1}(a+b x)^2 \log \left (1+e^{2 i \sec ^{-1}(a+b x)}\right )-2 i \sec ^{-1}(a+b x) \text {Li}_2\left (\frac {a e^{i \sec ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )-2 i \sec ^{-1}(a+b x) \text {Li}_2\left (\frac {a e^{i \sec ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )+i \sec ^{-1}(a+b x) \text {Li}_2\left (-e^{2 i \sec ^{-1}(a+b x)}\right )-i \text {Subst}\left (\int \text {Li}_2\left (-e^{2 i x}\right ) \, dx,x,\sec ^{-1}(a+b x)\right )+2 i \text {Subst}\left (\int \text {Li}_2\left (\frac {a e^{i x}}{1-\sqrt {1-a^2}}\right ) \, dx,x,\sec ^{-1}(a+b x)\right )+2 i \text {Subst}\left (\int \text {Li}_2\left (\frac {a e^{i x}}{1+\sqrt {1-a^2}}\right ) \, dx,x,\sec ^{-1}(a+b x)\right )\\ &=\sec ^{-1}(a+b x)^2 \log \left (1-\frac {a e^{i \sec ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )+\sec ^{-1}(a+b x)^2 \log \left (1-\frac {a e^{i \sec ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )-\sec ^{-1}(a+b x)^2 \log \left (1+e^{2 i \sec ^{-1}(a+b x)}\right )-2 i \sec ^{-1}(a+b x) \text {Li}_2\left (\frac {a e^{i \sec ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )-2 i \sec ^{-1}(a+b x) \text {Li}_2\left (\frac {a e^{i \sec ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )+i \sec ^{-1}(a+b x) \text {Li}_2\left (-e^{2 i \sec ^{-1}(a+b x)}\right )-\frac {1}{2} \text {Subst}\left (\int \frac {\text {Li}_2(-x)}{x} \, dx,x,e^{2 i \sec ^{-1}(a+b x)}\right )+2 \text {Subst}\left (\int \frac {\text {Li}_2\left (\frac {a x}{1-\sqrt {1-a^2}}\right )}{x} \, dx,x,e^{i \sec ^{-1}(a+b x)}\right )+2 \text {Subst}\left (\int \frac {\text {Li}_2\left (\frac {a x}{1+\sqrt {1-a^2}}\right )}{x} \, dx,x,e^{i \sec ^{-1}(a+b x)}\right )\\ &=\sec ^{-1}(a+b x)^2 \log \left (1-\frac {a e^{i \sec ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )+\sec ^{-1}(a+b x)^2 \log \left (1-\frac {a e^{i \sec ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )-\sec ^{-1}(a+b x)^2 \log \left (1+e^{2 i \sec ^{-1}(a+b x)}\right )-2 i \sec ^{-1}(a+b x) \text {Li}_2\left (\frac {a e^{i \sec ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )-2 i \sec ^{-1}(a+b x) \text {Li}_2\left (\frac {a e^{i \sec ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )+i \sec ^{-1}(a+b x) \text {Li}_2\left (-e^{2 i \sec ^{-1}(a+b x)}\right )+2 \text {Li}_3\left (\frac {a e^{i \sec ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )+2 \text {Li}_3\left (\frac {a e^{i \sec ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )-\frac {1}{2} \text {Li}_3\left (-e^{2 i \sec ^{-1}(a+b x)}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(813\) vs. \(2(310)=620\).
time = 1.55, size = 813, normalized size = 2.62 \begin {gather*} \sec ^{-1}(a+b x)^2 \log \left (1+\frac {a e^{i \sec ^{-1}(a+b x)}}{-1+\sqrt {1-a^2}}\right )+\sec ^{-1}(a+b x)^2 \log \left (1+\frac {\left (-1+\sqrt {1-a^2}\right ) e^{i \sec ^{-1}(a+b x)}}{a}\right )-4 \sec ^{-1}(a+b x) \text {ArcSin}\left (\frac {\sqrt {\frac {-1+a}{a}}}{\sqrt {2}}\right ) \log \left (1+\frac {\left (-1+\sqrt {1-a^2}\right ) e^{i \sec ^{-1}(a+b x)}}{a}\right )+\sec ^{-1}(a+b x)^2 \log \left (1-\frac {a e^{i \sec ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )+\sec ^{-1}(a+b x)^2 \log \left (1-\frac {\left (1+\sqrt {1-a^2}\right ) e^{i \sec ^{-1}(a+b x)}}{a}\right )+4 \sec ^{-1}(a+b x) \text {ArcSin}\left (\frac {\sqrt {\frac {-1+a}{a}}}{\sqrt {2}}\right ) \log \left (1-\frac {\left (1+\sqrt {1-a^2}\right ) e^{i \sec ^{-1}(a+b x)}}{a}\right )-2 \sec ^{-1}(a+b x)^2 \log \left (1+e^{2 i \sec ^{-1}(a+b x)}\right )+\sec ^{-1}(a+b x)^2 \log \left (\frac {2 \left (\frac {1}{a+b x}+i \sqrt {1-\frac {1}{(a+b x)^2}}\right )}{a+b x}\right )-\sec ^{-1}(a+b x)^2 \log \left (1+\frac {\left (-1+\sqrt {1-a^2}\right ) \left (\frac {1}{a+b x}+i \sqrt {1-\frac {1}{(a+b x)^2}}\right )}{a}\right )+4 \sec ^{-1}(a+b x) \text {ArcSin}\left (\frac {\sqrt {\frac {-1+a}{a}}}{\sqrt {2}}\right ) \log \left (1+\frac {\left (-1+\sqrt {1-a^2}\right ) \left (\frac {1}{a+b x}+i \sqrt {1-\frac {1}{(a+b x)^2}}\right )}{a}\right )-\sec ^{-1}(a+b x)^2 \log \left (1-\frac {\left (1+\sqrt {1-a^2}\right ) \left (\frac {1}{a+b x}+i \sqrt {1-\frac {1}{(a+b x)^2}}\right )}{a}\right )-4 \sec ^{-1}(a+b x) \text {ArcSin}\left (\frac {\sqrt {\frac {-1+a}{a}}}{\sqrt {2}}\right ) \log \left (1-\frac {\left (1+\sqrt {1-a^2}\right ) \left (\frac {1}{a+b x}+i \sqrt {1-\frac {1}{(a+b x)^2}}\right )}{a}\right )-2 i \sec ^{-1}(a+b x) \text {PolyLog}\left (2,-\frac {a e^{i \sec ^{-1}(a+b x)}}{-1+\sqrt {1-a^2}}\right )-2 i \sec ^{-1}(a+b x) \text {PolyLog}\left (2,\frac {a e^{i \sec ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )+i \sec ^{-1}(a+b x) \text {PolyLog}\left (2,-e^{2 i \sec ^{-1}(a+b x)}\right )+2 \text {PolyLog}\left (3,-\frac {a e^{i \sec ^{-1}(a+b x)}}{-1+\sqrt {1-a^2}}\right )+2 \text {PolyLog}\left (3,\frac {a e^{i \sec ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )-\frac {1}{2} \text {PolyLog}\left (3,-e^{2 i \sec ^{-1}(a+b x)}\right ) \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.85, size = 0, normalized size = 0.00 \[\int \frac {\mathrm {arcsec}\left (b x +a \right )^{2}}{x}\, dx\]
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 {\operatorname {asec}^{2}{\left (a + b x \right )}}{x}\, 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.00 \begin {gather*} \int \frac {{\mathrm {acos}\left (\frac {1}{a+b\,x}\right )}^2}{x} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________