Optimal. Leaf size=134 \[ \frac {1}{6} i b x^3+\frac {1}{2} x^2 \tanh ^{-1}(1+i d-d \tan (a+b x))-\frac {1}{4} x^2 \log \left (1+(1+i d) e^{2 i a+2 i b x}\right )+\frac {i x \text {PolyLog}\left (2,-\left ((1+i d) e^{2 i a+2 i b x}\right )\right )}{4 b}-\frac {\text {PolyLog}\left (3,-\left ((1+i d) e^{2 i a+2 i b x}\right )\right )}{8 b^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.17, antiderivative size = 134, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.316, Rules used = {6398, 2215,
2221, 2611, 2320, 6724} \begin {gather*} -\frac {\text {Li}_3\left (-\left ((i d+1) e^{2 i a+2 i b x}\right )\right )}{8 b^2}+\frac {i x \text {Li}_2\left (-\left ((i d+1) e^{2 i a+2 i b x}\right )\right )}{4 b}-\frac {1}{4} x^2 \log \left (1+(1+i d) e^{2 i a+2 i b x}\right )+\frac {1}{2} x^2 \tanh ^{-1}(d (-\tan (a+b x))+i d+1)+\frac {1}{6} i b x^3 \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2215
Rule 2221
Rule 2320
Rule 2611
Rule 6398
Rule 6724
Rubi steps
\begin {align*} \int x \tanh ^{-1}(1+i d-d \tan (a+b x)) \, dx &=\frac {1}{2} x^2 \tanh ^{-1}(1+i d-d \tan (a+b x))+\frac {1}{2} (i b) \int \frac {x^2}{1+(1+i d) e^{2 i a+2 i b x}} \, dx\\ &=\frac {1}{6} i b x^3+\frac {1}{2} x^2 \tanh ^{-1}(1+i d-d \tan (a+b x))-\frac {1}{2} (b (i-d)) \int \frac {e^{2 i a+2 i b x} x^2}{1+(1+i d) e^{2 i a+2 i b x}} \, dx\\ &=\frac {1}{6} i b x^3+\frac {1}{2} x^2 \tanh ^{-1}(1+i d-d \tan (a+b x))-\frac {1}{4} x^2 \log \left (1+(1+i d) e^{2 i a+2 i b x}\right )+\frac {1}{2} \int x \log \left (1+(1+i d) e^{2 i a+2 i b x}\right ) \, dx\\ &=\frac {1}{6} i b x^3+\frac {1}{2} x^2 \tanh ^{-1}(1+i d-d \tan (a+b x))-\frac {1}{4} x^2 \log \left (1+(1+i d) e^{2 i a+2 i b x}\right )+\frac {i x \text {Li}_2\left (-(1+i d) e^{2 i a+2 i b x}\right )}{4 b}-\frac {i \int \text {Li}_2\left (-(1+i d) e^{2 i a+2 i b x}\right ) \, dx}{4 b}\\ &=\frac {1}{6} i b x^3+\frac {1}{2} x^2 \tanh ^{-1}(1+i d-d \tan (a+b x))-\frac {1}{4} x^2 \log \left (1+(1+i d) e^{2 i a+2 i b x}\right )+\frac {i x \text {Li}_2\left (-(1+i d) e^{2 i a+2 i b x}\right )}{4 b}-\frac {\text {Subst}\left (\int \frac {\text {Li}_2((-1-i d) x)}{x} \, dx,x,e^{2 i a+2 i b x}\right )}{8 b^2}\\ &=\frac {1}{6} i b x^3+\frac {1}{2} x^2 \tanh ^{-1}(1+i d-d \tan (a+b x))-\frac {1}{4} x^2 \log \left (1+(1+i d) e^{2 i a+2 i b x}\right )+\frac {i x \text {Li}_2\left (-(1+i d) e^{2 i a+2 i b x}\right )}{4 b}-\frac {\text {Li}_3\left (-(1+i d) e^{2 i a+2 i b x}\right )}{8 b^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.23, size = 120, normalized size = 0.90 \begin {gather*} \frac {1}{2} x^2 \tanh ^{-1}(1+i d-d \tan (a+b x))-\frac {2 b^2 x^2 \log \left (1-\frac {i e^{-2 i (a+b x)}}{-i+d}\right )+2 i b x \text {PolyLog}\left (2,\frac {i e^{-2 i (a+b x)}}{-i+d}\right )+\text {PolyLog}\left (3,\frac {i e^{-2 i (a+b x)}}{-i+d}\right )}{8 b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 1.27, size = 2358, normalized size = 17.60
method | result | size |
risch | \(\text {Expression too large to display}\) | \(2358\) |
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. 247 vs. \(2 (93) = 186\).
time = 0.28, size = 247, normalized size = 1.84 \begin {gather*} -\frac {\frac {12 \, {\left ({\left (b x + a\right )}^{2} - 2 \, {\left (b x + a\right )} a\right )} \operatorname {artanh}\left (d \tan \left (b x + a\right ) - i \, d - 1\right )}{b} + \frac {-4 i \, {\left (b x + a\right )}^{3} + 12 i \, {\left (b x + a\right )}^{2} a - 6 i \, b x {\rm Li}_2\left ({\left (-i \, d - 1\right )} e^{\left (2 i \, b x + 2 i \, a\right )}\right ) - 6 \, {\left (-i \, {\left (b x + a\right )}^{2} + 2 i \, {\left (b x + a\right )} a\right )} \arctan \left (d \cos \left (2 \, b x + 2 \, a\right ) + \sin \left (2 \, b x + 2 \, a\right ), -d \sin \left (2 \, b x + 2 \, a\right ) + \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) + 3 \, {\left ({\left (b x + a\right )}^{2} - 2 \, {\left (b x + a\right )} a\right )} \log \left ({\left (d^{2} + 1\right )} \cos \left (2 \, b x + 2 \, a\right )^{2} + {\left (d^{2} + 1\right )} \sin \left (2 \, b x + 2 \, a\right )^{2} - 2 \, d \sin \left (2 \, b x + 2 \, a\right ) + 2 \, \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) + 3 \, {\rm Li}_{3}({\left (-i \, d - 1\right )} e^{\left (2 i \, b x + 2 i \, a\right )})}{b}}{24 \, 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. 293 vs. \(2 (93) = 186\).
time = 0.44, size = 293, normalized size = 2.19 \begin {gather*} \frac {2 i \, b^{3} x^{3} - 3 \, b^{2} x^{2} \log \left (-\frac {d e^{\left (2 i \, b x + 2 i \, a\right )}}{{\left (d - i\right )} e^{\left (2 i \, b x + 2 i \, a\right )} - i}\right ) + 2 i \, a^{3} + 6 i \, b x {\rm Li}_2\left (\frac {1}{2} \, \sqrt {-4 i \, d - 4} e^{\left (i \, b x + i \, a\right )}\right ) + 6 i \, b x {\rm Li}_2\left (-\frac {1}{2} \, \sqrt {-4 i \, d - 4} e^{\left (i \, b x + i \, a\right )}\right ) - 3 \, a^{2} \log \left (\frac {2 \, {\left (d - i\right )} e^{\left (i \, b x + i \, a\right )} + i \, \sqrt {-4 i \, d - 4}}{2 \, {\left (d - i\right )}}\right ) - 3 \, a^{2} \log \left (\frac {2 \, {\left (d - i\right )} e^{\left (i \, b x + i \, a\right )} - i \, \sqrt {-4 i \, d - 4}}{2 \, {\left (d - i\right )}}\right ) - 3 \, {\left (b^{2} x^{2} - a^{2}\right )} \log \left (\frac {1}{2} \, \sqrt {-4 i \, d - 4} e^{\left (i \, b x + i \, a\right )} + 1\right ) - 3 \, {\left (b^{2} x^{2} - a^{2}\right )} \log \left (-\frac {1}{2} \, \sqrt {-4 i \, d - 4} e^{\left (i \, b x + i \, a\right )} + 1\right ) - 6 \, {\rm polylog}\left (3, \frac {1}{2} \, \sqrt {-4 i \, d - 4} e^{\left (i \, b x + i \, a\right )}\right ) - 6 \, {\rm polylog}\left (3, -\frac {1}{2} \, \sqrt {-4 i \, d - 4} e^{\left (i \, b x + i \, a\right )}\right )}{12 \, b^{2}} \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 x \operatorname {atanh}{\left (- d \tan {\left (a + b x \right )} + i d + 1 \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 x\,\mathrm {atanh}\left (1-d\,\mathrm {tan}\left (a+b\,x\right )+d\,1{}\mathrm {i}\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________