Optimal. Leaf size=79 \[ -\frac {i \text {Li}_2\left (-i e^{2 i (a+b x)}\right )}{4 b}+\frac {i \text {Li}_2\left (i e^{2 i (a+b x)}\right )}{4 b}+i x \tan ^{-1}\left (e^{2 i (a+b x)}\right )+x \tanh ^{-1}(\tan (a+b x)) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.05, antiderivative size = 79, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.571, Rules used = {6247, 4181, 2279, 2391} \[ -\frac {i \text {PolyLog}\left (2,-i e^{2 i (a+b x)}\right )}{4 b}+\frac {i \text {PolyLog}\left (2,i e^{2 i (a+b x)}\right )}{4 b}+i x \tan ^{-1}\left (e^{2 i (a+b x)}\right )+x \tanh ^{-1}(\tan (a+b x)) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2279
Rule 2391
Rule 4181
Rule 6247
Rubi steps
\begin {align*} \int \tanh ^{-1}(\tan (a+b x)) \, dx &=x \tanh ^{-1}(\tan (a+b x))-b \int x \sec (2 a+2 b x) \, dx\\ &=i x \tan ^{-1}\left (e^{2 i (a+b x)}\right )+x \tanh ^{-1}(\tan (a+b x))+\frac {1}{2} \int \log \left (1-i e^{i (2 a+2 b x)}\right ) \, dx-\frac {1}{2} \int \log \left (1+i e^{i (2 a+2 b x)}\right ) \, dx\\ &=i x \tan ^{-1}\left (e^{2 i (a+b x)}\right )+x \tanh ^{-1}(\tan (a+b x))-\frac {i \operatorname {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{i (2 a+2 b x)}\right )}{4 b}+\frac {i \operatorname {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{i (2 a+2 b x)}\right )}{4 b}\\ &=i x \tan ^{-1}\left (e^{2 i (a+b x)}\right )+x \tanh ^{-1}(\tan (a+b x))-\frac {i \text {Li}_2\left (-i e^{2 i (a+b x)}\right )}{4 b}+\frac {i \text {Li}_2\left (i e^{2 i (a+b x)}\right )}{4 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 74, normalized size = 0.94 \[ \frac {i \left (-\text {Li}_2\left (-i e^{2 i (a+b x)}\right )+\text {Li}_2\left (i e^{2 i (a+b x)}\right )+4 b x \left (\tan ^{-1}\left (e^{2 i (a+b x)}\right )-i \tanh ^{-1}(\tan (a+b x))\right )\right )}{4 b} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.69, size = 499, normalized size = 6.32 \[ \frac {4 \, b x \log \left (-\frac {\tan \left (b x + a\right ) + 1}{\tan \left (b x + a\right ) - 1}\right ) - 2 \, {\left (b x + a\right )} \log \left (\frac {\left (i + 1\right ) \, \tan \left (b x + a\right )^{2} + 2 \, \tan \left (b x + a\right ) - i + 1}{\tan \left (b x + a\right )^{2} + 1}\right ) + 2 \, a \log \left (\frac {\left (i + 1\right ) \, \tan \left (b x + a\right )^{2} + 2 i \, \tan \left (b x + a\right ) + i - 1}{\tan \left (b x + a\right )^{2} + 1}\right ) - 2 \, a \log \left (\frac {\left (i + 1\right ) \, \tan \left (b x + a\right )^{2} - 2 i \, \tan \left (b x + a\right ) + i - 1}{\tan \left (b x + a\right )^{2} + 1}\right ) + 2 \, {\left (b x + a\right )} \log \left (\frac {\left (i + 1\right ) \, \tan \left (b x + a\right )^{2} - 2 \, \tan \left (b x + a\right ) - i + 1}{\tan \left (b x + a\right )^{2} + 1}\right ) - 2 \, {\left (b x + a\right )} \log \left (\frac {-\left (i - 1\right ) \, \tan \left (b x + a\right )^{2} + 2 \, \tan \left (b x + a\right ) + i + 1}{\tan \left (b x + a\right )^{2} + 1}\right ) + 2 \, {\left (b x + a\right )} \log \left (\frac {-\left (i - 1\right ) \, \tan \left (b x + a\right )^{2} - 2 \, \tan \left (b x + a\right ) + i + 1}{\tan \left (b x + a\right )^{2} + 1}\right ) + 2 \, a \log \left (\frac {\left (i - 1\right ) \, \tan \left (b x + a\right )^{2} + 2 i \, \tan \left (b x + a\right ) + i + 1}{\tan \left (b x + a\right )^{2} + 1}\right ) - 2 \, a \log \left (\frac {\left (i - 1\right ) \, \tan \left (b x + a\right )^{2} - 2 i \, \tan \left (b x + a\right ) + i + 1}{\tan \left (b x + a\right )^{2} + 1}\right ) + i \, {\rm Li}_2\left (-\frac {\left (i + 1\right ) \, \tan \left (b x + a\right )^{2} + 2 \, \tan \left (b x + a\right ) - i + 1}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) + i \, {\rm Li}_2\left (-\frac {\left (i + 1\right ) \, \tan \left (b x + a\right )^{2} - 2 \, \tan \left (b x + a\right ) - i + 1}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) - i \, {\rm Li}_2\left (-\frac {-\left (i - 1\right ) \, \tan \left (b x + a\right )^{2} + 2 \, \tan \left (b x + a\right ) + i + 1}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) - i \, {\rm Li}_2\left (-\frac {-\left (i - 1\right ) \, \tan \left (b x + a\right )^{2} - 2 \, \tan \left (b x + a\right ) + i + 1}{\tan \left (b x + a\right )^{2} + 1} + 1\right )}{8 \, b} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \operatorname {artanh}\left (\tan \left (b x + a\right )\right )\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.50, size = 180, normalized size = 2.28 \[ \frac {\arctan \left (\tan \left (b x +a \right )\right ) \arctanh \left (\tan \left (b x +a \right )\right )}{b}+\frac {\arctan \left (\tan \left (b x +a \right )\right ) \ln \left (1+\frac {i \left (1+i \tan \left (b x +a \right )\right )^{2}}{1+\tan ^{2}\left (b x +a \right )}\right )}{2 b}-\frac {\arctan \left (\tan \left (b x +a \right )\right ) \ln \left (1-\frac {i \left (1+i \tan \left (b x +a \right )\right )^{2}}{1+\tan ^{2}\left (b x +a \right )}\right )}{2 b}-\frac {i \dilog \left (1+\frac {i \left (1+i \tan \left (b x +a \right )\right )^{2}}{1+\tan ^{2}\left (b x +a \right )}\right )}{4 b}+\frac {i \dilog \left (1-\frac {i \left (1+i \tan \left (b x +a \right )\right )^{2}}{1+\tan ^{2}\left (b x +a \right )}\right )}{4 b} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.48, size = 182, normalized size = 2.30 \[ \frac {4 \, {\left (b x + a\right )} \operatorname {artanh}\left (\tan \left (b x + a\right )\right ) + {\left (\arctan \left (\frac {1}{2} \, \tan \left (b x + a\right ) + \frac {1}{2}, \frac {1}{2} \, \tan \left (b x + a\right ) + \frac {1}{2}\right ) - \arctan \left (\frac {1}{2} \, \tan \left (b x + a\right ) - \frac {1}{2}, -\frac {1}{2} \, \tan \left (b x + a\right ) + \frac {1}{2}\right )\right )} \log \left (\tan \left (b x + a\right )^{2} + 1\right ) - {\left (b x + a\right )} \log \left (\frac {1}{2} \, \tan \left (b x + a\right )^{2} + \tan \left (b x + a\right ) + \frac {1}{2}\right ) + {\left (b x + a\right )} \log \left (\frac {1}{2} \, \tan \left (b x + a\right )^{2} - \tan \left (b x + a\right ) + \frac {1}{2}\right ) - i \, {\rm Li}_2\left (\left (\frac {1}{2} i + \frac {1}{2}\right ) \, \tan \left (b x + a\right ) - \frac {1}{2} i + \frac {1}{2}\right ) + i \, {\rm Li}_2\left (-\left (\frac {1}{2} i - \frac {1}{2}\right ) \, \tan \left (b x + a\right ) + \frac {1}{2} i + \frac {1}{2}\right ) + i \, {\rm Li}_2\left (\left (\frac {1}{2} i - \frac {1}{2}\right ) \, \tan \left (b x + a\right ) + \frac {1}{2} i + \frac {1}{2}\right ) - i \, {\rm Li}_2\left (-\left (\frac {1}{2} i + \frac {1}{2}\right ) \, \tan \left (b x + a\right ) - \frac {1}{2} i + \frac {1}{2}\right )}{4 \, b} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int \mathrm {atanh}\left (\mathrm {tan}\left (a+b\,x\right )\right ) \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \operatorname {atanh}{\left (\tan {\left (a + b x \right )} \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________