Integrand size = 12, antiderivative size = 254 \[ \int \frac {\csc ^{-1}(a+b x)^2}{x^2} \, dx=-\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 \operatorname {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 \operatorname {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]
Time = 0.33 (sec) , antiderivative size = 254, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.667, Rules used = {5367, 4512, 4276, 3404, 2296, 2221, 2317, 2438} \[ \int \frac {\csc ^{-1}(a+b x)^2}{x^2} \, dx=-\frac {2 b \operatorname {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 \operatorname {PolyLog}\left (2,-\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} \]
[In]
[Out]
Rule 2221
Rule 2296
Rule 2317
Rule 2438
Rule 3404
Rule 4276
Rule 4512
Rule 5367
Rubi steps \begin{align*} \text {integral}& = -\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 \operatorname {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 \operatorname {PolyLog}\left (2,-\frac {i a e^{i \csc ^{-1}(a+b x)}}{1+\sqrt {1-a^2}}\right )}{a \sqrt {1-a^2}} \\ \end{align*}
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.49 (sec) , antiderivative size = 802, normalized size of antiderivative = 3.16 \[ \int \frac {\csc ^{-1}(a+b x)^2}{x^2} \, dx=-\frac {b \left (\frac {(a+b x) \csc ^{-1}(a+b x)^2}{b x}+\frac {2 \pi \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 \arccos \left (\frac {1}{a}\right ) \text {arctanh}\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 ) \text {arctanh}\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 (\arccos \left (\frac {1}{a}\right )+2 i \left (-\text {arctanh}\left (\frac {(1+a) \cot \left (\frac {1}{4} \left (\pi +2 \csc ^{-1}(a+b x)\right )\right )}{\sqrt {-1+a^2}}\right )+\text {arctanh}\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 (\arccos \left (\frac {1}{a}\right )+2 i \text {arctanh}\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 \text {arctanh}\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 (\arccos \left (\frac {1}{a}\right )-2 i \text {arctanh}\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 (\arccos \left (\frac {1}{a}\right )+2 i \text {arctanh}\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 (-\operatorname {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 )+\operatorname {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} \]
[In]
[Out]
Time = 1.64 (sec) , antiderivative size = 302, normalized size of antiderivative = 1.19
method | result | size |
derivativedivides | \(b \left (-\frac {\left (b x +a \right ) \operatorname {arccsc}\left (b x +a \right )^{2}}{a b x}-\frac {2 \,\operatorname {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 \,\operatorname {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 \operatorname {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 \operatorname {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\) |
default | \(b \left (-\frac {\left (b x +a \right ) \operatorname {arccsc}\left (b x +a \right )^{2}}{a b x}-\frac {2 \,\operatorname {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 \,\operatorname {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 \operatorname {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 \operatorname {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\) |
[In]
[Out]
\[ \int \frac {\csc ^{-1}(a+b x)^2}{x^2} \, dx=\int { \frac {\operatorname {arccsc}\left (b x + a\right )^{2}}{x^{2}} \,d x } \]
[In]
[Out]
\[ \int \frac {\csc ^{-1}(a+b x)^2}{x^2} \, dx=\int \frac {\operatorname {acsc}^{2}{\left (a + b x \right )}}{x^{2}}\, dx \]
[In]
[Out]
\[ \int \frac {\csc ^{-1}(a+b x)^2}{x^2} \, dx=\int { \frac {\operatorname {arccsc}\left (b x + a\right )^{2}}{x^{2}} \,d x } \]
[In]
[Out]
\[ \int \frac {\csc ^{-1}(a+b x)^2}{x^2} \, dx=\int { \frac {\operatorname {arccsc}\left (b x + a\right )^{2}}{x^{2}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {\csc ^{-1}(a+b x)^2}{x^2} \, dx=\int \frac {{\mathrm {asin}\left (\frac {1}{a+b\,x}\right )}^2}{x^2} \,d x \]
[In]
[Out]