Optimal. Leaf size=93 \[ \frac {1}{2} i b x^2+x \tanh ^{-1}(1-i d+d \tan (a+b x))-\frac {1}{2} x \log \left (1+(1-i d) e^{2 i a+2 i b x}\right )+\frac {i \text {PolyLog}\left (2,-\left ((1-i d) e^{2 i a+2 i b x}\right )\right )}{4 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 93, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {6390, 2215,
2221, 2317, 2438} \begin {gather*} \frac {i \text {Li}_2\left (-\left ((1-i d) e^{2 i a+2 i b x}\right )\right )}{4 b}-\frac {1}{2} x \log \left (1+(1-i d) e^{2 i a+2 i b x}\right )+x \tanh ^{-1}(d \tan (a+b x)-i d+1)+\frac {1}{2} i b x^2 \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2215
Rule 2221
Rule 2317
Rule 2438
Rule 6390
Rubi steps
\begin {align*} \int \tanh ^{-1}(1-i d+d \tan (a+b x)) \, dx &=x \tanh ^{-1}(1-i d+d \tan (a+b x))+(i b) \int \frac {x}{1+(1-i d) e^{2 i a+2 i b x}} \, dx\\ &=\frac {1}{2} i b x^2+x \tanh ^{-1}(1-i d+d \tan (a+b x))-(b (i+d)) \int \frac {e^{2 i a+2 i b x} x}{1+(1-i d) e^{2 i a+2 i b x}} \, dx\\ &=\frac {1}{2} i b x^2+x \tanh ^{-1}(1-i d+d \tan (a+b x))-\frac {1}{2} x \log \left (1+(1-i d) e^{2 i a+2 i b x}\right )+\frac {1}{2} \int \log \left (1+(1-i d) e^{2 i a+2 i b x}\right ) \, dx\\ &=\frac {1}{2} i b x^2+x \tanh ^{-1}(1-i d+d \tan (a+b x))-\frac {1}{2} x \log \left (1+(1-i d) e^{2 i a+2 i b x}\right )-\frac {i \text {Subst}\left (\int \frac {\log (1+(1-i d) x)}{x} \, dx,x,e^{2 i a+2 i b x}\right )}{4 b}\\ &=\frac {1}{2} i b x^2+x \tanh ^{-1}(1-i d+d \tan (a+b x))-\frac {1}{2} x \log \left (1+(1-i d) e^{2 i a+2 i b x}\right )+\frac {i \text {Li}_2\left (-(1-i d) e^{2 i a+2 i b x}\right )}{4 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 6.22, size = 84, normalized size = 0.90 \begin {gather*} x \tanh ^{-1}(1-i d+d \tan (a+b x))-\frac {2 b x \log \left (1+\frac {i e^{-2 i (a+b x)}}{i+d}\right )+i \text {PolyLog}\left (2,-\frac {i e^{-2 i (a+b x)}}{i+d}\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. 320 vs. \(2 (76 ) = 152\).
time = 0.75, size = 321, normalized size = 3.45
method | result | size |
derivativedivides | \(\frac {\frac {i \arctanh \left (1-i d +d \tan \left (b x +a \right )\right ) d \ln \left (i d +d \tan \left (b x +a \right )\right )}{2}-\frac {i \arctanh \left (1-i d +d \tan \left (b x +a \right )\right ) d \ln \left (-i d +d \tan \left (b x +a \right )\right )}{2}-\frac {d^{2} \left (-\frac {i \dilog \left (\frac {i \left (-i d +d \tan \left (b x +a \right )\right )}{2 d}\right )}{2 d}-\frac {i \ln \left (i d +d \tan \left (b x +a \right )\right ) \ln \left (\frac {i \left (-i d +d \tan \left (b x +a \right )\right )}{2 d}\right )}{2 d}+\frac {i \dilog \left (\frac {i \left (i d +d \tan \left (b x +a \right )-i \left (2 d +2 i\right )\right )}{2 d +2 i}\right )}{2 d}+\frac {i \ln \left (i d +d \tan \left (b x +a \right )\right ) \ln \left (\frac {i \left (i d +d \tan \left (b x +a \right )-i \left (2 d +2 i\right )\right )}{2 d +2 i}\right )}{2 d}+\frac {i \ln \left (-i d +d \tan \left (b x +a \right )\right )^{2}}{4 d}-\frac {i \dilog \left (1-\frac {i d}{2}+\frac {d \tan \left (b x +a \right )}{2}\right )}{2 d}-\frac {i \ln \left (-i d +d \tan \left (b x +a \right )\right ) \ln \left (1-\frac {i d}{2}+\frac {d \tan \left (b x +a \right )}{2}\right )}{2 d}\right )}{2}}{b d}\) | \(321\) |
default | \(\frac {\frac {i \arctanh \left (1-i d +d \tan \left (b x +a \right )\right ) d \ln \left (i d +d \tan \left (b x +a \right )\right )}{2}-\frac {i \arctanh \left (1-i d +d \tan \left (b x +a \right )\right ) d \ln \left (-i d +d \tan \left (b x +a \right )\right )}{2}-\frac {d^{2} \left (-\frac {i \dilog \left (\frac {i \left (-i d +d \tan \left (b x +a \right )\right )}{2 d}\right )}{2 d}-\frac {i \ln \left (i d +d \tan \left (b x +a \right )\right ) \ln \left (\frac {i \left (-i d +d \tan \left (b x +a \right )\right )}{2 d}\right )}{2 d}+\frac {i \dilog \left (\frac {i \left (i d +d \tan \left (b x +a \right )-i \left (2 d +2 i\right )\right )}{2 d +2 i}\right )}{2 d}+\frac {i \ln \left (i d +d \tan \left (b x +a \right )\right ) \ln \left (\frac {i \left (i d +d \tan \left (b x +a \right )-i \left (2 d +2 i\right )\right )}{2 d +2 i}\right )}{2 d}+\frac {i \ln \left (-i d +d \tan \left (b x +a \right )\right )^{2}}{4 d}-\frac {i \dilog \left (1-\frac {i d}{2}+\frac {d \tan \left (b x +a \right )}{2}\right )}{2 d}-\frac {i \ln \left (-i d +d \tan \left (b x +a \right )\right ) \ln \left (1-\frac {i d}{2}+\frac {d \tan \left (b x +a \right )}{2}\right )}{2 d}\right )}{2}}{b d}\) | \(321\) |
risch | \(\text {Expression too large to display}\) | \(1623\) |
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. 260 vs. \(2 (65) = 130\).
time = 0.48, size = 260, normalized size = 2.80 \begin {gather*} -\frac {4 \, {\left (b x + a\right )} d {\left (\frac {\log \left (d \tan \left (b x + a\right ) - i \, d + 2\right )}{d} - \frac {\log \left (\tan \left (b x + a\right ) - i\right )}{d}\right )} + d {\left (-\frac {2 i \, {\left (\log \left (d \tan \left (b x + a\right ) - i \, d + 2\right ) \log \left (-\frac {i \, d \tan \left (b x + a\right ) + d + 2 i}{2 \, {\left (d + i\right )}} + 1\right ) + {\rm Li}_2\left (\frac {i \, d \tan \left (b x + a\right ) + d + 2 i}{2 \, {\left (d + i\right )}}\right )\right )}}{d} + \frac {2 i \, \log \left (d \tan \left (b x + a\right ) - i \, d + 2\right ) \log \left (\tan \left (b x + a\right ) - i\right ) - i \, \log \left (\tan \left (b x + a\right ) - i\right )^{2}}{d} - \frac {2 i \, {\left (\log \left (\frac {1}{2} \, d \tan \left (b x + a\right ) - \frac {1}{2} i \, d + 1\right ) \log \left (\tan \left (b x + a\right ) - i\right ) + {\rm Li}_2\left (-\frac {1}{2} \, d \tan \left (b x + a\right ) + \frac {1}{2} i \, d\right )\right )}}{d} + \frac {2 i \, {\left (\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 ) + {\rm Li}_2\left (\frac {1}{2} i \, \tan \left (b x + a\right ) + \frac {1}{2}\right )\right )}}{d}\right )} - 8 \, {\left (b x + a\right )} \operatorname {artanh}\left (d \tan \left (b x + a\right ) - i \, d + 1\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. 218 vs. \(2 (65) = 130\).
time = 0.40, size = 218, normalized size = 2.34 \begin {gather*} \frac {i \, b^{2} x^{2} + b x \log \left (-\frac {{\left ({\left (d + i\right )} e^{\left (2 i \, b x + 2 i \, a\right )} + i\right )} e^{\left (-2 i \, b x - 2 i \, a\right )}}{d}\right ) - i \, a^{2} - {\left (b x + a\right )} \log \left (\frac {1}{2} \, \sqrt {4 i \, d - 4} e^{\left (i \, b x + i \, a\right )} + 1\right ) - {\left (b x + a\right )} \log \left (-\frac {1}{2} \, \sqrt {4 i \, d - 4} e^{\left (i \, b x + i \, a\right )} + 1\right ) + a \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 ) + a \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 ) + i \, {\rm Li}_2\left (\frac {1}{2} \, \sqrt {4 i \, d - 4} e^{\left (i \, b x + i \, a\right )}\right ) + i \, {\rm Li}_2\left (-\frac {1}{2} \, \sqrt {4 i \, d - 4} 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]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \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 \mathrm {atanh}\left (d\,\mathrm {tan}\left (a+b\,x\right )+1-d\,1{}\mathrm {i}\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________