Optimal. Leaf size=174 \[ 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 {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.16, 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 = {5300, 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 \tanh (a+b x)+c) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2221
Rule 2317
Rule 2438
Rule 5300
Rubi steps
\begin {align*} \int \cot ^{-1}(c+d \tanh (a+b x)) \, dx &=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 \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.84, size = 363, normalized size = 2.09 \begin {gather*} x \cot ^{-1}(c+d \tanh (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.94, size = 365, normalized size = 2.10
method | result | size |
derivativedivides | \(\frac {-\frac {\mathrm {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 {\mathrm {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 {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 d}-\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 d}+\frac {i \dilog \left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c +d}\right )}{2 d}-\frac {i \dilog \left (\frac {i-d \tanh \left (b x +a \right )-c}{i-c -d}\right )}{2 d}-\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 d}+\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 d}-\frac {i \dilog \left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c -d}\right )}{2 d}+\frac {i \dilog \left (\frac {i-d \tanh \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 \tanh \left (b x +a \right )\right ) d \ln \left (-d \tanh \left (b x +a \right )+d \right )}{2}+\frac {\mathrm {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 {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 d}-\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 d}+\frac {i \dilog \left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c +d}\right )}{2 d}-\frac {i \dilog \left (\frac {i-d \tanh \left (b x +a \right )-c}{i-c -d}\right )}{2 d}-\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 d}+\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 d}-\frac {i \dilog \left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c -d}\right )}{2 d}+\frac {i \dilog \left (\frac {i-d \tanh \left (b x +a \right )-c}{i-c +d}\right )}{2 d}\right )}{2}}{b d}\) | \(365\) |
risch | \(\text {Expression too large to display}\) | \(4171\) |
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. 825 vs. \(2 (128) = 256\).
time = 1.70, size = 825, normalized size = 4.74 \begin {gather*} \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} \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 \operatorname {acot}{\left (c + d \tanh {\left (a + b x \right )} \right )}\, 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.01 \begin {gather*} \int \mathrm {acot}\left (c+d\,\mathrm {tanh}\left (a+b\,x\right )\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________