Integrand size = 17, antiderivative size = 85 \[ \int \cot ^{-1}(c+(1+i c) \tan (a+b x)) \, dx=\frac {b x^2}{2}+x \cot ^{-1}(c+(1+i c) \tan (a+b x))+\frac {1}{2} i x \log \left (1-i c e^{2 i a+2 i b x}\right )+\frac {\operatorname {PolyLog}\left (2,i c e^{2 i a+2 i b x}\right )}{4 b} \]
[Out]
Time = 0.09 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.294, Rules used = {5272, 2215, 2221, 2317, 2438} \[ \int \cot ^{-1}(c+(1+i c) \tan (a+b x)) \, dx=\frac {\operatorname {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 \cot ^{-1}(c+(1+i c) \tan (a+b x))+\frac {b x^2}{2} \]
[In]
[Out]
Rule 2215
Rule 2221
Rule 2317
Rule 2438
Rule 5272
Rubi steps \begin{align*} \text {integral}& = x \cot ^{-1}(c+(1+i c) \tan (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 \cot ^{-1}(c+(1+i c) \tan (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 \cot ^{-1}(c+(1+i c) \tan (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 \cot ^{-1}(c+(1+i c) \tan (a+b x))+\frac {1}{2} i x \log \left (1-i c e^{2 i a+2 i b x}\right )-\frac {\text {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 \cot ^{-1}(c+(1+i c) \tan (a+b x))+\frac {1}{2} i x \log \left (1-i c e^{2 i a+2 i b x}\right )+\frac {\operatorname {PolyLog}\left (2,i c e^{2 i a+2 i b x}\right )}{4 b} \\ \end{align*}
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(967\) vs. \(2(85)=170\).
Time = 4.19 (sec) , antiderivative size = 967, normalized size of antiderivative = 11.38 \[ \int \cot ^{-1}(c+(1+i c) \tan (a+b x)) \, dx=x \cot ^{-1}(c+(1+i c) \tan (a+b x))-\frac {i x \left (2 i b x \log (2 \cos (b x) (\cos (b x)-i \sin (b x)))-\log \left (\frac {\sec (b x) (\cos (a)-i \sin (a)) ((i+c) \cos (a+b x)+(1+i c) \sin (a+b x))}{2 c}\right ) \log (1-i \tan (b x))+\log \left (\frac {\sec (b x) ((1-i c) \cos (a+b x)+(-i+c) \sin (a+b x))}{2 \cos (a)-2 i \sin (a)}\right ) \log (1+i \tan (b x))-\operatorname {PolyLog}(2,-\cos (2 b x)+i \sin (2 b x))-\operatorname {PolyLog}\left (2,\frac {\sec (b x) ((-i+c) \cos (a)+i (i+c) \sin (a)) (\cos (a+b x)-i \sin (a+b x))}{2 c}\right )+\operatorname {PolyLog}\left (2,\frac {1}{2} \sec (b x) ((1+i c) \cos (a)-(i+c) \sin (a)) (\cos (a+b x)+i \sin (a+b x))\right )\right ) \sec ^2(a+b x) (\cos (b x)+i \sin (b x)) (i \cos (b x)+\sin (b x)) ((1-i c) \cos (a+b x)+(-i+c) \sin (a+b x))}{((i+c) \cos (a+b x)+(1+i c) \sin (a+b x)) \left (2 b x-i \log \left (1-\frac {\sec (b x) ((-i+c) \cos (a)+i (i+c) \sin (a)) (\cos (a+b x)-i \sin (a+b x))}{2 c}\right )-i \log \left (1+\frac {1}{2} \sec (b x) ((-1-i c) \cos (a)+(i+c) \sin (a)) (\cos (a+b x)+i \sin (a+b x))\right )-\frac {i (-i+c) \cos (a+b x) (\log (1-i \tan (b x))-\log (1+i \tan (b x)))}{(i+c) \cos (a+b x)+(1+i c) \sin (a+b x)}+\frac {(i+c) (\log (1-i \tan (b x))-\log (1+i \tan (b x))) \sin (a+b x)}{(i+c) \cos (a+b x)+(1+i c) \sin (a+b x)}-2 i b x \tan (b x)+\log \left (1-\frac {\sec (b x) ((-i+c) \cos (a)+i (i+c) \sin (a)) (\cos (a+b x)-i \sin (a+b x))}{2 c}\right ) \tan (b x)-\log \left (1+\frac {1}{2} \sec (b x) ((-1-i c) \cos (a)+(i+c) \sin (a)) (\cos (a+b x)+i \sin (a+b x))\right ) \tan (b x)-\log (1-i \tan (b x)) \tan (b x)+\cos ^2(a) \log (1+i \tan (b x)) \tan (b x)+\log (1+i \tan (b x)) \sin ^2(a) \tan (b x)+\frac {\log \left (\frac {\sec (b x) ((1-i c) \cos (a+b x)+(-i+c) \sin (a+b x))}{2 \cos (a)-2 i \sin (a)}\right ) \sec ^2(b x)}{-i+\tan (b x)}-\frac {\log \left (\frac {\sec (b x) (\cos (a)-i \sin (a)) ((i+c) \cos (a+b x)+(1+i c) \sin (a+b x))}{2 c}\right ) \sec ^2(b x)}{i+\tan (b x)}\right ) (-i+\tan (a+b x)) (1-i c+(-i+c) \tan (a+b x))} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 561 vs. \(2 (69 ) = 138\).
Time = 2.06 (sec) , antiderivative size = 562, normalized size of antiderivative = 6.61
method | result | size |
derivativedivides | \(\frac {\frac {\operatorname {arccot}\left (c +\left (i c +1\right ) \tan \left (b x +a \right )\right ) \ln \left (-c +\left (i c +1\right ) \tan \left (b x +a \right )+i\right ) c^{2}}{2 i-2 c}-\frac {2 i \operatorname {arccot}\left (c +\left (i c +1\right ) \tan \left (b x +a \right )\right ) \ln \left (-c +\left (i c +1\right ) \tan \left (b x +a \right )+i\right ) c}{2 i-2 c}-\frac {\operatorname {arccot}\left (c +\left (i c +1\right ) \tan \left (b x +a \right )\right ) \ln \left (-c +\left (i c +1\right ) \tan \left (b x +a \right )+i\right )}{2 i-2 c}-\frac {\operatorname {arccot}\left (c +\left (i c +1\right ) \tan \left (b x +a \right )\right ) \ln \left (-i+c +\left (i c +1\right ) \tan \left (b x +a \right )\right ) c^{2}}{2 i-2 c}+\frac {2 i \operatorname {arccot}\left (c +\left (i c +1\right ) \tan \left (b x +a \right )\right ) \ln \left (-i+c +\left (i c +1\right ) \tan \left (b x +a \right )\right ) c}{2 i-2 c}+\frac {\operatorname {arccot}\left (c +\left (i c +1\right ) \tan \left (b x +a \right )\right ) \ln \left (-i+c +\left (i c +1\right ) \tan \left (b x +a \right )\right )}{2 i-2 c}+\left (i c +1\right )^{2} \left (\frac {-\frac {i \ln \left (-i+c +\left (i c +1\right ) \tan \left (b x +a \right )\right )^{2}}{4}+\frac {i \left (\operatorname {dilog}\left (-\frac {i \left (c +\left (i c +1\right ) \tan \left (b x +a \right )+i\right )}{2}\right )+\ln \left (-i+c +\left (i c +1\right ) \tan \left (b x +a \right )\right ) \ln \left (-\frac {i \left (c +\left (i c +1\right ) \tan \left (b x +a \right )+i\right )}{2}\right )\right )}{2}}{2 i-2 c}-\frac {\frac {i \left (\operatorname {dilog}\left (\frac {c +\left (i c +1\right ) \tan \left (b x +a \right )+i}{2 c}\right )+\ln \left (-c +\left (i c +1\right ) \tan \left (b x +a \right )+i\right ) \ln \left (\frac {c +\left (i c +1\right ) \tan \left (b x +a \right )+i}{2 c}\right )\right )}{2}-\frac {i \left (\operatorname {dilog}\left (\frac {-i+c +\left (i c +1\right ) \tan \left (b x +a \right )}{-2 i+2 c}\right )+\ln \left (-c +\left (i c +1\right ) \tan \left (b x +a \right )+i\right ) \ln \left (\frac {-i+c +\left (i c +1\right ) \tan \left (b x +a \right )}{-2 i+2 c}\right )\right )}{2}}{2 \left (i-c \right )}\right )}{b \left (i c +1\right )}\) | \(562\) |
default | \(\frac {\frac {\operatorname {arccot}\left (c +\left (i c +1\right ) \tan \left (b x +a \right )\right ) \ln \left (-c +\left (i c +1\right ) \tan \left (b x +a \right )+i\right ) c^{2}}{2 i-2 c}-\frac {2 i \operatorname {arccot}\left (c +\left (i c +1\right ) \tan \left (b x +a \right )\right ) \ln \left (-c +\left (i c +1\right ) \tan \left (b x +a \right )+i\right ) c}{2 i-2 c}-\frac {\operatorname {arccot}\left (c +\left (i c +1\right ) \tan \left (b x +a \right )\right ) \ln \left (-c +\left (i c +1\right ) \tan \left (b x +a \right )+i\right )}{2 i-2 c}-\frac {\operatorname {arccot}\left (c +\left (i c +1\right ) \tan \left (b x +a \right )\right ) \ln \left (-i+c +\left (i c +1\right ) \tan \left (b x +a \right )\right ) c^{2}}{2 i-2 c}+\frac {2 i \operatorname {arccot}\left (c +\left (i c +1\right ) \tan \left (b x +a \right )\right ) \ln \left (-i+c +\left (i c +1\right ) \tan \left (b x +a \right )\right ) c}{2 i-2 c}+\frac {\operatorname {arccot}\left (c +\left (i c +1\right ) \tan \left (b x +a \right )\right ) \ln \left (-i+c +\left (i c +1\right ) \tan \left (b x +a \right )\right )}{2 i-2 c}+\left (i c +1\right )^{2} \left (\frac {-\frac {i \ln \left (-i+c +\left (i c +1\right ) \tan \left (b x +a \right )\right )^{2}}{4}+\frac {i \left (\operatorname {dilog}\left (-\frac {i \left (c +\left (i c +1\right ) \tan \left (b x +a \right )+i\right )}{2}\right )+\ln \left (-i+c +\left (i c +1\right ) \tan \left (b x +a \right )\right ) \ln \left (-\frac {i \left (c +\left (i c +1\right ) \tan \left (b x +a \right )+i\right )}{2}\right )\right )}{2}}{2 i-2 c}-\frac {\frac {i \left (\operatorname {dilog}\left (\frac {c +\left (i c +1\right ) \tan \left (b x +a \right )+i}{2 c}\right )+\ln \left (-c +\left (i c +1\right ) \tan \left (b x +a \right )+i\right ) \ln \left (\frac {c +\left (i c +1\right ) \tan \left (b x +a \right )+i}{2 c}\right )\right )}{2}-\frac {i \left (\operatorname {dilog}\left (\frac {-i+c +\left (i c +1\right ) \tan \left (b x +a \right )}{-2 i+2 c}\right )+\ln \left (-c +\left (i c +1\right ) \tan \left (b x +a \right )+i\right ) \ln \left (\frac {-i+c +\left (i c +1\right ) \tan \left (b x +a \right )}{-2 i+2 c}\right )\right )}{2}}{2 \left (i-c \right )}\right )}{b \left (i c +1\right )}\) | \(562\) |
risch | \(\text {Expression too large to display}\) | \(1244\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 199 vs. \(2 (60) = 120\).
Time = 0.28 (sec) , antiderivative size = 199, normalized size of antiderivative = 2.34 \[ \int \cot ^{-1}(c+(1+i c) \tan (a+b x)) \, dx=\frac {b^{2} x^{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 ) - a^{2} + {\left (i \, b x + i \, a\right )} \log \left (\frac {1}{2} \, \sqrt {4 i \, c} e^{\left (i \, b x + i \, a\right )} + 1\right ) + {\left (i \, b x + i \, a\right )} \log \left (-\frac {1}{2} \, \sqrt {4 i \, c} e^{\left (i \, b x + i \, a\right )} + 1\right ) - i \, a \log \left (\frac {2 \, c e^{\left (i \, b x + i \, a\right )} + i \, \sqrt {4 i \, c}}{2 \, c}\right ) - i \, a \log \left (\frac {2 \, c e^{\left (i \, b x + i \, a\right )} - i \, \sqrt {4 i \, c}}{2 \, c}\right ) + {\rm Li}_2\left (\frac {1}{2} \, \sqrt {4 i \, c} e^{\left (i \, b x + i \, a\right )}\right ) + {\rm Li}_2\left (-\frac {1}{2} \, \sqrt {4 i \, c} e^{\left (i \, b x + i \, a\right )}\right )}{2 \, b} \]
[In]
[Out]
Exception generated. \[ \int \cot ^{-1}(c+(1+i c) \tan (a+b x)) \, dx=\text {Exception raised: CoercionFailed} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 455 vs. \(2 (60) = 120\).
Time = 0.29 (sec) , antiderivative size = 455, normalized size of antiderivative = 5.35 \[ \int \cot ^{-1}(c+(1+i c) \tan (a+b x)) \, dx=-\frac {{\left (-i \, c - 1\right )} {\left (\frac {4 i \, {\left (b x + a\right )} \log \left (-\frac {2 \, {\left (-i \, c^{2} + {\left (c^{2} - 2 i \, c - 1\right )} \tan \left (b x + a\right ) - 2 \, c + i\right )}}{2 i \, c^{2} - 2 \, {\left (c^{2} - 2 i \, c - 1\right )} \tan \left (b x + a\right ) + 2 i}\right )}{i \, c + 1} - \frac {i \, {\left (4 \, {\left (b x + a\right )} {\left (\log \left (-i \, c^{2} + {\left (c^{2} - 2 i \, c - 1\right )} \tan \left (b x + a\right ) - 2 \, c + i\right ) - \log \left (-i \, c^{2} + {\left (c^{2} - 2 i \, c - 1\right )} \tan \left (b x + a\right ) - i\right )\right )} + i \, \log \left (-i \, c^{2} + {\left (c^{2} - 2 i \, c - 1\right )} \tan \left (b x + a\right ) - 2 \, c + i\right )^{2} - 2 i \, \log \left (-i \, c^{2} + {\left (c^{2} - 2 i \, c - 1\right )} \tan \left (b x + a\right ) - i\right ) \log \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 \, \log \left (-i \, c^{2} + {\left (c^{2} - 2 i \, c - 1\right )} \tan \left (b x + a\right ) - 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} - 2 i \, c - 1\right )} \tan \left (b x + a\right ) - 2 \, c + i\right ) \log \left (-\frac {1}{2} i \, \tan \left (b x + a\right ) + \frac {1}{2}\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 )} \operatorname {arccot}\left ({\left (i \, c + 1\right )} \tan \left (b x + a\right ) + c\right ) - \frac {4 \, {\left (b x + a\right )} {\left (c - i\right )} \log \left (-\frac {2 \, {\left (-i \, c^{2} + {\left (c^{2} - 2 i \, c - 1\right )} \tan \left (b x + a\right ) - 2 \, c + i\right )}}{2 i \, c^{2} - 2 \, {\left (c^{2} - 2 i \, c - 1\right )} \tan \left (b x + a\right ) + 2 i}\right )}{i \, c + 1}}{8 \, b} \]
[In]
[Out]
\[ \int \cot ^{-1}(c+(1+i c) \tan (a+b x)) \, dx=\int { \operatorname {arccot}\left ({\left (i \, c + 1\right )} \tan \left (b x + a\right ) + c\right ) \,d x } \]
[In]
[Out]
Timed out. \[ \int \cot ^{-1}(c+(1+i c) \tan (a+b x)) \, dx=\int \mathrm {acot}\left (c+\mathrm {tan}\left (a+b\,x\right )\,\left (1+c\,1{}\mathrm {i}\right )\right ) \,d x \]
[In]
[Out]