Optimal. Leaf size=86 \[ \frac {b x^2}{2}+x \text {ArcTan}(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 {PolyLog}\left (2,-i c e^{2 i a+2 i b x}\right )}{4 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, 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 = {5271, 2215,
2221, 2317, 2438} \begin {gather*} x \text {ArcTan}(c-(1-i c) \tan (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 5271
Rubi steps
\begin {align*} \int \tan ^{-1}(c+(-1+i c) \tan (a+b x)) \, dx &=x \tan ^{-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 \tan ^{-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 \tan ^{-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 \tan ^{-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 \tan ^{-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 {Li}_2\left (-i c e^{2 i a+2 i b x}\right )}{4 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 6.22, size = 76, normalized size = 0.88 \begin {gather*} x \text {ArcTan}(c+i (i+c) \tan (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. 648 vs. \(2 (70 ) = 140\).
time = 0.26, size = 649, normalized size = 7.55
method | result | size |
derivativedivides | \(\frac {-\frac {\arctan \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 \arctan \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 {\arctan \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 {\arctan \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 \arctan \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 {\arctan \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 {i \ln \left (i+c +\left (i c -1\right ) \tan \left (b x +a \right )\right ) \ln \left (-\frac {i \left (i-c -\left (i c -1\right ) \tan \left (b x +a \right )\right )}{2}\right )}{4 \left (i+c \right )}+\frac {i \ln \left (-\frac {i \left (i+c +\left (i c -1\right ) \tan \left (b x +a \right )\right )}{2}\right ) \ln \left (-\frac {i \left (i-c -\left (i c -1\right ) \tan \left (b x +a \right )\right )}{2}\right )}{4 i+4 c}+\frac {i \dilog \left (-\frac {i \left (i+c +\left (i c -1\right ) \tan \left (b x +a \right )\right )}{2}\right )}{4 i+4 c}+\frac {i \ln \left (i+c +\left (i c -1\right ) \tan \left (b x +a \right )\right )^{2}}{8 i+8 c}-\frac {i \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 )}{4 \left (i+c \right )}-\frac {i \dilog \left (\frac {-i-c -\left (i c -1\right ) \tan \left (b x +a \right )}{-2 i-2 c}\right )}{4 \left (i+c \right )}+\frac {i \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 c}\right )}{4 i+4 c}+\frac {i \dilog \left (-\frac {i-c -\left (i c -1\right ) \tan \left (b x +a \right )}{2 c}\right )}{4 i+4 c}\right )}{b \left (i c -1\right )}\) | \(649\) |
default | \(\frac {-\frac {\arctan \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 \arctan \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 {\arctan \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 {\arctan \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 \arctan \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 {\arctan \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 {i \ln \left (i+c +\left (i c -1\right ) \tan \left (b x +a \right )\right ) \ln \left (-\frac {i \left (i-c -\left (i c -1\right ) \tan \left (b x +a \right )\right )}{2}\right )}{4 \left (i+c \right )}+\frac {i \ln \left (-\frac {i \left (i+c +\left (i c -1\right ) \tan \left (b x +a \right )\right )}{2}\right ) \ln \left (-\frac {i \left (i-c -\left (i c -1\right ) \tan \left (b x +a \right )\right )}{2}\right )}{4 i+4 c}+\frac {i \dilog \left (-\frac {i \left (i+c +\left (i c -1\right ) \tan \left (b x +a \right )\right )}{2}\right )}{4 i+4 c}+\frac {i \ln \left (i+c +\left (i c -1\right ) \tan \left (b x +a \right )\right )^{2}}{8 i+8 c}-\frac {i \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 )}{4 \left (i+c \right )}-\frac {i \dilog \left (\frac {-i-c -\left (i c -1\right ) \tan \left (b x +a \right )}{-2 i-2 c}\right )}{4 \left (i+c \right )}+\frac {i \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 c}\right )}{4 i+4 c}+\frac {i \dilog \left (-\frac {i-c -\left (i c -1\right ) \tan \left (b x +a \right )}{2 c}\right )}{4 i+4 c}\right )}{b \left (i c -1\right )}\) | \(649\) |
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. 448 vs. \(2 (61) = 122\).
time = 0.51, size = 448, normalized size = 5.21 \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} + 2 i \, c - 1\right )} \tan \left (b x + a\right ) - i\right )}}{2 i \, c^{2} - 2 \, {\left (c^{2} + 2 i \, c - 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} + 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 )} \arctan \left ({\left (i \, c - 1\right )} \tan \left (b x + a\right ) + c\right ) + 4 \, {\left (-i \, b x - i \, a\right )} \log \left (-\frac {2 \, {\left (-i \, c^{2} + {\left (c^{2} + 2 i \, c - 1\right )} \tan \left (b x + a\right ) - i\right )}}{2 i \, c^{2} - 2 \, {\left (c^{2} + 2 i \, c - 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 [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 200 vs. \(2 (61) = 122\).
time = 1.55, size = 200, normalized size = 2.33 \begin {gather*} \frac {b^{2} x^{2} + i \, b x \log \left (-\frac {{\left (c + i\right )} e^{\left (2 i \, b x + 2 i \, a\right )}}{c e^{\left (2 i \, b x + 2 i \, a\right )} - 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} \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 {tan}\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]
________________________________________________________________________________________