Optimal. Leaf size=79 \[ -\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}(\cot (a+b x)) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0462235, antiderivative size = 79, normalized size of antiderivative = 1., 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 = {6249, 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}(\cot (a+b x)) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 6249
Rule 4181
Rule 2279
Rule 2391
Rubi steps
\begin{align*} \int \tanh ^{-1}(\cot (a+b x)) \, dx &=x \tanh ^{-1}(\cot (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}(\cot (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}(\cot (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}(\cot (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.0368159, size = 74, normalized size = 0.94 \[ \frac{i \left (-\text{PolyLog}\left (2,-i e^{2 i (a+b x)}\right )+\text{PolyLog}\left (2,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}(\cot (a+b x))\right )\right )}{4 b} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.109, size = 422, normalized size = 5.3 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.62672, size = 248, normalized size = 3.14 \begin{align*} \frac{4 \,{\left (b x + a\right )} \operatorname{artanh}\left (\frac{1}{\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} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.26752, size = 1030, normalized size = 13.04 \begin{align*} \frac{4 \, b x \log \left (-\frac{\cos \left (2 \, b x + 2 \, a\right ) + \sin \left (2 \, b x + 2 \, a\right ) + 1}{\cos \left (2 \, b x + 2 \, a\right ) - \sin \left (2 \, b x + 2 \, a\right ) + 1}\right ) + 2 \, a \log \left (\cos \left (2 \, b x + 2 \, a\right ) + i \, \sin \left (2 \, b x + 2 \, a\right ) + i\right ) - 2 \, a \log \left (\cos \left (2 \, b x + 2 \, a\right ) - i \, \sin \left (2 \, b x + 2 \, a\right ) + i\right ) - 2 \,{\left (b x + a\right )} \log \left (i \, \cos \left (2 \, b x + 2 \, a\right ) + \sin \left (2 \, b x + 2 \, a\right ) + 1\right ) + 2 \,{\left (b x + a\right )} \log \left (i \, \cos \left (2 \, b x + 2 \, a\right ) - \sin \left (2 \, b x + 2 \, a\right ) + 1\right ) - 2 \,{\left (b x + a\right )} \log \left (-i \, \cos \left (2 \, b x + 2 \, a\right ) + \sin \left (2 \, b x + 2 \, a\right ) + 1\right ) + 2 \,{\left (b x + a\right )} \log \left (-i \, \cos \left (2 \, b x + 2 \, a\right ) - \sin \left (2 \, b x + 2 \, a\right ) + 1\right ) + 2 \, a \log \left (-\cos \left (2 \, b x + 2 \, a\right ) + i \, \sin \left (2 \, b x + 2 \, a\right ) + i\right ) - 2 \, a \log \left (-\cos \left (2 \, b x + 2 \, a\right ) - i \, \sin \left (2 \, b x + 2 \, a\right ) + i\right ) + i \,{\rm Li}_2\left (i \, \cos \left (2 \, b x + 2 \, a\right ) + \sin \left (2 \, b x + 2 \, a\right )\right ) + i \,{\rm Li}_2\left (i \, \cos \left (2 \, b x + 2 \, a\right ) - \sin \left (2 \, b x + 2 \, a\right )\right ) - i \,{\rm Li}_2\left (-i \, \cos \left (2 \, b x + 2 \, a\right ) + \sin \left (2 \, b x + 2 \, a\right )\right ) - i \,{\rm Li}_2\left (-i \, \cos \left (2 \, b x + 2 \, a\right ) - \sin \left (2 \, b x + 2 \, a\right )\right )}{8 \, b} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \operatorname{atanh}{\left (\cot{\left (a + b x \right )} \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \operatorname{artanh}\left (\cot \left (b x + a\right )\right )\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]