Optimal. Leaf size=86 \[ -\frac {b x^2}{2}+x \text {ArcTan}(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 {PolyLog}\left (2,-i c e^{2 i a+2 i b x}\right )}{4 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, 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 = {5273, 2215,
2221, 2317, 2438} \begin {gather*} x \text {ArcTan}(c-(1+i c) \cot (a+b x))-\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 )-\frac {b x^2}{2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2215
Rule 2221
Rule 2317
Rule 2438
Rule 5273
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 {\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 \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 [A]
time = 5.96, size = 75, normalized size = 0.87 \begin {gather*} x \text {ArcTan}(c+(-1-i c) \cot (a+b x))-\frac {1}{2} i x \log \left (1-\frac {i e^{-2 i (a+b x)}}{c}\right )+\frac {\text {PolyLog}\left (2,\frac {i e^{-2 i (a+b x)}}{c}\right )}{4 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 689 vs. \(2 (72 ) = 144\).
time = 0.27, size = 690, normalized size = 8.02
method | result | size |
derivativedivides | \(-\frac {-\frac {\arctan \left (-c +\left (i c +1\right ) \cot \left (b x +a \right )\right ) \ln \left (i+\left (i c +1\right ) \cot \left (b x +a \right )-c \right ) c^{2}}{2 i-2 c}+\frac {2 i \arctan \left (-c +\left (i c +1\right ) \cot \left (b x +a \right )\right ) \ln \left (i+\left (i c +1\right ) \cot \left (b x +a \right )-c \right ) c}{2 i-2 c}+\frac {\arctan \left (-c +\left (i c +1\right ) \cot \left (b x +a \right )\right ) \ln \left (i+\left (i c +1\right ) \cot \left (b x +a \right )-c \right )}{2 i-2 c}+\frac {\arctan \left (-c +\left (i c +1\right ) \cot \left (b x +a \right )\right ) \ln \left (-\left (i c +1\right ) \cot \left (b x +a \right )-c +i\right ) c^{2}}{2 i-2 c}-\frac {2 i \arctan \left (-c +\left (i c +1\right ) \cot \left (b x +a \right )\right ) \ln \left (-\left (i c +1\right ) \cot \left (b x +a \right )-c +i\right ) c}{2 i-2 c}-\frac {\arctan \left (-c +\left (i c +1\right ) \cot \left (b x +a \right )\right ) \ln \left (-\left (i c +1\right ) \cot \left (b x +a \right )-c +i\right )}{2 i-2 c}+\left (i c +1\right )^{2} \left (-\frac {i \ln \left (-\frac {i \left (i+\left (i c +1\right ) \cot \left (b x +a \right )-c \right )}{2}\right ) \ln \left (-\frac {i \left (i-\left (i c +1\right ) \cot \left (b x +a \right )+c \right )}{2}\right )}{4 \left (i-c \right )}+\frac {i \ln \left (-\frac {i \left (i-\left (i c +1\right ) \cot \left (b x +a \right )+c \right )}{2}\right ) \ln \left (i+\left (i c +1\right ) \cot \left (b x +a \right )-c \right )}{4 i-4 c}-\frac {i \dilog \left (-\frac {i \left (i+\left (i c +1\right ) \cot \left (b x +a \right )-c \right )}{2}\right )}{4 \left (i-c \right )}-\frac {i \ln \left (i+\left (i c +1\right ) \cot \left (b x +a \right )-c \right )^{2}}{8 \left (i-c \right )}-\frac {i \ln \left (-\left (i c +1\right ) \cot \left (b x +a \right )-c +i\right ) \ln \left (\frac {i-\left (i c +1\right ) \cot \left (b x +a \right )+c}{2 c}\right )}{4 \left (i-c \right )}-\frac {i \dilog \left (\frac {i-\left (i c +1\right ) \cot \left (b x +a \right )+c}{2 c}\right )}{4 \left (i-c \right )}+\frac {i \ln \left (-\left (i c +1\right ) \cot \left (b x +a \right )-c +i\right ) \ln \left (\frac {-i-\left (i c +1\right ) \cot \left (b x +a \right )+c}{-2 i+2 c}\right )}{4 i-4 c}+\frac {i \dilog \left (\frac {-i-\left (i c +1\right ) \cot \left (b x +a \right )+c}{-2 i+2 c}\right )}{4 i-4 c}\right )}{b \left (i c +1\right )}\) | \(690\) |
default | \(-\frac {-\frac {\arctan \left (-c +\left (i c +1\right ) \cot \left (b x +a \right )\right ) \ln \left (i+\left (i c +1\right ) \cot \left (b x +a \right )-c \right ) c^{2}}{2 i-2 c}+\frac {2 i \arctan \left (-c +\left (i c +1\right ) \cot \left (b x +a \right )\right ) \ln \left (i+\left (i c +1\right ) \cot \left (b x +a \right )-c \right ) c}{2 i-2 c}+\frac {\arctan \left (-c +\left (i c +1\right ) \cot \left (b x +a \right )\right ) \ln \left (i+\left (i c +1\right ) \cot \left (b x +a \right )-c \right )}{2 i-2 c}+\frac {\arctan \left (-c +\left (i c +1\right ) \cot \left (b x +a \right )\right ) \ln \left (-\left (i c +1\right ) \cot \left (b x +a \right )-c +i\right ) c^{2}}{2 i-2 c}-\frac {2 i \arctan \left (-c +\left (i c +1\right ) \cot \left (b x +a \right )\right ) \ln \left (-\left (i c +1\right ) \cot \left (b x +a \right )-c +i\right ) c}{2 i-2 c}-\frac {\arctan \left (-c +\left (i c +1\right ) \cot \left (b x +a \right )\right ) \ln \left (-\left (i c +1\right ) \cot \left (b x +a \right )-c +i\right )}{2 i-2 c}+\left (i c +1\right )^{2} \left (-\frac {i \ln \left (-\frac {i \left (i+\left (i c +1\right ) \cot \left (b x +a \right )-c \right )}{2}\right ) \ln \left (-\frac {i \left (i-\left (i c +1\right ) \cot \left (b x +a \right )+c \right )}{2}\right )}{4 \left (i-c \right )}+\frac {i \ln \left (-\frac {i \left (i-\left (i c +1\right ) \cot \left (b x +a \right )+c \right )}{2}\right ) \ln \left (i+\left (i c +1\right ) \cot \left (b x +a \right )-c \right )}{4 i-4 c}-\frac {i \dilog \left (-\frac {i \left (i+\left (i c +1\right ) \cot \left (b x +a \right )-c \right )}{2}\right )}{4 \left (i-c \right )}-\frac {i \ln \left (i+\left (i c +1\right ) \cot \left (b x +a \right )-c \right )^{2}}{8 \left (i-c \right )}-\frac {i \ln \left (-\left (i c +1\right ) \cot \left (b x +a \right )-c +i\right ) \ln \left (\frac {i-\left (i c +1\right ) \cot \left (b x +a \right )+c}{2 c}\right )}{4 \left (i-c \right )}-\frac {i \dilog \left (\frac {i-\left (i c +1\right ) \cot \left (b x +a \right )+c}{2 c}\right )}{4 \left (i-c \right )}+\frac {i \ln \left (-\left (i c +1\right ) \cot \left (b x +a \right )-c +i\right ) \ln \left (\frac {-i-\left (i c +1\right ) \cot \left (b x +a \right )+c}{-2 i+2 c}\right )}{4 i-4 c}+\frac {i \dilog \left (\frac {-i-\left (i c +1\right ) \cot \left (b x +a \right )+c}{-2 i+2 c}\right )}{4 i-4 c}\right )}{b \left (i c +1\right )}\) | \(690\) |
risch | \(\text {Expression too large to display}\) | \(1248\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 458 vs. \(2 (63) = 126\).
time = 0.49, size = 458, normalized size = 5.33 \begin {gather*} -\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} + 1\right )} \tan \left (b x + a\right ) + i\right )}}{-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 \, {\left (i \, c^{2} - {\left (c^{2} + 1\right )} \tan \left (b x + a\right ) + i\right )}}{-2 i \, c^{2} + 2 \, {\left (c^{2} + 1\right )} \tan \left (b x + a\right ) - 4 \, c + 2 i}\right )}{8 \, b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.38, size = 112, normalized size = 1.30 \begin {gather*} -\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} + 2 \, {\left (i \, b x + 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} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: CoercionFailed} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \mathrm {atan}\left (c-\mathrm {cot}\left (a+b\,x\right )\,\left (1+c\,1{}\mathrm {i}\right )\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________