Integrand size = 13, antiderivative size = 159 \[ \int (e+f x) \cot ^{-1}(\coth (a+b x)) \, dx=\frac {(e+f x)^2 \cot ^{-1}(\coth (a+b x))}{2 f}-\frac {(e+f x)^2 \arctan \left (e^{2 a+2 b x}\right )}{2 f}+\frac {i (e+f x) \operatorname {PolyLog}\left (2,-i e^{2 a+2 b x}\right )}{4 b}-\frac {i (e+f x) \operatorname {PolyLog}\left (2,i e^{2 a+2 b x}\right )}{4 b}-\frac {i f \operatorname {PolyLog}\left (3,-i e^{2 a+2 b x}\right )}{8 b^2}+\frac {i f \operatorname {PolyLog}\left (3,i e^{2 a+2 b x}\right )}{8 b^2} \]
[Out]
Time = 0.07 (sec) , antiderivative size = 159, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {5294, 4265, 2611, 2320, 6724} \[ \int (e+f x) \cot ^{-1}(\coth (a+b x)) \, dx=-\frac {(e+f x)^2 \arctan \left (e^{2 a+2 b x}\right )}{2 f}-\frac {i f \operatorname {PolyLog}\left (3,-i e^{2 a+2 b x}\right )}{8 b^2}+\frac {i f \operatorname {PolyLog}\left (3,i e^{2 a+2 b x}\right )}{8 b^2}+\frac {i (e+f x) \operatorname {PolyLog}\left (2,-i e^{2 a+2 b x}\right )}{4 b}-\frac {i (e+f x) \operatorname {PolyLog}\left (2,i e^{2 a+2 b x}\right )}{4 b}+\frac {(e+f x)^2 \cot ^{-1}(\coth (a+b x))}{2 f} \]
[In]
[Out]
Rule 2320
Rule 2611
Rule 4265
Rule 5294
Rule 6724
Rubi steps \begin{align*} \text {integral}& = \frac {(e+f x)^2 \cot ^{-1}(\coth (a+b x))}{2 f}-\frac {b \int (e+f x)^2 \text {sech}(2 a+2 b x) \, dx}{2 f} \\ & = \frac {(e+f x)^2 \cot ^{-1}(\coth (a+b x))}{2 f}-\frac {(e+f x)^2 \arctan \left (e^{2 a+2 b x}\right )}{2 f}+\frac {1}{2} i \int (e+f x) \log \left (1-i e^{2 a+2 b x}\right ) \, dx-\frac {1}{2} i \int (e+f x) \log \left (1+i e^{2 a+2 b x}\right ) \, dx \\ & = \frac {(e+f x)^2 \cot ^{-1}(\coth (a+b x))}{2 f}-\frac {(e+f x)^2 \arctan \left (e^{2 a+2 b x}\right )}{2 f}+\frac {i (e+f x) \operatorname {PolyLog}\left (2,-i e^{2 a+2 b x}\right )}{4 b}-\frac {i (e+f x) \operatorname {PolyLog}\left (2,i e^{2 a+2 b x}\right )}{4 b}-\frac {(i f) \int \operatorname {PolyLog}\left (2,-i e^{2 a+2 b x}\right ) \, dx}{4 b}+\frac {(i f) \int \operatorname {PolyLog}\left (2,i e^{2 a+2 b x}\right ) \, dx}{4 b} \\ & = \frac {(e+f x)^2 \cot ^{-1}(\coth (a+b x))}{2 f}-\frac {(e+f x)^2 \arctan \left (e^{2 a+2 b x}\right )}{2 f}+\frac {i (e+f x) \operatorname {PolyLog}\left (2,-i e^{2 a+2 b x}\right )}{4 b}-\frac {i (e+f x) \operatorname {PolyLog}\left (2,i e^{2 a+2 b x}\right )}{4 b}-\frac {(i f) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,-i x)}{x} \, dx,x,e^{2 a+2 b x}\right )}{8 b^2}+\frac {(i f) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,i x)}{x} \, dx,x,e^{2 a+2 b x}\right )}{8 b^2} \\ & = \frac {(e+f x)^2 \cot ^{-1}(\coth (a+b x))}{2 f}-\frac {(e+f x)^2 \arctan \left (e^{2 a+2 b x}\right )}{2 f}+\frac {i (e+f x) \operatorname {PolyLog}\left (2,-i e^{2 a+2 b x}\right )}{4 b}-\frac {i (e+f x) \operatorname {PolyLog}\left (2,i e^{2 a+2 b x}\right )}{4 b}-\frac {i f \operatorname {PolyLog}\left (3,-i e^{2 a+2 b x}\right )}{8 b^2}+\frac {i f \operatorname {PolyLog}\left (3,i e^{2 a+2 b x}\right )}{8 b^2} \\ \end{align*}
Time = 0.10 (sec) , antiderivative size = 237, normalized size of antiderivative = 1.49 \[ \int (e+f x) \cot ^{-1}(\coth (a+b x)) \, dx=e x \cot ^{-1}(\coth (a+b x))+\frac {1}{2} f x^2 \cot ^{-1}(\coth (a+b x))-\frac {i e \left (2 b x \left (\log \left (1-i e^{2 (a+b x)}\right )-\log \left (1+i e^{2 (a+b x)}\right )\right )-\operatorname {PolyLog}\left (2,-i e^{2 (a+b x)}\right )+\operatorname {PolyLog}\left (2,i e^{2 (a+b x)}\right )\right )}{4 b}-\frac {i f \left (2 b^2 x^2 \log \left (1-i e^{2 (a+b x)}\right )-2 b^2 x^2 \log \left (1+i e^{2 (a+b x)}\right )-2 b x \operatorname {PolyLog}\left (2,-i e^{2 (a+b x)}\right )+2 b x \operatorname {PolyLog}\left (2,i e^{2 (a+b x)}\right )+\operatorname {PolyLog}\left (3,-i e^{2 (a+b x)}\right )-\operatorname {PolyLog}\left (3,i e^{2 (a+b x)}\right )\right )}{8 b^2} \]
[In]
[Out]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 2.32 (sec) , antiderivative size = 1776, normalized size of antiderivative = 11.17
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 600 vs. \(2 (130) = 260\).
Time = 0.32 (sec) , antiderivative size = 600, normalized size of antiderivative = 3.77 \[ \int (e+f x) \cot ^{-1}(\coth (a+b x)) \, dx=\frac {2 \, {\left (b^{2} f x^{2} + 2 \, b^{2} e x\right )} \arctan \left (\frac {\sinh \left (b x + a\right )}{\cosh \left (b x + a\right )}\right ) - 2 \, {\left (i \, b f x + i \, b e\right )} {\rm Li}_2\left (\frac {1}{2} \, \sqrt {4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right ) - 2 \, {\left (i \, b f x + i \, b e\right )} {\rm Li}_2\left (-\frac {1}{2} \, \sqrt {4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right ) - 2 \, {\left (-i \, b f x - i \, b e\right )} {\rm Li}_2\left (\frac {1}{2} \, \sqrt {-4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right ) - 2 \, {\left (-i \, b f x - i \, b e\right )} {\rm Li}_2\left (-\frac {1}{2} \, \sqrt {-4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right ) + {\left (-i \, b^{2} f x^{2} - 2 i \, b^{2} e x - 2 i \, a b e + i \, a^{2} f\right )} \log \left (\frac {1}{2} \, \sqrt {4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )} + 1\right ) + {\left (-i \, b^{2} f x^{2} - 2 i \, b^{2} e x - 2 i \, a b e + i \, a^{2} f\right )} \log \left (-\frac {1}{2} \, \sqrt {4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )} + 1\right ) + {\left (i \, b^{2} f x^{2} + 2 i \, b^{2} e x + 2 i \, a b e - i \, a^{2} f\right )} \log \left (\frac {1}{2} \, \sqrt {-4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )} + 1\right ) + {\left (i \, b^{2} f x^{2} + 2 i \, b^{2} e x + 2 i \, a b e - i \, a^{2} f\right )} \log \left (-\frac {1}{2} \, \sqrt {-4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )} + 1\right ) + {\left (2 i \, a b e - i \, a^{2} f\right )} \log \left (i \, \sqrt {4 i} + 2 \, \cosh \left (b x + a\right ) + 2 \, \sinh \left (b x + a\right )\right ) + {\left (2 i \, a b e - i \, a^{2} f\right )} \log \left (-i \, \sqrt {4 i} + 2 \, \cosh \left (b x + a\right ) + 2 \, \sinh \left (b x + a\right )\right ) + {\left (-2 i \, a b e + i \, a^{2} f\right )} \log \left (i \, \sqrt {-4 i} + 2 \, \cosh \left (b x + a\right ) + 2 \, \sinh \left (b x + a\right )\right ) + {\left (-2 i \, a b e + i \, a^{2} f\right )} \log \left (-i \, \sqrt {-4 i} + 2 \, \cosh \left (b x + a\right ) + 2 \, \sinh \left (b x + a\right )\right ) + 2 i \, f {\rm polylog}\left (3, \frac {1}{2} \, \sqrt {4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right ) + 2 i \, f {\rm polylog}\left (3, -\frac {1}{2} \, \sqrt {4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right ) - 2 i \, f {\rm polylog}\left (3, \frac {1}{2} \, \sqrt {-4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right ) - 2 i \, f {\rm polylog}\left (3, -\frac {1}{2} \, \sqrt {-4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right )}{4 \, b^{2}} \]
[In]
[Out]
\[ \int (e+f x) \cot ^{-1}(\coth (a+b x)) \, dx=\int \left (e + f x\right ) \operatorname {acot}{\left (\coth {\left (a + b x \right )} \right )}\, dx \]
[In]
[Out]
\[ \int (e+f x) \cot ^{-1}(\coth (a+b x)) \, dx=\int { {\left (f x + e\right )} \operatorname {arccot}\left (\coth \left (b x + a\right )\right ) \,d x } \]
[In]
[Out]
\[ \int (e+f x) \cot ^{-1}(\coth (a+b x)) \, dx=\int { {\left (f x + e\right )} \operatorname {arccot}\left (\coth \left (b x + a\right )\right ) \,d x } \]
[In]
[Out]
Timed out. \[ \int (e+f x) \cot ^{-1}(\coth (a+b x)) \, dx=\int \mathrm {acot}\left (\mathrm {coth}\left (a+b\,x\right )\right )\,\left (e+f\,x\right ) \,d x \]
[In]
[Out]