Optimal. Leaf size=86 \[ -\frac {\text {Li}_2\left (-i c e^{2 i a+2 i b x}\right )}{4 b}-\frac {1}{2} i x \log \left (1+i c e^{2 i a+2 i b x}\right )+x \tan ^{-1}(c-(1+i c) \cot (a+b x))-\frac {b x^2}{2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.13, antiderivative size = 86, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.294, Rules used = {5165, 2184, 2190, 2279, 2391} \[ -\frac {\text {PolyLog}\left (2,-i c e^{2 i a+2 i b x}\right )}{4 b}-\frac {1}{2} i x \log \left (1+i c e^{2 i a+2 i b x}\right )+x \tan ^{-1}(c-(1+i c) \cot (a+b x))-\frac {b x^2}{2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2184
Rule 2190
Rule 2279
Rule 2391
Rule 5165
Rubi steps
\begin {align*} \int \tan ^{-1}(c+(-1-i c) \cot (a+b x)) \, dx &=x \tan ^{-1}(c-(1+i c) \cot (a+b x))-(i b) \int \frac {x}{-i (-1-i c)+c-c e^{2 i a+2 i b x}} \, dx\\ &=-\frac {b x^2}{2}+x \tan ^{-1}(c-(1+i c) \cot (a+b x))-(b c) \int \frac {e^{2 i a+2 i b x} x}{-i (-1-i c)+c-c e^{2 i a+2 i b x}} \, dx\\ &=-\frac {b x^2}{2}+x \tan ^{-1}(c-(1+i c) \cot (a+b x))-\frac {1}{2} i x \log \left (1+i c e^{2 i a+2 i b x}\right )+\frac {1}{2} i \int \log \left (1-\frac {c e^{2 i a+2 i b x}}{-i (-1-i c)+c}\right ) \, dx\\ &=-\frac {b x^2}{2}+x \tan ^{-1}(c-(1+i c) \cot (a+b x))-\frac {1}{2} i x \log \left (1+i c e^{2 i a+2 i b x}\right )+\frac {\operatorname {Subst}\left (\int \frac {\log \left (1-\frac {c x}{-i (-1-i c)+c}\right )}{x} \, dx,x,e^{2 i a+2 i b x}\right )}{4 b}\\ &=-\frac {b x^2}{2}+x \tan ^{-1}(c-(1+i c) \cot (a+b x))-\frac {1}{2} i x \log \left (1+i c e^{2 i a+2 i b x}\right )-\frac {\text {Li}_2\left (-i c e^{2 i a+2 i b x}\right )}{4 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 15.67, size = 872, normalized size = 10.14 \[ x \tan ^{-1}(c+(-i c-1) \cot (a+b x))+\frac {i x \csc (a+b x) \left (2 b x \log (2 \cos (b x) (\cos (b x)-i \sin (b x)))+i \log \left (\frac {\sec (b x) (\cos (a)-i \sin (a)) ((c-i) \cos (a+b x)+i (c+i) \sin (a+b x))}{2 c}\right ) \log (1-i \tan (b x))-i \log \left (\frac {1}{2} \sec (b x) (\cos (a)+i \sin (a)) ((i c+1) \cos (a+b x)-(c+i) \sin (a+b x))\right ) \log (i \tan (b x)+1)+i \text {Li}_2(i \sin (2 b x)-\cos (2 b x))+i \text {Li}_2\left (\frac {\sec (b x) ((c+i) \cos (a)+(i c+1) \sin (a)) (\cos (a+b x)-i \sin (a+b x))}{2 c}\right )-i \text {Li}_2\left (\frac {1}{2} (\cos (a)+i \sin (a)) ((c+i) \cos (a)+(i c+1) \sin (a)) (\tan (b x)-i)\right )\right ) (\cos (b x)-i \sin (b x)) (\cos (b x)+i \sin (b x))}{(\cot (a+b x)+i) ((c-i) \cos (a+b x)+i (c+i) \sin (a+b x)) \left (\frac {\log \left (\frac {1}{2} \sec (b x) (\cos (a)+i \sin (a)) ((i c+1) \cos (a+b x)-(c+i) \sin (a+b x))\right ) \sec ^2(b x)}{i \tan (b x)+1}+\frac {i \log \left (1-\frac {1}{2} (\cos (a)+i \sin (a)) ((c+i) \cos (a)+(i c+1) \sin (a)) (\tan (b x)-i)\right ) \sec ^2(b x)}{\tan (b x)-i}+\frac {i \log \left (\frac {\sec (b x) (\cos (a)-i \sin (a)) ((c-i) \cos (a+b x)+i (c+i) \sin (a+b x))}{2 c}\right ) \sec ^2(b x)}{\tan (b x)+i}-2 i b x-\log \left (1-\frac {\sec (b x) ((c+i) \cos (a)+(i c+1) \sin (a)) (\cos (a+b x)-i \sin (a+b x))}{2 c}\right )-2 b x \tan (b x)-i \log \left (1-\frac {\sec (b x) ((c+i) \cos (a)+(i c+1) \sin (a)) (\cos (a+b x)-i \sin (a+b x))}{2 c}\right ) \tan (b x)+i \log (1-i \tan (b x)) \tan (b x)-i \log (i \tan (b x)+1) \tan (b x)-\frac {\log (1-i \tan (b x)) ((c+i) \cos (a+b x)+(i c+1) \sin (a+b x))}{(c-i) \cos (a+b x)+i (c+i) \sin (a+b x)}+\frac {\log (i \tan (b x)+1) ((c+i) \cos (a+b x)+(i c+1) \sin (a+b x))}{(c-i) \cos (a+b x)+i (c+i) \sin (a+b x)}\right )} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.55, size = 112, normalized size = 1.30 \[ -\frac {2 \, b^{2} x^{2} - 2 i \, b x \log \left (-\frac {{\left (c e^{\left (2 i \, b x + 2 i \, a\right )} - i\right )} e^{\left (-2 i \, b x - 2 i \, a\right )}}{c - i}\right ) - 2 \, a^{2} - {\left (-2 i \, b x - 2 i \, a\right )} \log \left (i \, c e^{\left (2 i \, b x + 2 i \, a\right )} + 1\right ) - 2 i \, a \log \left (\frac {c e^{\left (2 i \, b x + 2 i \, a\right )} - i}{c}\right ) + {\rm Li}_2\left (-i \, c e^{\left (2 i \, b x + 2 i \, a\right )}\right )}{4 \, 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 -\arctan \left (-{\left (-i \, c - 1\right )} \cot \left (b x + a\right ) - c\right )\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.70, size = 1753, normalized size = 20.38 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.47, size = 456, normalized size = 5.30 \[ -\frac {{\left (i \, c + 1\right )} {\left (\frac {4 i \, {\left (b x + a\right )} \log \left (\frac {-2 i \, c^{2} + 2 \, {\left (c^{2} + 1\right )} \tan \left (b x + a\right ) - 2 i}{-2 i \, c^{2} + 2 \, {\left (c^{2} + 1\right )} \tan \left (b x + a\right ) - 4 \, c + 2 i}\right )}{i \, c + 1} + \frac {i \, {\left (4 \, {\left (b x + a\right )} {\left (\log \left (-i \, c^{2} + {\left (c^{2} + 1\right )} \tan \left (b x + a\right ) - 2 \, c + i\right ) - \log \left (-i \, c^{2} + {\left (c^{2} + 1\right )} \tan \left (b x + a\right ) - i\right )\right )} - 2 i \, \log \left (-i \, c^{2} + {\left (c^{2} + 1\right )} \tan \left (b x + a\right ) - 2 \, c + i\right ) \log \left (-\frac {{\left (i \, c - 1\right )} \tan \left (b x + a\right ) + c - i}{2 \, c} + 1\right ) + 2 i \, \log \left (-i \, c^{2} + {\left (c^{2} + 1\right )} \tan \left (b x + a\right ) - 2 \, c + i\right ) \log \left (\tan \left (b x + a\right ) - i\right ) - 2 i \, \log \left (-\frac {1}{2} \, {\left (c + i\right )} \tan \left (b x + a\right ) + \frac {1}{2} i \, c + \frac {1}{2}\right ) \log \left (\tan \left (b x + a\right ) - i\right ) - i \, \log \left (\tan \left (b x + a\right ) - i\right )^{2} - 2 i \, \log \left (c^{2} + 1\right ) \log \left (i \, \tan \left (b x + a\right ) + 1\right ) + 2 i \, \log \left (\tan \left (b x + a\right ) - i\right ) \log \left (-\frac {1}{2} i \, \tan \left (b x + a\right ) + \frac {1}{2}\right ) + 2 i \, \log \left (c^{2} + 1\right ) \log \left (-i \, \tan \left (b x + a\right ) + 1\right ) - 2 i \, {\rm Li}_2\left (\frac {1}{2} \, {\left (c + i\right )} \tan \left (b x + a\right ) - \frac {1}{2} i \, c + \frac {1}{2}\right ) - 2 i \, {\rm Li}_2\left (\frac {{\left (i \, c - 1\right )} \tan \left (b x + a\right ) + c - i}{2 \, c}\right ) + 2 i \, {\rm Li}_2\left (\frac {1}{2} i \, \tan \left (b x + a\right ) + \frac {1}{2}\right )\right )}}{i \, c + 1}\right )} - 8 \, {\left (b x + a\right )} \arctan \left (c + \frac {-i \, c - 1}{\tan \left (b x + a\right )}\right ) + 4 \, {\left (-i \, b x - i \, a\right )} \log \left (\frac {-2 i \, c^{2} + 2 \, {\left (c^{2} + 1\right )} \tan \left (b x + a\right ) - 2 i}{-2 i \, c^{2} + 2 \, {\left (c^{2} + 1\right )} \tan \left (b x + a\right ) - 4 \, c + 2 i}\right )}{8 \, 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 {atan}\left (c-\mathrm {cot}\left (a+b\,x\right )\,\left (1+c\,1{}\mathrm {i}\right )\right ) \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: CoercionFailed} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________