Optimal. Leaf size=93 \[ \frac{i \text{PolyLog}\left (2,(1+i d) e^{2 i a+2 i b x}\right )}{4 b}-\frac{1}{2} x \log \left (1-(1+i d) e^{2 i a+2 i b x}\right )+x \tanh ^{-1}(d \cot (a+b x)+i d+1)+\frac{1}{2} i b x^2 \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.149287, antiderivative size = 93, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.312, Rules used = {6257, 2184, 2190, 2279, 2391} \[ \frac{i \text{PolyLog}\left (2,(1+i d) e^{2 i a+2 i b x}\right )}{4 b}-\frac{1}{2} x \log \left (1-(1+i d) e^{2 i a+2 i b x}\right )+x \tanh ^{-1}(d \cot (a+b x)+i d+1)+\frac{1}{2} i b x^2 \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 6257
Rule 2184
Rule 2190
Rule 2279
Rule 2391
Rubi steps
\begin{align*} \int \tanh ^{-1}(1+i d+d \cot (a+b x)) \, dx &=x \tanh ^{-1}(1+i d+d \cot (a+b x))+(i b) \int \frac{x}{1+(-1-i d) e^{2 i a+2 i b x}} \, dx\\ &=\frac{1}{2} i b x^2+x \tanh ^{-1}(1+i d+d \cot (a+b x))+(b (i-d)) \int \frac{e^{2 i a+2 i b x} x}{1+(-1-i d) e^{2 i a+2 i b x}} \, dx\\ &=\frac{1}{2} i b x^2+x \tanh ^{-1}(1+i d+d \cot (a+b x))-\frac{1}{2} x \log \left (1-(1+i d) e^{2 i a+2 i b x}\right )+\frac{1}{2} \int \log \left (1+(-1-i d) e^{2 i a+2 i b x}\right ) \, dx\\ &=\frac{1}{2} i b x^2+x \tanh ^{-1}(1+i d+d \cot (a+b x))-\frac{1}{2} x \log \left (1-(1+i d) e^{2 i a+2 i b x}\right )-\frac{i \operatorname{Subst}\left (\int \frac{\log (1+(-1-i d) x)}{x} \, dx,x,e^{2 i a+2 i b x}\right )}{4 b}\\ &=\frac{1}{2} i b x^2+x \tanh ^{-1}(1+i d+d \cot (a+b x))-\frac{1}{2} x \log \left (1-(1+i d) e^{2 i a+2 i b x}\right )+\frac{i \text{Li}_2\left ((1+i d) e^{2 i a+2 i b x}\right )}{4 b}\\ \end{align*}
Mathematica [B] time = 36.436, size = 709, normalized size = 7.62 \[ \frac{x \csc ^2(a+b x) (\cos (b x)-i \sin (b x)) (\cos (b x)+i \sin (b x)) \left (i \text{PolyLog}\left (2,\frac{(\cos (a)-i \sin (a)) (\tan (b x)+i) (d \sin (a)+(-2-i d) \cos (a))}{2 (d-i)}\right )-i \text{PolyLog}\left (2,\frac{1}{2} \sec (b x) (-d \sin (a)+(2+i d) \cos (a)) (\cos (a+b x)+i \sin (a+b x))\right )+i \text{PolyLog}(2,-\cos (2 b x)+i \sin (2 b x))+i \log (1-i \tan (b x)) \log \left (\frac{(\cos (a)-i \sin (a)) \sec (b x) (d \cos (a+b x)+(2+i d) \sin (a+b x))}{2 (d-i)}\right )-i \log (1+i \tan (b x)) \log \left (\frac{1}{2} (\sin (a)-i \cos (a)) \sec (b x) (d \cos (a+b x)+(2+i d) \sin (a+b x))\right )+2 b x \log (2 \cos (b x) (\cos (b x)-i \sin (b x)))\right )}{(\cot (a+b x)+i) (d \cot (a+b x)+i d+2) \left (\frac{(d-2 i) \cos (a+b x) (\log (1-i \tan (b x))-\log (1+i \tan (b x)))}{d \cos (a+b x)+(2+i d) \sin (a+b x)}+\frac{d \sin (a+b x) (\log (1-i \tan (b x))-\log (1+i \tan (b x)))}{(d-2 i) \sin (a+b x)-i d \cos (a+b x)}+\log \left (1+\frac{1}{2} \sec (b x) (d \sin (a)+(-2-i d) \cos (a)) (\cos (a+b x)+i \sin (a+b x))\right )-\log \left (\frac{1}{2} (\sin (a)-i \cos (a)) \sec (b x) (d \cos (a+b x)+(2+i d) \sin (a+b x))\right )-i \tan (b x) \log \left (1+\frac{1}{2} \sec (b x) (d \sin (a)+(-2-i d) \cos (a)) (\cos (a+b x)+i \sin (a+b x))\right )+i \tan (b x) \log \left (\frac{1}{2} (\sin (a)-i \cos (a)) \sec (b x) (d \cos (a+b x)+(2+i d) \sin (a+b x))\right )+2 i b x+2 b x \tan (b x)-i \tan (b x) \log (1-i \tan (b x))+i \tan (b x) \log (1+i \tan (b x))\right )}+x \tanh ^{-1}(d \cot (a+b x)+i d+1) \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.124, size = 299, normalized size = 3.2 \begin{align*}{\frac{-{\frac{i}{2}}{\it Artanh} \left ( 1+id+d\cot \left ( bx+a \right ) \right ) \ln \left ( id+d\cot \left ( bx+a \right ) \right ) }{b}}+{\frac{{\frac{i}{2}}{\it Artanh} \left ( 1+id+d\cot \left ( bx+a \right ) \right ) \ln \left ( id-d\cot \left ( bx+a \right ) \right ) }{b}}+{\frac{{\frac{i}{4}}}{b}{\it dilog} \left ({\frac{{\frac{i}{2}} \left ( -id-d\cot \left ( bx+a \right ) \right ) }{d}} \right ) }+{\frac{{\frac{i}{4}}\ln \left ( id-d\cot \left ( bx+a \right ) \right ) }{b}\ln \left ({\frac{{\frac{i}{2}} \left ( -id-d\cot \left ( bx+a \right ) \right ) }{d}} \right ) }-{\frac{{\frac{i}{4}}}{b}{\it dilog} \left ({\frac{-2-id-d\cot \left ( bx+a \right ) }{-2\,id-2}} \right ) }-{\frac{{\frac{i}{4}}\ln \left ( id-d\cot \left ( bx+a \right ) \right ) }{b}\ln \left ({\frac{-2-id-d\cot \left ( bx+a \right ) }{-2\,id-2}} \right ) }-{\frac{{\frac{i}{8}} \left ( \ln \left ( id+d\cot \left ( bx+a \right ) \right ) \right ) ^{2}}{b}}+{\frac{{\frac{i}{4}}}{b}{\it dilog} \left ( 1+{\frac{i}{2}}d+{\frac{d\cot \left ( bx+a \right ) }{2}} \right ) }+{\frac{{\frac{i}{4}}\ln \left ( id+d\cot \left ( bx+a \right ) \right ) }{b}\ln \left ( 1+{\frac{i}{2}}d+{\frac{d\cot \left ( bx+a \right ) }{2}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.53743, size = 389, normalized size = 4.18 \begin{align*} -\frac{4 \,{\left (b x + a\right )} d{\left (\frac{\log \left ({\left (i \, d + 2\right )} \tan \left (b x + a\right ) + d\right )}{d} - \frac{\log \left (i \, \tan \left (b x + a\right ) + 1\right )}{d}\right )} - d{\left (\frac{2 i \,{\left (\log \left ({\left (i \, d + 2\right )} \tan \left (b x + a\right ) + d\right ) \log \left (\frac{{\left (d - 2 i\right )} \tan \left (b x + a\right ) - i \, d}{2 i \, d + 2} + 1\right ) +{\rm Li}_2\left (-\frac{{\left (d - 2 i\right )} \tan \left (b x + a\right ) - i \, d}{2 i \, d + 2}\right )\right )}}{d} + \frac{2 i \,{\left (\log \left (\frac{1}{2} \,{\left (d - 2 i\right )} \tan \left (b x + a\right ) - \frac{1}{2} i \, d\right ) \log \left (i \, \tan \left (b x + a\right ) + 1\right ) +{\rm Li}_2\left (-\frac{1}{2} \,{\left (d - 2 i\right )} \tan \left (b x + a\right ) + \frac{1}{2} i \, d + 1\right )\right )}}{d} - \frac{2 i \, \log \left ({\left (i \, d + 2\right )} \tan \left (b x + a\right ) + d\right ) \log \left (i \, \tan \left (b x + a\right ) + 1\right ) - i \, \log \left (i \, \tan \left (b x + a\right ) + 1\right )^{2}}{d} - \frac{2 i \,{\left (\log \left (i \, \tan \left (b x + a\right ) + 1\right ) \log \left (-\frac{1}{2} i \, \tan \left (b x + a\right ) + \frac{1}{2}\right ) +{\rm Li}_2\left (\frac{1}{2} i \, \tan \left (b x + a\right ) + \frac{1}{2}\right )\right )}}{d}\right )} - 8 \,{\left (b x + a\right )} \operatorname{artanh}\left (i \, d + \frac{d}{\tan \left (b x + a\right )} + 1\right )}{8 \, b} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.82227, size = 340, normalized size = 3.66 \begin{align*} \frac{2 i \, b^{2} x^{2} + 2 \, b x \log \left (-\frac{{\left ({\left (d - i\right )} e^{\left (2 i \, b x + 2 i \, a\right )} + i\right )} e^{\left (-2 i \, b x - 2 i \, a\right )}}{d}\right ) - 2 i \, a^{2} - 2 \,{\left (b x + a\right )} \log \left ({\left (-i \, d - 1\right )} e^{\left (2 i \, b x + 2 i \, a\right )} + 1\right ) + 2 \, a \log \left (\frac{{\left (d - i\right )} e^{\left (2 i \, b x + 2 i \, a\right )} + i}{d - i}\right ) + i \,{\rm Li}_2\left (-{\left (-i \, d - 1\right )} e^{\left (2 i \, b x + 2 i \, a\right )}\right )}{4 \, b} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \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 (d \cot \left (b x + a\right ) + i \, d + 1\right )\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]