Optimal. Leaf size=254 \[ -\frac {b \csc ^{-1}(a+b x)^2}{a}-\frac {\csc ^{-1}(a+b x)^2}{x}-\frac {2 i b \csc ^{-1}(a+b x) \log \left (1+\frac {i a e^{i \csc ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )}{a \sqrt {1-a^2}}+\frac {2 i b \csc ^{-1}(a+b x) \log \left (1+\frac {i a e^{i \csc ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )}{a \sqrt {1-a^2}}-\frac {2 b \text {PolyLog}\left (2,-\frac {i a e^{i \csc ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )}{a \sqrt {1-a^2}}+\frac {2 b \text {PolyLog}\left (2,-\frac {i a e^{i \csc ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )}{a \sqrt {1-a^2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.28, antiderivative size = 254, normalized size of antiderivative = 1.00, number of steps
used = 12, number of rules used = 8, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.667, Rules used = {5367, 4512,
4276, 3404, 2296, 2221, 2317, 2438} \begin {gather*} -\frac {2 b \text {Li}_2\left (-\frac {i a e^{i \csc ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )}{a \sqrt {1-a^2}}+\frac {2 b \text {Li}_2\left (-\frac {i a e^{i \csc ^{-1}(a+b x)}}{\sqrt {1-a^2}+1}\right )}{a \sqrt {1-a^2}}-\frac {2 i b \csc ^{-1}(a+b x) \log \left (1+\frac {i a e^{i \csc ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )}{a \sqrt {1-a^2}}+\frac {2 i b \csc ^{-1}(a+b x) \log \left (1+\frac {i a e^{i \csc ^{-1}(a+b x)}}{\sqrt {1-a^2}+1}\right )}{a \sqrt {1-a^2}}-\frac {b \csc ^{-1}(a+b x)^2}{a}-\frac {\csc ^{-1}(a+b x)^2}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2221
Rule 2296
Rule 2317
Rule 2438
Rule 3404
Rule 4276
Rule 4512
Rule 5367
Rubi steps
\begin {align*} \int \frac {\csc ^{-1}(a+b x)^2}{x^2} \, dx &=-\left (b \text {Subst}\left (\int \frac {x^2 \cot (x) \csc (x)}{(-a+\csc (x))^2} \, dx,x,\csc ^{-1}(a+b x)\right )\right )\\ &=-\frac {\csc ^{-1}(a+b x)^2}{x}+(2 b) \text {Subst}\left (\int \frac {x}{-a+\csc (x)} \, dx,x,\csc ^{-1}(a+b x)\right )\\ &=-\frac {\csc ^{-1}(a+b x)^2}{x}+(2 b) \text {Subst}\left (\int \left (-\frac {x}{a}+\frac {x}{a (1-a \sin (x))}\right ) \, dx,x,\csc ^{-1}(a+b x)\right )\\ &=-\frac {b \csc ^{-1}(a+b x)^2}{a}-\frac {\csc ^{-1}(a+b x)^2}{x}+\frac {(2 b) \text {Subst}\left (\int \frac {x}{1-a \sin (x)} \, dx,x,\csc ^{-1}(a+b x)\right )}{a}\\ &=-\frac {b \csc ^{-1}(a+b x)^2}{a}-\frac {\csc ^{-1}(a+b x)^2}{x}+\frac {(4 b) \text {Subst}\left (\int \frac {e^{i x} x}{-i a+2 e^{i x}+i a e^{2 i x}} \, dx,x,\csc ^{-1}(a+b x)\right )}{a}\\ &=-\frac {b \csc ^{-1}(a+b x)^2}{a}-\frac {\csc ^{-1}(a+b x)^2}{x}+\frac {(4 i b) \text {Subst}\left (\int \frac {e^{i x} x}{2-2 \sqrt {1-a^2}+2 i a e^{i x}} \, dx,x,\csc ^{-1}(a+b x)\right )}{\sqrt {1-a^2}}-\frac {(4 i b) \text {Subst}\left (\int \frac {e^{i x} x}{2+2 \sqrt {1-a^2}+2 i a e^{i x}} \, dx,x,\csc ^{-1}(a+b x)\right )}{\sqrt {1-a^2}}\\ &=-\frac {b \csc ^{-1}(a+b x)^2}{a}-\frac {\csc ^{-1}(a+b x)^2}{x}-\frac {2 i b \csc ^{-1}(a+b x) \log \left (1+\frac {i a e^{i \csc ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )}{a \sqrt {1-a^2}}+\frac {2 i b \csc ^{-1}(a+b x) \log \left (1+\frac {i a e^{i \csc ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )}{a \sqrt {1-a^2}}+\frac {(2 i b) \text {Subst}\left (\int \log \left (1+\frac {2 i a e^{i x}}{2-2 \sqrt {1-a^2}}\right ) \, dx,x,\csc ^{-1}(a+b x)\right )}{a \sqrt {1-a^2}}-\frac {(2 i b) \text {Subst}\left (\int \log \left (1+\frac {2 i a e^{i x}}{2+2 \sqrt {1-a^2}}\right ) \, dx,x,\csc ^{-1}(a+b x)\right )}{a \sqrt {1-a^2}}\\ &=-\frac {b \csc ^{-1}(a+b x)^2}{a}-\frac {\csc ^{-1}(a+b x)^2}{x}-\frac {2 i b \csc ^{-1}(a+b x) \log \left (1+\frac {i a e^{i \csc ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )}{a \sqrt {1-a^2}}+\frac {2 i b \csc ^{-1}(a+b x) \log \left (1+\frac {i a e^{i \csc ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )}{a \sqrt {1-a^2}}+\frac {(2 b) \text {Subst}\left (\int \frac {\log \left (1+\frac {2 i a x}{2-2 \sqrt {1-a^2}}\right )}{x} \, dx,x,e^{i \csc ^{-1}(a+b x)}\right )}{a \sqrt {1-a^2}}-\frac {(2 b) \text {Subst}\left (\int \frac {\log \left (1+\frac {2 i a x}{2+2 \sqrt {1-a^2}}\right )}{x} \, dx,x,e^{i \csc ^{-1}(a+b x)}\right )}{a \sqrt {1-a^2}}\\ &=-\frac {b \csc ^{-1}(a+b x)^2}{a}-\frac {\csc ^{-1}(a+b x)^2}{x}-\frac {2 i b \csc ^{-1}(a+b x) \log \left (1+\frac {i a e^{i \csc ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )}{a \sqrt {1-a^2}}+\frac {2 i b \csc ^{-1}(a+b x) \log \left (1+\frac {i a e^{i \csc ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )}{a \sqrt {1-a^2}}-\frac {2 b \text {Li}_2\left (-\frac {i a e^{i \csc ^{-1}(a+b x)}}{1-\sqrt {1-a^2}}\right )}{a \sqrt {1-a^2}}+\frac {2 b \text {Li}_2\left (-\frac {i a e^{i \csc ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )}{a \sqrt {1-a^2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(802\) vs. \(2(254)=508\).
time = 2.13, size = 802, normalized size = 3.16 \begin {gather*} -\frac {b \left (\frac {(a+b x) \csc ^{-1}(a+b x)^2}{b x}+\frac {2 \pi \text {ArcTan}\left (\frac {a-\tan \left (\frac {1}{2} \csc ^{-1}(a+b x)\right )}{\sqrt {1-a^2}}\right )}{\sqrt {1-a^2}}+\frac {2 \left (-2 \text {ArcCos}\left (\frac {1}{a}\right ) \tanh ^{-1}\left (\frac {(1+a) \cot \left (\frac {1}{4} \left (\pi +2 \csc ^{-1}(a+b x)\right )\right )}{\sqrt {-1+a^2}}\right )+\left (\pi -2 \csc ^{-1}(a+b x)\right ) \tanh ^{-1}\left (\frac {(-1+a) \tan \left (\frac {1}{4} \left (\pi +2 \csc ^{-1}(a+b x)\right )\right )}{\sqrt {-1+a^2}}\right )+\left (\text {ArcCos}\left (\frac {1}{a}\right )+2 i \left (-\tanh ^{-1}\left (\frac {(1+a) \cot \left (\frac {1}{4} \left (\pi +2 \csc ^{-1}(a+b x)\right )\right )}{\sqrt {-1+a^2}}\right )+\tanh ^{-1}\left (\frac {(-1+a) \tan \left (\frac {1}{4} \left (\pi +2 \csc ^{-1}(a+b x)\right )\right )}{\sqrt {-1+a^2}}\right )\right )\right ) \log \left (\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) \sqrt {-1+a^2} e^{-\frac {1}{2} i \csc ^{-1}(a+b x)}}{\sqrt {a} \sqrt {-\frac {b x}{a+b x}}}\right )+\left (\text {ArcCos}\left (\frac {1}{a}\right )+2 i \tanh ^{-1}\left (\frac {(1+a) \cot \left (\frac {1}{4} \left (\pi +2 \csc ^{-1}(a+b x)\right )\right )}{\sqrt {-1+a^2}}\right )-2 i \tanh ^{-1}\left (\frac {(-1+a) \tan \left (\frac {1}{4} \left (\pi +2 \csc ^{-1}(a+b x)\right )\right )}{\sqrt {-1+a^2}}\right )\right ) \log \left (\frac {\left (\frac {1}{2}-\frac {i}{2}\right ) \sqrt {-1+a^2} e^{\frac {1}{2} i \csc ^{-1}(a+b x)}}{\sqrt {a} \sqrt {-\frac {b x}{a+b x}}}\right )-\left (\text {ArcCos}\left (\frac {1}{a}\right )-2 i \tanh ^{-1}\left (\frac {(1+a) \cot \left (\frac {1}{4} \left (\pi +2 \csc ^{-1}(a+b x)\right )\right )}{\sqrt {-1+a^2}}\right )\right ) \log \left (\frac {(-1+a) \left (i+i a+\sqrt {-1+a^2}\right ) \left (-i+\cot \left (\frac {1}{4} \left (\pi +2 \csc ^{-1}(a+b x)\right )\right )\right )}{a \left (-1+a+\sqrt {-1+a^2} \cot \left (\frac {1}{4} \left (\pi +2 \csc ^{-1}(a+b x)\right )\right )\right )}\right )-\left (\text {ArcCos}\left (\frac {1}{a}\right )+2 i \tanh ^{-1}\left (\frac {(1+a) \cot \left (\frac {1}{4} \left (\pi +2 \csc ^{-1}(a+b x)\right )\right )}{\sqrt {-1+a^2}}\right )\right ) \log \left (\frac {(-1+a) \left (-i-i a+\sqrt {-1+a^2}\right ) \left (i+\cot \left (\frac {1}{4} \left (\pi +2 \csc ^{-1}(a+b x)\right )\right )\right )}{a \left (-1+a+\sqrt {-1+a^2} \cot \left (\frac {1}{4} \left (\pi +2 \csc ^{-1}(a+b x)\right )\right )\right )}\right )+i \left (-\text {PolyLog}\left (2,\frac {\left (1-i \sqrt {-1+a^2}\right ) \left (1-a+\sqrt {-1+a^2} \cot \left (\frac {1}{4} \left (\pi +2 \csc ^{-1}(a+b x)\right )\right )\right )}{a \left (-1+a+\sqrt {-1+a^2} \cot \left (\frac {1}{4} \left (\pi +2 \csc ^{-1}(a+b x)\right )\right )\right )}\right )+\text {PolyLog}\left (2,\frac {\left (1+i \sqrt {-1+a^2}\right ) \left (1-a+\sqrt {-1+a^2} \cot \left (\frac {1}{4} \left (\pi +2 \csc ^{-1}(a+b x)\right )\right )\right )}{a \left (-1+a+\sqrt {-1+a^2} \cot \left (\frac {1}{4} \left (\pi +2 \csc ^{-1}(a+b x)\right )\right )\right )}\right )\right )\right )}{\sqrt {-1+a^2}}\right )}{a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 6.84, size = 302, normalized size = 1.19
method | result | size |
derivativedivides | \(b \left (-\frac {\left (b x +a \right ) \mathrm {arccsc}\left (b x +a \right )^{2}}{b x a}-\frac {2 \,\mathrm {arccsc}\left (b x +a \right ) \ln \left (\frac {-\left (\frac {i}{b x +a}+\sqrt {1-\frac {1}{\left (b x +a \right )^{2}}}\right ) a +\sqrt {a^{2}-1}+i}{i+\sqrt {a^{2}-1}}\right )}{a \sqrt {a^{2}-1}}+\frac {2 \,\mathrm {arccsc}\left (b x +a \right ) \ln \left (\frac {\left (\frac {i}{b x +a}+\sqrt {1-\frac {1}{\left (b x +a \right )^{2}}}\right ) a +\sqrt {a^{2}-1}-i}{-i+\sqrt {a^{2}-1}}\right )}{a \sqrt {a^{2}-1}}+\frac {2 i \dilog \left (\frac {-\left (\frac {i}{b x +a}+\sqrt {1-\frac {1}{\left (b x +a \right )^{2}}}\right ) a +\sqrt {a^{2}-1}+i}{i+\sqrt {a^{2}-1}}\right )}{a \sqrt {a^{2}-1}}-\frac {2 i \dilog \left (\frac {\left (\frac {i}{b x +a}+\sqrt {1-\frac {1}{\left (b x +a \right )^{2}}}\right ) a +\sqrt {a^{2}-1}-i}{-i+\sqrt {a^{2}-1}}\right )}{a \sqrt {a^{2}-1}}\right )\) | \(292\) |
default | \(b \left (-\frac {\left (b x +a \right ) \mathrm {arccsc}\left (b x +a \right )^{2}}{b x a}-\frac {2 \,\mathrm {arccsc}\left (b x +a \right ) \ln \left (\frac {-\left (\frac {i}{b x +a}+\sqrt {1-\frac {1}{\left (b x +a \right )^{2}}}\right ) a +\sqrt {a^{2}-1}+i}{i+\sqrt {a^{2}-1}}\right )}{a \sqrt {a^{2}-1}}+\frac {2 \,\mathrm {arccsc}\left (b x +a \right ) \ln \left (\frac {-\left (\frac {i}{b x +a}+\sqrt {1-\frac {1}{\left (b x +a \right )^{2}}}\right ) a +i-\sqrt {a^{2}-1}}{i-\sqrt {a^{2}-1}}\right )}{a \sqrt {a^{2}-1}}+\frac {2 i \dilog \left (\frac {-\left (\frac {i}{b x +a}+\sqrt {1-\frac {1}{\left (b x +a \right )^{2}}}\right ) a +\sqrt {a^{2}-1}+i}{i+\sqrt {a^{2}-1}}\right )}{a \sqrt {a^{2}-1}}-\frac {2 i \dilog \left (\frac {-\left (\frac {i}{b x +a}+\sqrt {1-\frac {1}{\left (b x +a \right )^{2}}}\right ) a +i-\sqrt {a^{2}-1}}{i-\sqrt {a^{2}-1}}\right )}{a \sqrt {a^{2}-1}}\right )\) | \(302\) |
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 {acsc}^{2}{\left (a + b 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.00 \begin {gather*} \int \frac {{\mathrm {asin}\left (\frac {1}{a+b\,x}\right )}^2}{x^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________