Integrand size = 11, antiderivative size = 174 \[ \int \cot ^{-1}(c+d \tanh (a+b x)) \, dx=x \cot ^{-1}(c+d \tanh (a+b x))-\frac {1}{2} i x \log \left (1+\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )+\frac {1}{2} i x \log \left (1+\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )-\frac {i \operatorname {PolyLog}\left (2,-\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )}{4 b}+\frac {i \operatorname {PolyLog}\left (2,-\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )}{4 b} \]
[Out]
Time = 0.17 (sec) , antiderivative size = 174, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {5300, 2221, 2317, 2438} \[ \int \cot ^{-1}(c+d \tanh (a+b x)) \, dx=-\frac {i \operatorname {PolyLog}\left (2,-\frac {(-c-d+i) e^{2 a+2 b x}}{-c+d+i}\right )}{4 b}+\frac {i \operatorname {PolyLog}\left (2,-\frac {(c+d+i) e^{2 a+2 b x}}{c-d+i}\right )}{4 b}-\frac {1}{2} i x \log \left (1+\frac {(-c-d+i) e^{2 a+2 b x}}{-c+d+i}\right )+\frac {1}{2} i x \log \left (1+\frac {(c+d+i) e^{2 a+2 b x}}{c-d+i}\right )+x \cot ^{-1}(d \tanh (a+b x)+c) \]
[In]
[Out]
Rule 2221
Rule 2317
Rule 2438
Rule 5300
Rubi steps \begin{align*} \text {integral}& = x \cot ^{-1}(c+d \tanh (a+b x))-(b (1-i (c+d))) \int \frac {e^{2 a+2 b x} x}{i+c-d+(i+c+d) e^{2 a+2 b x}} \, dx+(b (1+i (c+d))) \int \frac {e^{2 a+2 b x} x}{i-c+d+(i-c-d) e^{2 a+2 b x}} \, dx \\ & = x \cot ^{-1}(c+d \tanh (a+b x))-\frac {1}{2} i x \log \left (1+\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )+\frac {1}{2} i x \log \left (1+\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )+\frac {1}{2} i \int \log \left (1+\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right ) \, dx-\frac {1}{2} i \int \log \left (1+\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right ) \, dx \\ & = x \cot ^{-1}(c+d \tanh (a+b x))-\frac {1}{2} i x \log \left (1+\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )+\frac {1}{2} i x \log \left (1+\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )+\frac {i \text {Subst}\left (\int \frac {\log \left (1+\frac {(i-c-d) x}{i-c+d}\right )}{x} \, dx,x,e^{2 a+2 b x}\right )}{4 b}-\frac {i \text {Subst}\left (\int \frac {\log \left (1+\frac {(i+c+d) x}{i+c-d}\right )}{x} \, dx,x,e^{2 a+2 b x}\right )}{4 b} \\ & = x \cot ^{-1}(c+d \tanh (a+b x))-\frac {1}{2} i x \log \left (1+\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )+\frac {1}{2} i x \log \left (1+\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )-\frac {i \operatorname {PolyLog}\left (2,-\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )}{4 b}+\frac {i \operatorname {PolyLog}\left (2,-\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )}{4 b} \\ \end{align*}
Time = 0.27 (sec) , antiderivative size = 288, normalized size of antiderivative = 1.66 \[ \int \cot ^{-1}(c+d \tanh (a+b x)) \, dx=x \cot ^{-1}(c+d \tanh (a+b x))-\frac {4 a \sqrt {-d^2} \arctan \left (\frac {1+c^2-d^2+\left (1+c^2+2 c d+d^2\right ) e^{2 (a+b x)}}{2 d}\right )-2 d (a+b x) \log \left (1+\frac {2 \left (1+(c+d)^2\right ) e^{2 (a+b x)}}{2+2 c^2-2 d^2-4 \sqrt {-d^2}}\right )+2 d (a+b x) \log \left (1+\frac {\left (1+(c+d)^2\right ) e^{2 (a+b x)}}{1+c^2-d^2+2 \sqrt {-d^2}}\right )+d \operatorname {PolyLog}\left (2,-\frac {\left (1+c^2+2 c d+d^2\right ) e^{2 (a+b x)}}{1+c^2-d^2+2 \sqrt {-d^2}}\right )-d \operatorname {PolyLog}\left (2,\frac {\left (1+c^2+2 c d+d^2\right ) e^{2 (a+b x)}}{-1-c^2+d^2+2 \sqrt {-d^2}}\right )}{4 b \sqrt {-d^2}} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 351 vs. \(2 (150 ) = 300\).
Time = 3.03 (sec) , antiderivative size = 352, normalized size of antiderivative = 2.02
method | result | size |
derivativedivides | \(\frac {\frac {\operatorname {arccot}\left (c +d \tanh \left (b x +a \right )\right ) d \ln \left (-d \tanh \left (b x +a \right )-d \right )}{2}-\frac {\operatorname {arccot}\left (c +d \tanh \left (b x +a \right )\right ) d \ln \left (-d \tanh \left (b x +a \right )+d \right )}{2}-\frac {d^{2} \left (\frac {\frac {i \ln \left (-d \tanh \left (b x +a \right )+d \right ) \ln \left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c +d}\right )}{2}-\frac {i \ln \left (-d \tanh \left (b x +a \right )+d \right ) \ln \left (\frac {i-d \tanh \left (b x +a \right )-c}{i-c -d}\right )}{2}+\frac {i \operatorname {dilog}\left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c +d}\right )}{2}-\frac {i \operatorname {dilog}\left (\frac {i-d \tanh \left (b x +a \right )-c}{i-c -d}\right )}{2}}{d}-\frac {\frac {i \ln \left (-d \tanh \left (b x +a \right )-d \right ) \ln \left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c -d}\right )}{2}-\frac {i \ln \left (-d \tanh \left (b x +a \right )-d \right ) \ln \left (\frac {i-d \tanh \left (b x +a \right )-c}{i-c +d}\right )}{2}+\frac {i \operatorname {dilog}\left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c -d}\right )}{2}-\frac {i \operatorname {dilog}\left (\frac {i-d \tanh \left (b x +a \right )-c}{i-c +d}\right )}{2}}{d}\right )}{2}}{b d}\) | \(352\) |
default | \(\frac {\frac {\operatorname {arccot}\left (c +d \tanh \left (b x +a \right )\right ) d \ln \left (-d \tanh \left (b x +a \right )-d \right )}{2}-\frac {\operatorname {arccot}\left (c +d \tanh \left (b x +a \right )\right ) d \ln \left (-d \tanh \left (b x +a \right )+d \right )}{2}-\frac {d^{2} \left (\frac {\frac {i \ln \left (-d \tanh \left (b x +a \right )+d \right ) \ln \left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c +d}\right )}{2}-\frac {i \ln \left (-d \tanh \left (b x +a \right )+d \right ) \ln \left (\frac {i-d \tanh \left (b x +a \right )-c}{i-c -d}\right )}{2}+\frac {i \operatorname {dilog}\left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c +d}\right )}{2}-\frac {i \operatorname {dilog}\left (\frac {i-d \tanh \left (b x +a \right )-c}{i-c -d}\right )}{2}}{d}-\frac {\frac {i \ln \left (-d \tanh \left (b x +a \right )-d \right ) \ln \left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c -d}\right )}{2}-\frac {i \ln \left (-d \tanh \left (b x +a \right )-d \right ) \ln \left (\frac {i-d \tanh \left (b x +a \right )-c}{i-c +d}\right )}{2}+\frac {i \operatorname {dilog}\left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c -d}\right )}{2}-\frac {i \operatorname {dilog}\left (\frac {i-d \tanh \left (b x +a \right )-c}{i-c +d}\right )}{2}}{d}\right )}{2}}{b d}\) | \(352\) |
risch | \(\text {Expression too large to display}\) | \(4201\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 825 vs. \(2 (128) = 256\).
Time = 0.40 (sec) , antiderivative size = 825, normalized size of antiderivative = 4.74 \[ \int \cot ^{-1}(c+d \tanh (a+b x)) \, dx=\frac {2 \, b x \arctan \left (\frac {\cosh \left (b x + a\right )}{c \cosh \left (b x + a\right ) + d \sinh \left (b x + a\right )}\right ) + i \, a \log \left (2 \, {\left (c^{2} + 2 \, c d + d^{2} + 1\right )} \cosh \left (b x + a\right ) + 2 \, {\left (c^{2} + 2 \, c d + d^{2} + 1\right )} \sinh \left (b x + a\right ) + 2 \, {\left (c^{2} - d^{2} - 2 i \, d + 1\right )} \sqrt {-\frac {c^{2} - d^{2} + 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}}\right ) + i \, a \log \left (2 \, {\left (c^{2} + 2 \, c d + d^{2} + 1\right )} \cosh \left (b x + a\right ) + 2 \, {\left (c^{2} + 2 \, c d + d^{2} + 1\right )} \sinh \left (b x + a\right ) - 2 \, {\left (c^{2} - d^{2} - 2 i \, d + 1\right )} \sqrt {-\frac {c^{2} - d^{2} + 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}}\right ) - i \, a \log \left (2 \, {\left (c^{2} + 2 \, c d + d^{2} + 1\right )} \cosh \left (b x + a\right ) + 2 \, {\left (c^{2} + 2 \, c d + d^{2} + 1\right )} \sinh \left (b x + a\right ) + 2 \, {\left (c^{2} - d^{2} + 2 i \, d + 1\right )} \sqrt {-\frac {c^{2} - d^{2} - 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}}\right ) - i \, a \log \left (2 \, {\left (c^{2} + 2 \, c d + d^{2} + 1\right )} \cosh \left (b x + a\right ) + 2 \, {\left (c^{2} + 2 \, c d + d^{2} + 1\right )} \sinh \left (b x + a\right ) - 2 \, {\left (c^{2} - d^{2} + 2 i \, d + 1\right )} \sqrt {-\frac {c^{2} - d^{2} - 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}}\right ) + {\left (-i \, b x - i \, a\right )} \log \left (\sqrt {-\frac {c^{2} - d^{2} + 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )} + 1\right ) + {\left (-i \, b x - i \, a\right )} \log \left (-\sqrt {-\frac {c^{2} - d^{2} + 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )} + 1\right ) + {\left (i \, b x + i \, a\right )} \log \left (\sqrt {-\frac {c^{2} - d^{2} - 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )} + 1\right ) + {\left (i \, b x + i \, a\right )} \log \left (-\sqrt {-\frac {c^{2} - d^{2} - 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )} + 1\right ) - i \, {\rm Li}_2\left (\sqrt {-\frac {c^{2} - d^{2} + 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right ) - i \, {\rm Li}_2\left (-\sqrt {-\frac {c^{2} - d^{2} + 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right ) + i \, {\rm Li}_2\left (\sqrt {-\frac {c^{2} - d^{2} - 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right ) + i \, {\rm Li}_2\left (-\sqrt {-\frac {c^{2} - d^{2} - 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right )}{2 \, b} \]
[In]
[Out]
\[ \int \cot ^{-1}(c+d \tanh (a+b x)) \, dx=\int \operatorname {acot}{\left (c + d \tanh {\left (a + b x \right )} \right )}\, dx \]
[In]
[Out]
\[ \int \cot ^{-1}(c+d \tanh (a+b x)) \, dx=\int { \operatorname {arccot}\left (d \tanh \left (b x + a\right ) + c\right ) \,d x } \]
[In]
[Out]
\[ \int \cot ^{-1}(c+d \tanh (a+b x)) \, dx=\int { \operatorname {arccot}\left (d \tanh \left (b x + a\right ) + c\right ) \,d x } \]
[In]
[Out]
Timed out. \[ \int \cot ^{-1}(c+d \tanh (a+b x)) \, dx=\int \mathrm {acot}\left (c+d\,\mathrm {tanh}\left (a+b\,x\right )\right ) \,d x \]
[In]
[Out]