Optimal. Leaf size=305 \[ \frac {i \text {Li}_3\left (-\frac {(i c+d+1) e^{2 i a+2 i b x}}{i c-d+1}\right )}{8 b^2}-\frac {i \text {Li}_3\left (-\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (d+1)}\right )}{8 b^2}+\frac {x \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 {x \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}{4} i x^2 \log \left (1+\frac {(i c+d+1) e^{2 i a+2 i b x}}{i c-d+1}\right )-\frac {1}{4} i x^2 \log \left (1+\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (d+1)}\right )+\frac {1}{2} x^2 \tan ^{-1}(d \tan (a+b x)+c) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.41, antiderivative size = 305, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 5, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {5175, 2190, 2531, 2282, 6589} \[ \frac {i \text {PolyLog}\left (3,-\frac {(i c+d+1) e^{2 i a+2 i b x}}{i c-d+1}\right )}{8 b^2}-\frac {i \text {PolyLog}\left (3,-\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (d+1)}\right )}{8 b^2}+\frac {x \text {PolyLog}\left (2,-\frac {(i c+d+1) e^{2 i a+2 i b x}}{i c-d+1}\right )}{4 b}-\frac {x \text {PolyLog}\left (2,-\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (d+1)}\right )}{4 b}+\frac {1}{4} i x^2 \log \left (1+\frac {(i c+d+1) e^{2 i a+2 i b x}}{i c-d+1}\right )-\frac {1}{4} i x^2 \log \left (1+\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (d+1)}\right )+\frac {1}{2} x^2 \tan ^{-1}(d \tan (a+b x)+c) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2190
Rule 2282
Rule 2531
Rule 5175
Rule 6589
Rubi steps
\begin {align*} \int x \tan ^{-1}(c+d \tan (a+b x)) \, dx &=\frac {1}{2} x^2 \tan ^{-1}(c+d \tan (a+b x))+\frac {1}{2} (b (1-i c-d)) \int \frac {e^{2 i a+2 i b x} x^2}{1-i c+d+(1-i c-d) e^{2 i a+2 i b x}} \, dx-\frac {1}{2} (b (1+i c+d)) \int \frac {e^{2 i a+2 i b x} x^2}{1+i c-d+(1+i c+d) e^{2 i a+2 i b x}} \, dx\\ &=\frac {1}{2} x^2 \tan ^{-1}(c+d \tan (a+b x))+\frac {1}{4} i x^2 \log \left (1+\frac {(1+i c+d) e^{2 i a+2 i b x}}{1+i c-d}\right )-\frac {1}{4} i x^2 \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 x \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 x \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} x^2 \tan ^{-1}(c+d \tan (a+b x))+\frac {1}{4} i x^2 \log \left (1+\frac {(1+i c+d) e^{2 i a+2 i b x}}{1+i c-d}\right )-\frac {1}{4} i x^2 \log \left (1+\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (1+d)}\right )+\frac {x \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 {x \text {Li}_2\left (-\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (1+d)}\right )}{4 b}+\frac {\int \text {Li}_2\left (-\frac {(1-i c-d) e^{2 i a+2 i b x}}{1-i c+d}\right ) \, dx}{4 b}-\frac {\int \text {Li}_2\left (-\frac {(1+i c+d) e^{2 i a+2 i b x}}{1+i c-d}\right ) \, dx}{4 b}\\ &=\frac {1}{2} x^2 \tan ^{-1}(c+d \tan (a+b x))+\frac {1}{4} i x^2 \log \left (1+\frac {(1+i c+d) e^{2 i a+2 i b x}}{1+i c-d}\right )-\frac {1}{4} i x^2 \log \left (1+\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (1+d)}\right )+\frac {x \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 {x \text {Li}_2\left (-\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (1+d)}\right )}{4 b}+\frac {i \operatorname {Subst}\left (\int \frac {\text {Li}_2\left (-\frac {(1+i c+d) x}{1+i c-d}\right )}{x} \, dx,x,e^{2 i a+2 i b x}\right )}{8 b^2}-\frac {i \operatorname {Subst}\left (\int \frac {\text {Li}_2\left (-\frac {(c-i (-1+d)) x}{c+i (1+d)}\right )}{x} \, dx,x,e^{2 i a+2 i b x}\right )}{8 b^2}\\ &=\frac {1}{2} x^2 \tan ^{-1}(c+d \tan (a+b x))+\frac {1}{4} i x^2 \log \left (1+\frac {(1+i c+d) e^{2 i a+2 i b x}}{1+i c-d}\right )-\frac {1}{4} i x^2 \log \left (1+\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (1+d)}\right )+\frac {x \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 {x \text {Li}_2\left (-\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (1+d)}\right )}{4 b}+\frac {i \text {Li}_3\left (-\frac {(1+i c+d) e^{2 i a+2 i b x}}{1+i c-d}\right )}{8 b^2}-\frac {i \text {Li}_3\left (-\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (1+d)}\right )}{8 b^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.70, size = 272, normalized size = 0.89 \[ \frac {1}{2} x^2 \tan ^{-1}(d \tan (a+b x)+c)+\frac {i \left (2 b^2 x^2 \log \left (1+\frac {(c-i (d+1)) e^{2 i (a+b x)}}{c+i (d-1)}\right )-2 b^2 x^2 \log \left (1+\frac {(c-i d+i) e^{2 i (a+b x)}}{c+i (d+1)}\right )-2 i b x \text {Li}_2\left (-\frac {(c-i (d+1)) e^{2 i (a+b x)}}{c+i (d-1)}\right )+2 i b x \text {Li}_2\left (-\frac {(c-i d+i) e^{2 i (a+b x)}}{c+i (d+1)}\right )+\text {Li}_3\left (-\frac {(c-i (d+1)) e^{2 i (a+b x)}}{c+i (d-1)}\right )-\text {Li}_3\left (-\frac {(c-i d+i) e^{2 i (a+b x)}}{c+i (d+1)}\right )\right )}{8 b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [C] time = 0.67, size = 1557, normalized size = 5.10 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int x \arctan \left (d \tan \left (b x + a\right ) + c\right )\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [C] time = 6.25, size = 7648, normalized size = 25.08 \[ \text {output too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \frac {1}{4} \, x^{2} \arctan \left (c \cos \left (2 \, b x + 2 \, a\right ) + {\left (d + 1\right )} \sin \left (2 \, b x + 2 \, a\right ) + c, {\left (d + 1\right )} \cos \left (2 \, b x + 2 \, a\right ) - c \sin \left (2 \, b x + 2 \, a\right ) - d + 1\right ) + \frac {1}{4} \, x^{2} \arctan \left (c \cos \left (2 \, b x + 2 \, a\right ) + {\left (d - 1\right )} \sin \left (2 \, b x + 2 \, a\right ) + c, -{\left (d - 1\right )} \cos \left (2 \, b x + 2 \, a\right ) + c \sin \left (2 \, b x + 2 \, a\right ) + d + 1\right ) + 2 \, b d \int -\frac {2 \, {\left (c^{2} + d^{2} + 1\right )} x^{2} \cos \left (2 \, b x + 2 \, a\right )^{2} + 2 \, c d x^{2} \sin \left (2 \, b x + 2 \, a\right ) + 2 \, {\left (c^{2} + d^{2} + 1\right )} x^{2} \sin \left (2 \, b x + 2 \, a\right )^{2} + {\left (c^{2} - d^{2} + 1\right )} x^{2} \cos \left (2 \, b x + 2 \, a\right ) - {\left (2 \, c d x^{2} \sin \left (2 \, b x + 2 \, a\right ) - {\left (c^{2} - d^{2} + 1\right )} x^{2} \cos \left (2 \, b x + 2 \, a\right )\right )} \cos \left (4 \, b x + 4 \, a\right ) + {\left (2 \, c d x^{2} \cos \left (2 \, b x + 2 \, a\right ) + {\left (c^{2} - d^{2} + 1\right )} x^{2} \sin \left (2 \, b x + 2 \, a\right )\right )} \sin \left (4 \, b x + 4 \, a\right )}{c^{4} + d^{4} + 2 \, {\left (c^{2} - 1\right )} d^{2} + {\left (c^{4} + d^{4} + 2 \, {\left (c^{2} - 1\right )} d^{2} + 2 \, c^{2} + 1\right )} \cos \left (4 \, b x + 4 \, a\right )^{2} + 4 \, {\left (c^{4} + d^{4} + 2 \, {\left (c^{2} + 1\right )} d^{2} + 2 \, c^{2} + 1\right )} \cos \left (2 \, b x + 2 \, a\right )^{2} + {\left (c^{4} + d^{4} + 2 \, {\left (c^{2} - 1\right )} d^{2} + 2 \, c^{2} + 1\right )} \sin \left (4 \, b x + 4 \, a\right )^{2} + 4 \, {\left (c^{4} + d^{4} + 2 \, {\left (c^{2} + 1\right )} d^{2} + 2 \, c^{2} + 1\right )} \sin \left (2 \, b x + 2 \, a\right )^{2} + 2 \, c^{2} + 2 \, {\left (c^{4} + d^{4} - 2 \, {\left (3 \, c^{2} + 1\right )} d^{2} + 2 \, c^{2} + 2 \, {\left (c^{4} - d^{4} + 2 \, c^{2} + 1\right )} \cos \left (2 \, b x + 2 \, a\right ) - 4 \, {\left (c d^{3} + {\left (c^{3} + c\right )} d\right )} \sin \left (2 \, b x + 2 \, a\right ) + 1\right )} \cos \left (4 \, b x + 4 \, a\right ) + 4 \, {\left (c^{4} - d^{4} + 2 \, c^{2} + 1\right )} \cos \left (2 \, b x + 2 \, a\right ) - 4 \, {\left (2 \, c d^{3} - 2 \, {\left (c^{3} + c\right )} d - 2 \, {\left (c d^{3} + {\left (c^{3} + c\right )} d\right )} \cos \left (2 \, b x + 2 \, a\right ) - {\left (c^{4} - d^{4} + 2 \, c^{2} + 1\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} \sin \left (4 \, b x + 4 \, a\right ) + 8 \, {\left (c d^{3} + {\left (c^{3} + c\right )} d\right )} \sin \left (2 \, b x + 2 \, a\right ) + 1}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int x\,\mathrm {atan}\left (c+d\,\mathrm {tan}\left (a+b\,x\right )\right ) \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________