Optimal. Leaf size=79 \[ -\frac {1}{2} i b x^2+x \text {ArcTan}(c+(i+c) \coth (a+b x))+\frac {1}{2} i x \log \left (1-i c e^{2 a+2 b x}\right )+\frac {i \text {PolyLog}\left (2,i c e^{2 a+2 b x}\right )}{4 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 79, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {5297, 2215,
2221, 2317, 2438} \begin {gather*} x \text {ArcTan}(c+(c+i) \coth (a+b x))+\frac {i \text {Li}_2\left (i c e^{2 a+2 b x}\right )}{4 b}+\frac {1}{2} i x \log \left (1-i c e^{2 a+2 b x}\right )-\frac {1}{2} i b x^2 \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2215
Rule 2221
Rule 2317
Rule 2438
Rule 5297
Rubi steps
\begin {align*} \int \tan ^{-1}(c+(i+c) \coth (a+b x)) \, dx &=x \tan ^{-1}(c+(i+c) \coth (a+b x))-b \int \frac {x}{-i-c e^{2 a+2 b x}} \, dx\\ &=-\frac {1}{2} i b x^2+x \tan ^{-1}(c+(i+c) \coth (a+b x))-(i b c) \int \frac {e^{2 a+2 b x} x}{-i-c e^{2 a+2 b x}} \, dx\\ &=-\frac {1}{2} i b x^2+x \tan ^{-1}(c+(i+c) \coth (a+b x))+\frac {1}{2} i x \log \left (1-i c e^{2 a+2 b x}\right )-\frac {1}{2} i \int \log \left (1-i c e^{2 a+2 b x}\right ) \, dx\\ &=-\frac {1}{2} i b x^2+x \tan ^{-1}(c+(i+c) \coth (a+b x))+\frac {1}{2} i x \log \left (1-i c e^{2 a+2 b x}\right )-\frac {i \text {Subst}\left (\int \frac {\log (1-i c x)}{x} \, dx,x,e^{2 a+2 b x}\right )}{4 b}\\ &=-\frac {1}{2} i b x^2+x \tan ^{-1}(c+(i+c) \coth (a+b x))+\frac {1}{2} i x \log \left (1-i c e^{2 a+2 b x}\right )+\frac {i \text {Li}_2\left (i c e^{2 a+2 b x}\right )}{4 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.43, size = 71, normalized size = 0.90 \begin {gather*} x \text {ArcTan}(c+(i+c) \coth (a+b x))+\frac {i \left (2 b x \log \left (1+\frac {i e^{-2 (a+b x)}}{c}\right )-\text {PolyLog}\left (2,-\frac {i e^{-2 (a+b x)}}{c}\right )\right )}{4 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. 597 vs. \(2 (65 ) = 130\).
time = 0.31, size = 598, normalized size = 7.57
method | result | size |
derivativedivides | \(\frac {\frac {\arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right )}{2 i+2 c}-\frac {2 i \arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right ) c}{2 i+2 c}-\frac {\arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right ) c^{2}}{2 i+2 c}-\frac {\arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )}{2 i+2 c}+\frac {2 i \arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right ) c}{2 i+2 c}+\frac {\arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right ) c^{2}}{2 i+2 c}-\left (i+c \right )^{2} \left (\frac {i \ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )^{2}}{8 i+8 c}+\frac {i \ln \left (-\frac {i \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )}{2}\right ) \ln \left (-\frac {i \left (i-c -\left (i+c \right ) \coth \left (b x +a \right )\right )}{2}\right )}{4 i+4 c}-\frac {i \ln \left (-\frac {i \left (i-c -\left (i+c \right ) \coth \left (b x +a \right )\right )}{2}\right ) \ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )}{4 \left (i+c \right )}+\frac {i \dilog \left (-\frac {i \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )}{2}\right )}{4 i+4 c}+\frac {i \ln \left (-\frac {i-c -\left (i+c \right ) \coth \left (b x +a \right )}{2 c}\right ) \ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right )}{4 i+4 c}+\frac {i \dilog \left (-\frac {i-c -\left (i+c \right ) \coth \left (b x +a \right )}{2 c}\right )}{4 i+4 c}-\frac {i \ln \left (\frac {-i-c -\left (i+c \right ) \coth \left (b x +a \right )}{-2 i-2 c}\right ) \ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right )}{4 \left (i+c \right )}-\frac {i \dilog \left (\frac {-i-c -\left (i+c \right ) \coth \left (b x +a \right )}{-2 i-2 c}\right )}{4 \left (i+c \right )}\right )}{b \left (i+c \right )}\) | \(598\) |
default | \(\frac {\frac {\arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right )}{2 i+2 c}-\frac {2 i \arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right ) c}{2 i+2 c}-\frac {\arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right ) c^{2}}{2 i+2 c}-\frac {\arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )}{2 i+2 c}+\frac {2 i \arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right ) c}{2 i+2 c}+\frac {\arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right ) c^{2}}{2 i+2 c}-\left (i+c \right )^{2} \left (\frac {i \ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )^{2}}{8 i+8 c}+\frac {i \ln \left (-\frac {i \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )}{2}\right ) \ln \left (-\frac {i \left (i-c -\left (i+c \right ) \coth \left (b x +a \right )\right )}{2}\right )}{4 i+4 c}-\frac {i \ln \left (-\frac {i \left (i-c -\left (i+c \right ) \coth \left (b x +a \right )\right )}{2}\right ) \ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )}{4 \left (i+c \right )}+\frac {i \dilog \left (-\frac {i \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )}{2}\right )}{4 i+4 c}+\frac {i \ln \left (-\frac {i-c -\left (i+c \right ) \coth \left (b x +a \right )}{2 c}\right ) \ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right )}{4 i+4 c}+\frac {i \dilog \left (-\frac {i-c -\left (i+c \right ) \coth \left (b x +a \right )}{2 c}\right )}{4 i+4 c}-\frac {i \ln \left (\frac {-i-c -\left (i+c \right ) \coth \left (b x +a \right )}{-2 i-2 c}\right ) \ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right )}{4 \left (i+c \right )}-\frac {i \dilog \left (\frac {-i-c -\left (i+c \right ) \coth \left (b x +a \right )}{-2 i-2 c}\right )}{4 \left (i+c \right )}\right )}{b \left (i+c \right )}\) | \(598\) |
risch | \(\text {Expression too large to display}\) | \(1221\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 1.16, size = 80, normalized size = 1.01 \begin {gather*} 2 \, b {\left (c + i\right )} {\left (\frac {2 \, x^{2}}{2 i \, c - 2} - \frac {2 \, b x \log \left (-i \, c e^{\left (2 \, b x + 2 \, a\right )} + 1\right ) + {\rm Li}_2\left (i \, c e^{\left (2 \, b x + 2 \, a\right )}\right )}{-2 \, b^{2} {\left (-i \, c + 1\right )}}\right )} + x \arctan \left ({\left (c + i\right )} \coth \left (b x + a\right ) + c\right ) \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. 187 vs. \(2 (58) = 116\).
time = 2.42, size = 187, normalized size = 2.37 \begin {gather*} \frac {-i \, b^{2} x^{2} + i \, b x \log \left (-\frac {{\left (c + i\right )} e^{\left (2 \, b x + 2 \, a\right )}}{c e^{\left (2 \, b x + 2 \, a\right )} + i}\right ) + i \, a^{2} + {\left (i \, b x + i \, a\right )} \log \left (\frac {1}{2} \, \sqrt {4 i \, c} e^{\left (b x + a\right )} + 1\right ) + {\left (i \, b x + i \, a\right )} \log \left (-\frac {1}{2} \, \sqrt {4 i \, c} e^{\left (b x + a\right )} + 1\right ) - i \, a \log \left (\frac {2 \, c e^{\left (b x + a\right )} + i \, \sqrt {4 i \, c}}{2 \, c}\right ) - i \, a \log \left (\frac {2 \, c e^{\left (b x + a\right )} - i \, \sqrt {4 i \, c}}{2 \, c}\right ) + i \, {\rm Li}_2\left (\frac {1}{2} \, \sqrt {4 i \, c} e^{\left (b x + a\right )}\right ) + i \, {\rm Li}_2\left (-\frac {1}{2} \, \sqrt {4 i \, c} e^{\left (b x + a\right )}\right )}{2 \, b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: CoercionFailed} \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 {atan}\left (c+\mathrm {coth}\left (a+b\,x\right )\,\left (c+1{}\mathrm {i}\right )\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________