Optimal. Leaf size=198 \[ x \text {ArcTan}(c+d \tan (a+b x))+\frac {1}{2} i x \log \left (1+\frac {(1+i c+d) e^{2 i a+2 i b x}}{1+i c-d}\right )-\frac {1}{2} i x \log \left (1+\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (1+d)}\right )+\frac {\text {PolyLog}\left (2,-\frac {(1+i c+d) e^{2 i a+2 i b x}}{1+i c-d}\right )}{4 b}-\frac {\text {PolyLog}\left (2,-\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (1+d)}\right )}{4 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.18, antiderivative size = 198, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 4, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {5275, 2221,
2317, 2438} \begin {gather*} x \text {ArcTan}(d \tan (a+b x)+c)+\frac {\text {Li}_2\left (-\frac {(i c+d+1) e^{2 i a+2 i b x}}{i c-d+1}\right )}{4 b}-\frac {\text {Li}_2\left (-\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (d+1)}\right )}{4 b}+\frac {1}{2} i x \log \left (1+\frac {(i c+d+1) e^{2 i a+2 i b x}}{i c-d+1}\right )-\frac {1}{2} i x \log \left (1+\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (d+1)}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2221
Rule 2317
Rule 2438
Rule 5275
Rubi steps
\begin {align*} \int \tan ^{-1}(c+d \tan (a+b x)) \, dx &=x \tan ^{-1}(c+d \tan (a+b x))+(b (1-i c-d)) \int \frac {e^{2 i a+2 i b x} x}{1-i c+d+(1-i c-d) e^{2 i a+2 i b x}} \, dx-(b (1+i c+d)) \int \frac {e^{2 i a+2 i b x} x}{1+i c-d+(1+i c+d) e^{2 i a+2 i b x}} \, dx\\ &=x \tan ^{-1}(c+d \tan (a+b x))+\frac {1}{2} i x \log \left (1+\frac {(1+i c+d) e^{2 i a+2 i b x}}{1+i c-d}\right )-\frac {1}{2} i x \log \left (1+\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (1+d)}\right )+\frac {1}{2} i \int \log \left (1+\frac {(1-i c-d) e^{2 i a+2 i b x}}{1-i c+d}\right ) \, dx-\frac {1}{2} i \int \log \left (1+\frac {(1+i c+d) e^{2 i a+2 i b x}}{1+i c-d}\right ) \, dx\\ &=x \tan ^{-1}(c+d \tan (a+b x))+\frac {1}{2} i x \log \left (1+\frac {(1+i c+d) e^{2 i a+2 i b x}}{1+i c-d}\right )-\frac {1}{2} i x \log \left (1+\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (1+d)}\right )+\frac {\text {Subst}\left (\int \frac {\log \left (1+\frac {(1-i c-d) x}{1-i c+d}\right )}{x} \, dx,x,e^{2 i a+2 i b x}\right )}{4 b}-\frac {\text {Subst}\left (\int \frac {\log \left (1+\frac {(1+i c+d) x}{1+i c-d}\right )}{x} \, dx,x,e^{2 i a+2 i b x}\right )}{4 b}\\ &=x \tan ^{-1}(c+d \tan (a+b x))+\frac {1}{2} i x \log \left (1+\frac {(1+i c+d) e^{2 i a+2 i b x}}{1+i c-d}\right )-\frac {1}{2} i x \log \left (1+\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (1+d)}\right )+\frac {\text {Li}_2\left (-\frac {(1+i c+d) e^{2 i a+2 i b x}}{1+i c-d}\right )}{4 b}-\frac {\text {Li}_2\left (-\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (1+d)}\right )}{4 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(555\) vs. \(2(198)=396\).
time = 5.02, size = 555, normalized size = 2.80 \begin {gather*} x \text {ArcTan}(c+d \tan (a+b x))+\frac {x \left (-4 a d \text {ArcTan}(c+d \tan (a+b x))-i \sqrt {-d^2} \left (\log (1-i \tan (a+b x)) \log \left (\frac {-c d+\sqrt {-d^2}-d^2 \tan (a+b x)}{-c d+i d^2+\sqrt {-d^2}}\right )+\text {PolyLog}\left (2,\frac {d^2 (1-i \tan (a+b x))}{i c d+d^2-i \sqrt {-d^2}}\right )\right )+i \sqrt {-d^2} \left (\log (1-i \tan (a+b x)) \log \left (\frac {c d+\sqrt {-d^2}+d^2 \tan (a+b x)}{c d-i d^2+\sqrt {-d^2}}\right )+\text {PolyLog}\left (2,\frac {d^2 (1-i \tan (a+b x))}{i c d+d^2+i \sqrt {-d^2}}\right )\right )+i \sqrt {-d^2} \left (\log (1+i \tan (a+b x)) \log \left (\frac {c d-\sqrt {-d^2}+d^2 \tan (a+b x)}{c d+i d^2-\sqrt {-d^2}}\right )+\text {PolyLog}\left (2,\frac {d^2 (1+i \tan (a+b x))}{-i c d+d^2+i \sqrt {-d^2}}\right )\right )-i \sqrt {-d^2} \left (\log (1+i \tan (a+b x)) \log \left (\frac {c d+\sqrt {-d^2}+d^2 \tan (a+b x)}{c d+i d^2+\sqrt {-d^2}}\right )+\text {PolyLog}\left (2,\frac {d^2 (1+i \tan (a+b x))}{d^2-i \left (c d+\sqrt {-d^2}\right )}\right )\right )\right )}{2 d (2 a-i \log (1-i \tan (a+b x))+i \log (1+i \tan (a+b x)))} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 1000 vs. \(2 (168 ) = 336\).
time = 0.78, size = 1001, normalized size = 5.06 Too large to display
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. 433 vs. \(2 (141) = 282\).
time = 0.53, size = 433, normalized size = 2.19 \begin {gather*} \frac {d {\left (\frac {8 \, {\left (b x + a\right )} \arctan \left (\frac {d^{2} \tan \left (b x + a\right ) + c d}{d}\right )}{d} - \frac {4 \, {\left (b x + a\right )} \arctan \left (\frac {c d + {\left (d^{2} + d\right )} \tan \left (b x + a\right )}{c^{2} + d^{2} + 2 \, d + 1}, \frac {c d \tan \left (b x + a\right ) + c^{2} + d + 1}{c^{2} + d^{2} + 2 \, d + 1}\right ) - 4 \, {\left (b x + a\right )} \arctan \left (\frac {c d + {\left (d^{2} - d\right )} \tan \left (b x + a\right )}{c^{2} + d^{2} - 2 \, d + 1}, \frac {c d \tan \left (b x + a\right ) + c^{2} - d + 1}{c^{2} + d^{2} - 2 \, d + 1}\right ) + \log \left (\tan \left (b x + a\right )^{2} + 1\right ) \log \left (\frac {d^{2} \tan \left (b x + a\right )^{2} + 2 \, c d \tan \left (b x + a\right ) + c^{2} + 1}{c^{2} + d^{2} + 2 \, d + 1}\right ) - \log \left (\tan \left (b x + a\right )^{2} + 1\right ) \log \left (\frac {d^{2} \tan \left (b x + a\right )^{2} + 2 \, c d \tan \left (b x + a\right ) + c^{2} + 1}{c^{2} + d^{2} - 2 \, d + 1}\right ) + 2 \, {\rm Li}_2\left (-\frac {i \, d \tan \left (b x + a\right ) - d}{i \, c + d + 1}\right ) - 2 \, {\rm Li}_2\left (-\frac {i \, d \tan \left (b x + a\right ) - d}{i \, c + d - 1}\right ) + 2 \, {\rm Li}_2\left (\frac {i \, d \tan \left (b x + a\right ) + d}{-i \, c + d + 1}\right ) - 2 \, {\rm Li}_2\left (\frac {i \, d \tan \left (b x + a\right ) + d}{-i \, c + d - 1}\right )}{d}\right )} + 8 \, {\left (b x + a\right )} \arctan \left (d \tan \left (b x + a\right ) + c\right ) - 8 \, {\left (b x + a\right )} \arctan \left (\frac {d^{2} \tan \left (b x + a\right ) + c d}{d}\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. 1101 vs. \(2 (141) = 282\).
time = 0.65, size = 1101, normalized size = 5.56 \begin {gather*} \frac {8 \, b x \arctan \left (d \tan \left (b x + a\right ) + c\right ) - 2 \, {\left (i \, b x + i \, a\right )} \log \left (-\frac {2 \, {\left ({\left (i \, c d - d^{2} + d\right )} \tan \left (b x + a\right )^{2} - c^{2} - i \, c d + {\left (i \, c^{2} - 2 \, c d - i \, d^{2} + i\right )} \tan \left (b x + a\right ) + d - 1\right )}}{{\left (c^{2} + d^{2} - 2 \, d + 1\right )} \tan \left (b x + a\right )^{2} + c^{2} + d^{2} - 2 \, d + 1}\right ) - 2 \, {\left (-i \, b x - i \, a\right )} \log \left (-\frac {2 \, {\left ({\left (i \, c d - d^{2} - d\right )} \tan \left (b x + a\right )^{2} - c^{2} - i \, c d + {\left (i \, c^{2} - 2 \, c d - i \, d^{2} + i\right )} \tan \left (b x + a\right ) - d - 1\right )}}{{\left (c^{2} + d^{2} + 2 \, d + 1\right )} \tan \left (b x + a\right )^{2} + c^{2} + d^{2} + 2 \, d + 1}\right ) - 2 \, {\left (-i \, b x - i \, a\right )} \log \left (-\frac {2 \, {\left ({\left (-i \, c d - d^{2} + d\right )} \tan \left (b x + a\right )^{2} - c^{2} + i \, c d + {\left (-i \, c^{2} - 2 \, c d + i \, d^{2} - i\right )} \tan \left (b x + a\right ) + d - 1\right )}}{{\left (c^{2} + d^{2} - 2 \, d + 1\right )} \tan \left (b x + a\right )^{2} + c^{2} + d^{2} - 2 \, d + 1}\right ) - 2 \, {\left (i \, b x + i \, a\right )} \log \left (-\frac {2 \, {\left ({\left (-i \, c d - d^{2} - d\right )} \tan \left (b x + a\right )^{2} - c^{2} + i \, c d + {\left (-i \, c^{2} - 2 \, c d + i \, d^{2} - i\right )} \tan \left (b x + a\right ) - d - 1\right )}}{{\left (c^{2} + d^{2} + 2 \, d + 1\right )} \tan \left (b x + a\right )^{2} + c^{2} + d^{2} + 2 \, d + 1}\right ) + 2 i \, a \log \left (\frac {{\left (i \, c d + d^{2} + d\right )} \tan \left (b x + a\right )^{2} - c^{2} + i \, c d + {\left (i \, c^{2} + i \, d^{2} + 2 i \, d + i\right )} \tan \left (b x + a\right ) - d - 1}{\tan \left (b x + a\right )^{2} + 1}\right ) - 2 i \, a \log \left (\frac {{\left (i \, c d + d^{2} - d\right )} \tan \left (b x + a\right )^{2} - c^{2} + i \, c d + {\left (i \, c^{2} + i \, d^{2} - 2 i \, d + i\right )} \tan \left (b x + a\right ) + d - 1}{\tan \left (b x + a\right )^{2} + 1}\right ) + 2 i \, a \log \left (\frac {{\left (i \, c d - d^{2} + d\right )} \tan \left (b x + a\right )^{2} + c^{2} + i \, c d + {\left (i \, c^{2} + i \, d^{2} - 2 i \, d + i\right )} \tan \left (b x + a\right ) - d + 1}{\tan \left (b x + a\right )^{2} + 1}\right ) - 2 i \, a \log \left (\frac {{\left (i \, c d - d^{2} - d\right )} \tan \left (b x + a\right )^{2} + c^{2} + i \, c d + {\left (i \, c^{2} + i \, d^{2} + 2 i \, d + i\right )} \tan \left (b x + a\right ) + d + 1}{\tan \left (b x + a\right )^{2} + 1}\right ) + {\rm Li}_2\left (\frac {2 \, {\left ({\left (i \, c d - d^{2} + d\right )} \tan \left (b x + a\right )^{2} - c^{2} - i \, c d + {\left (i \, c^{2} - 2 \, c d - i \, d^{2} + i\right )} \tan \left (b x + a\right ) + d - 1\right )}}{{\left (c^{2} + d^{2} - 2 \, d + 1\right )} \tan \left (b x + a\right )^{2} + c^{2} + d^{2} - 2 \, d + 1} + 1\right ) - {\rm Li}_2\left (\frac {2 \, {\left ({\left (i \, c d - d^{2} - d\right )} \tan \left (b x + a\right )^{2} - c^{2} - i \, c d + {\left (i \, c^{2} - 2 \, c d - i \, d^{2} + i\right )} \tan \left (b x + a\right ) - d - 1\right )}}{{\left (c^{2} + d^{2} + 2 \, d + 1\right )} \tan \left (b x + a\right )^{2} + c^{2} + d^{2} + 2 \, d + 1} + 1\right ) + {\rm Li}_2\left (\frac {2 \, {\left ({\left (-i \, c d - d^{2} + d\right )} \tan \left (b x + a\right )^{2} - c^{2} + i \, c d + {\left (-i \, c^{2} - 2 \, c d + i \, d^{2} - i\right )} \tan \left (b x + a\right ) + d - 1\right )}}{{\left (c^{2} + d^{2} - 2 \, d + 1\right )} \tan \left (b x + a\right )^{2} + c^{2} + d^{2} - 2 \, d + 1} + 1\right ) - {\rm Li}_2\left (\frac {2 \, {\left ({\left (-i \, c d - d^{2} - d\right )} \tan \left (b x + a\right )^{2} - c^{2} + i \, c d + {\left (-i \, c^{2} - 2 \, c d + i \, d^{2} - i\right )} \tan \left (b x + a\right ) - d - 1\right )}}{{\left (c^{2} + d^{2} + 2 \, d + 1\right )} \tan \left (b x + a\right )^{2} + c^{2} + d^{2} + 2 \, d + 1} + 1\right )}{8 \, b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \operatorname {atan}{\left (c + d \tan {\left (a + b x \right )} \right )}\, dx \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+d\,\mathrm {tan}\left (a+b\,x\right )\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________