Optimal. Leaf size=174 \[ x \cot ^{-1}(c+d \coth (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 {PolyLog}\left (2,\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )}{4 b}+\frac {i \text {PolyLog}\left (2,\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )}{4 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.17, antiderivative size = 174, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 4, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {5302, 2221,
2317, 2438} \begin {gather*} -\frac {i \text {Li}_2\left (\frac {(-c-d+i) e^{2 a+2 b x}}{-c+d+i}\right )}{4 b}+\frac {i \text {Li}_2\left (\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 \coth (a+b x)+c) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2221
Rule 2317
Rule 2438
Rule 5302
Rubi steps
\begin {align*} \int \cot ^{-1}(c+d \coth (a+b x)) \, dx &=x \cot ^{-1}(c+d \coth (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 \coth (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 \coth (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 \coth (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 {Li}_2\left (\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )}{4 b}+\frac {i \text {Li}_2\left (\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )}{4 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(363\) vs. \(2(174)=348\).
time = 0.78, size = 363, normalized size = 2.09 \begin {gather*} x \cot ^{-1}(c+d \coth (a+b x))-\frac {i \left (2 i a \text {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 )+(a+b x) \log \left (1-\frac {\sqrt {-i+c+d} e^{a+b x}}{\sqrt {-i+c-d}}\right )+(a+b x) \log \left (1+\frac {\sqrt {-i+c+d} e^{a+b x}}{\sqrt {-i+c-d}}\right )-(a+b x) \log \left (1-\frac {\sqrt {i+c+d} e^{a+b x}}{\sqrt {i+c-d}}\right )-(a+b x) \log \left (1+\frac {\sqrt {i+c+d} e^{a+b x}}{\sqrt {i+c-d}}\right )+\text {PolyLog}\left (2,-\frac {\sqrt {-i+c+d} e^{a+b x}}{\sqrt {-i+c-d}}\right )+\text {PolyLog}\left (2,\frac {\sqrt {-i+c+d} e^{a+b x}}{\sqrt {-i+c-d}}\right )-\text {PolyLog}\left (2,-\frac {\sqrt {i+c+d} e^{a+b x}}{\sqrt {i+c-d}}\right )-\text {PolyLog}\left (2,\frac {\sqrt {i+c+d} e^{a+b x}}{\sqrt {i+c-d}}\right )\right )}{2 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 364 vs. \(2 (150 ) = 300\).
time = 0.96, size = 365, normalized size = 2.10
method | result | size |
derivativedivides | \(\frac {-\frac {\mathrm {arccot}\left (c +d \coth \left (b x +a \right )\right ) d \ln \left (-d \coth \left (b x +a \right )+d \right )}{2}+\frac {\mathrm {arccot}\left (c +d \coth \left (b x +a \right )\right ) d \ln \left (-d \coth \left (b x +a \right )-d \right )}{2}-\frac {d^{2} \left (\frac {i \ln \left (-d \coth \left (b x +a \right )+d \right ) \ln \left (\frac {i+d \coth \left (b x +a \right )+c}{i+c +d}\right )}{2 d}-\frac {i \ln \left (-d \coth \left (b x +a \right )+d \right ) \ln \left (\frac {i-d \coth \left (b x +a \right )-c}{i-c -d}\right )}{2 d}+\frac {i \dilog \left (\frac {i+d \coth \left (b x +a \right )+c}{i+c +d}\right )}{2 d}-\frac {i \dilog \left (\frac {i-d \coth \left (b x +a \right )-c}{i-c -d}\right )}{2 d}-\frac {i \ln \left (-d \coth \left (b x +a \right )-d \right ) \ln \left (\frac {i+d \coth \left (b x +a \right )+c}{i+c -d}\right )}{2 d}+\frac {i \ln \left (-d \coth \left (b x +a \right )-d \right ) \ln \left (\frac {i-d \coth \left (b x +a \right )-c}{i-c +d}\right )}{2 d}-\frac {i \dilog \left (\frac {i+d \coth \left (b x +a \right )+c}{i+c -d}\right )}{2 d}+\frac {i \dilog \left (\frac {i-d \coth \left (b x +a \right )-c}{i-c +d}\right )}{2 d}\right )}{2}}{b d}\) | \(365\) |
default | \(\frac {-\frac {\mathrm {arccot}\left (c +d \coth \left (b x +a \right )\right ) d \ln \left (-d \coth \left (b x +a \right )+d \right )}{2}+\frac {\mathrm {arccot}\left (c +d \coth \left (b x +a \right )\right ) d \ln \left (-d \coth \left (b x +a \right )-d \right )}{2}-\frac {d^{2} \left (\frac {i \ln \left (-d \coth \left (b x +a \right )+d \right ) \ln \left (\frac {i+d \coth \left (b x +a \right )+c}{i+c +d}\right )}{2 d}-\frac {i \ln \left (-d \coth \left (b x +a \right )+d \right ) \ln \left (\frac {i-d \coth \left (b x +a \right )-c}{i-c -d}\right )}{2 d}+\frac {i \dilog \left (\frac {i+d \coth \left (b x +a \right )+c}{i+c +d}\right )}{2 d}-\frac {i \dilog \left (\frac {i-d \coth \left (b x +a \right )-c}{i-c -d}\right )}{2 d}-\frac {i \ln \left (-d \coth \left (b x +a \right )-d \right ) \ln \left (\frac {i+d \coth \left (b x +a \right )+c}{i+c -d}\right )}{2 d}+\frac {i \ln \left (-d \coth \left (b x +a \right )-d \right ) \ln \left (\frac {i-d \coth \left (b x +a \right )-c}{i-c +d}\right )}{2 d}-\frac {i \dilog \left (\frac {i+d \coth \left (b x +a \right )+c}{i+c -d}\right )}{2 d}+\frac {i \dilog \left (\frac {i-d \coth \left (b x +a \right )-c}{i-c +d}\right )}{2 d}\right )}{2}}{b d}\) | \(365\) |
risch | \(\text {Expression too large to display}\) | \(4102\) |
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 [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 813 vs. \(2 (128) = 256\).
time = 3.83, size = 813, normalized size = 4.67 \begin {gather*} \frac {2 \, b x \arctan \left (\frac {\sinh \left (b x + a\right )}{d \cosh \left (b x + a\right ) + c \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} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \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.01 \begin {gather*} \int \mathrm {acot}\left (c+d\,\mathrm {coth}\left (a+b\,x\right )\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________