Optimal. Leaf size=265 \[ \frac {1}{2} x^2 \cot ^{-1}(c+d \coth (a+b x))-\frac {1}{4} i x^2 \log \left (1-\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )+\frac {1}{4} i x^2 \log \left (1-\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )-\frac {i x \text {PolyLog}\left (2,\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )}{4 b}+\frac {i x \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 (3,\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )}{8 b^2}-\frac {i \text {PolyLog}\left (3,\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )}{8 b^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.30, antiderivative size = 265, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 5, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {5310, 2221,
2611, 2320, 6724} \begin {gather*} \frac {i \text {Li}_3\left (\frac {(-c-d+i) e^{2 a+2 b x}}{-c+d+i}\right )}{8 b^2}-\frac {i \text {Li}_3\left (\frac {(c+d+i) e^{2 a+2 b x}}{c-d+i}\right )}{8 b^2}-\frac {i x \text {Li}_2\left (\frac {(-c-d+i) e^{2 a+2 b x}}{-c+d+i}\right )}{4 b}+\frac {i x \text {Li}_2\left (\frac {(c+d+i) e^{2 a+2 b x}}{c-d+i}\right )}{4 b}-\frac {1}{4} i x^2 \log \left (1-\frac {(-c-d+i) e^{2 a+2 b x}}{-c+d+i}\right )+\frac {1}{4} i x^2 \log \left (1-\frac {(c+d+i) e^{2 a+2 b x}}{c-d+i}\right )+\frac {1}{2} x^2 \cot ^{-1}(d \coth (a+b x)+c) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2221
Rule 2320
Rule 2611
Rule 5310
Rule 6724
Rubi steps
\begin {align*} \int x \cot ^{-1}(c+d \coth (a+b x)) \, dx &=\frac {1}{2} x^2 \cot ^{-1}(c+d \coth (a+b x))+\frac {1}{2} (b (1-i (c+d))) \int \frac {e^{2 a+2 b x} x^2}{i+c-d+(-i-c-d) e^{2 a+2 b x}} \, dx-\frac {1}{2} (b (1+i (c+d))) \int \frac {e^{2 a+2 b x} x^2}{i-c+d+(-i+c+d) e^{2 a+2 b x}} \, dx\\ &=\frac {1}{2} x^2 \cot ^{-1}(c+d \coth (a+b x))-\frac {1}{4} i x^2 \log \left (1-\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )+\frac {1}{4} i x^2 \log \left (1-\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )-\frac {1}{2} i \int x \log \left (1+\frac {(-i-c-d) e^{2 a+2 b x}}{i+c-d}\right ) \, dx+\frac {1}{2} i \int x \log \left (1+\frac {(-i+c+d) e^{2 a+2 b x}}{i-c+d}\right ) \, dx\\ &=\frac {1}{2} x^2 \cot ^{-1}(c+d \coth (a+b x))-\frac {1}{4} i x^2 \log \left (1-\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )+\frac {1}{4} i x^2 \log \left (1-\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )-\frac {i x \text {Li}_2\left (\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )}{4 b}+\frac {i x \text {Li}_2\left (\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )}{4 b}-\frac {i \int \text {Li}_2\left (-\frac {(-i-c-d) e^{2 a+2 b x}}{i+c-d}\right ) \, dx}{4 b}+\frac {i \int \text {Li}_2\left (-\frac {(-i+c+d) e^{2 a+2 b x}}{i-c+d}\right ) \, dx}{4 b}\\ &=\frac {1}{2} x^2 \cot ^{-1}(c+d \coth (a+b x))-\frac {1}{4} i x^2 \log \left (1-\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )+\frac {1}{4} i x^2 \log \left (1-\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )-\frac {i x \text {Li}_2\left (\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )}{4 b}+\frac {i x \text {Li}_2\left (\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )}{4 b}+\frac {i \text {Subst}\left (\int \frac {\text {Li}_2\left (\frac {(-i+c+d) x}{-i+c-d}\right )}{x} \, dx,x,e^{2 a+2 b x}\right )}{8 b^2}-\frac {i \text {Subst}\left (\int \frac {\text {Li}_2\left (\frac {(i+c+d) x}{i+c-d}\right )}{x} \, dx,x,e^{2 a+2 b x}\right )}{8 b^2}\\ &=\frac {1}{2} x^2 \cot ^{-1}(c+d \coth (a+b x))-\frac {1}{4} i x^2 \log \left (1-\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )+\frac {1}{4} i x^2 \log \left (1-\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )-\frac {i x \text {Li}_2\left (\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )}{4 b}+\frac {i x \text {Li}_2\left (\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )}{4 b}+\frac {i \text {Li}_3\left (\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )}{8 b^2}-\frac {i \text {Li}_3\left (\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )}{8 b^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.70, size = 225, normalized size = 0.85 \begin {gather*} \frac {1}{2} x^2 \cot ^{-1}(c+d \coth (a+b x))-\frac {i \left (2 b^2 x^2 \log \left (1+\frac {(-i+c+d) e^{2 (a+b x)}}{i-c+d}\right )-2 b^2 x^2 \log \left (1+\frac {(i+c+d) e^{2 (a+b x)}}{-i-c+d}\right )+2 b x \text {PolyLog}\left (2,\frac {(-i+c+d) e^{2 (a+b x)}}{-i+c-d}\right )-2 b x \text {PolyLog}\left (2,\frac {(i+c+d) e^{2 (a+b x)}}{i+c-d}\right )-\text {PolyLog}\left (3,\frac {(-i+c+d) e^{2 (a+b x)}}{-i+c-d}\right )+\text {PolyLog}\left (3,\frac {(i+c+d) e^{2 (a+b x)}}{i+c-d}\right )\right )}{8 b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 3.31, size = 6508, normalized size = 24.56
method | result | size |
risch | \(\text {Expression too large to display}\) | \(6508\) |
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. 1051 vs. \(2 (195) = 390\).
time = 3.58, size = 1051, normalized size = 3.97 \begin {gather*} \frac {2 \, b^{2} x^{2} \arctan \left (\frac {\sinh \left (b x + a\right )}{d \cosh \left (b x + a\right ) + c \sinh \left (b x + a\right )}\right ) - 2 i \, b x {\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 i \, b x {\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 i \, b x {\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 i \, b x {\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 \, a^{2} \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^{2} \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^{2} \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^{2} \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^{2} x^{2} + i \, a^{2}\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^{2} x^{2} + i \, a^{2}\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^{2} x^{2} - i \, a^{2}\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^{2} x^{2} - i \, a^{2}\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 ) + 2 i \, {\rm polylog}\left (3, \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 i \, {\rm polylog}\left (3, -\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 i \, {\rm polylog}\left (3, \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 i \, {\rm polylog}\left (3, -\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 )}{4 \, b^{2}} \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.00 \begin {gather*} \int x\,\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]
________________________________________________________________________________________