Optimal. Leaf size=91 \[ \frac {x \text {ArcTan}\left (e^{a+b x}\right )}{b}-\frac {i \text {PolyLog}\left (2,-i e^{a+b x}\right )}{2 b^2}+\frac {i \text {PolyLog}\left (2,i e^{a+b x}\right )}{2 b^2}-\frac {\text {sech}(a+b x)}{2 b^2}-\frac {x \text {sech}(a+b x) \tanh (a+b x)}{2 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 91, normalized size of antiderivative = 1.00, number of steps
used = 12, number of rules used = 5, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {5563, 4265,
2317, 2438, 4270} \begin {gather*} \frac {x \text {ArcTan}\left (e^{a+b x}\right )}{b}-\frac {i \text {Li}_2\left (-i e^{a+b x}\right )}{2 b^2}+\frac {i \text {Li}_2\left (i e^{a+b x}\right )}{2 b^2}-\frac {\text {sech}(a+b x)}{2 b^2}-\frac {x \tanh (a+b x) \text {sech}(a+b x)}{2 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2317
Rule 2438
Rule 4265
Rule 4270
Rule 5563
Rubi steps
\begin {align*} \int x \text {sech}(a+b x) \tanh ^2(a+b x) \, dx &=\int x \text {sech}(a+b x) \, dx-\int x \text {sech}^3(a+b x) \, dx\\ &=\frac {2 x \tan ^{-1}\left (e^{a+b x}\right )}{b}-\frac {\text {sech}(a+b x)}{2 b^2}-\frac {x \text {sech}(a+b x) \tanh (a+b x)}{2 b}-\frac {1}{2} \int x \text {sech}(a+b x) \, dx-\frac {i \int \log \left (1-i e^{a+b x}\right ) \, dx}{b}+\frac {i \int \log \left (1+i e^{a+b x}\right ) \, dx}{b}\\ &=\frac {x \tan ^{-1}\left (e^{a+b x}\right )}{b}-\frac {\text {sech}(a+b x)}{2 b^2}-\frac {x \text {sech}(a+b x) \tanh (a+b x)}{2 b}-\frac {i \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{a+b x}\right )}{b^2}+\frac {i \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{a+b x}\right )}{b^2}+\frac {i \int \log \left (1-i e^{a+b x}\right ) \, dx}{2 b}-\frac {i \int \log \left (1+i e^{a+b x}\right ) \, dx}{2 b}\\ &=\frac {x \tan ^{-1}\left (e^{a+b x}\right )}{b}-\frac {i \text {Li}_2\left (-i e^{a+b x}\right )}{b^2}+\frac {i \text {Li}_2\left (i e^{a+b x}\right )}{b^2}-\frac {\text {sech}(a+b x)}{2 b^2}-\frac {x \text {sech}(a+b x) \tanh (a+b x)}{2 b}+\frac {i \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{a+b x}\right )}{2 b^2}-\frac {i \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{a+b x}\right )}{2 b^2}\\ &=\frac {x \tan ^{-1}\left (e^{a+b x}\right )}{b}-\frac {i \text {Li}_2\left (-i e^{a+b x}\right )}{2 b^2}+\frac {i \text {Li}_2\left (i e^{a+b x}\right )}{2 b^2}-\frac {\text {sech}(a+b x)}{2 b^2}-\frac {x \text {sech}(a+b x) \tanh (a+b x)}{2 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.55, size = 93, normalized size = 1.02 \begin {gather*} -\frac {-2 b x \text {ArcTan}(\cosh (a+b x)+\sinh (a+b x))+i \text {PolyLog}(2,-i (\cosh (a+b x)+\sinh (a+b x)))-i \text {PolyLog}(2,i (\cosh (a+b x)+\sinh (a+b x)))+\text {sech}(a+b x)+b x \text {sech}(a+b x) \tanh (a+b x)}{2 b^2} \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. 177 vs. \(2 (76 ) = 152\).
time = 1.36, size = 178, normalized size = 1.96
method | result | size |
risch | \(-\frac {{\mathrm e}^{b x +a} \left (b x \,{\mathrm e}^{2 b x +2 a}-b x +{\mathrm e}^{2 b x +2 a}+1\right )}{b^{2} \left ({\mathrm e}^{2 b x +2 a}+1\right )^{2}}-\frac {i \ln \left (1+i {\mathrm e}^{b x +a}\right ) x}{2 b}-\frac {i \ln \left (1+i {\mathrm e}^{b x +a}\right ) a}{2 b^{2}}+\frac {i \ln \left (1-i {\mathrm e}^{b x +a}\right ) x}{2 b}+\frac {i \ln \left (1-i {\mathrm e}^{b x +a}\right ) a}{2 b^{2}}-\frac {i \dilog \left (1+i {\mathrm e}^{b x +a}\right )}{2 b^{2}}+\frac {i \dilog \left (1-i {\mathrm e}^{b x +a}\right )}{2 b^{2}}-\frac {a \arctan \left ({\mathrm e}^{b x +a}\right )}{b^{2}}\) | \(178\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \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. 1064 vs. \(2 (70) = 140\).
time = 0.38, size = 1064, normalized size = 11.69 \begin {gather*} -\frac {2 \, {\left (b x + 1\right )} \cosh \left (b x + a\right )^{3} + 6 \, {\left (b x + 1\right )} \cosh \left (b x + a\right ) \sinh \left (b x + a\right )^{2} + 2 \, {\left (b x + 1\right )} \sinh \left (b x + a\right )^{3} - 2 \, {\left (b x - 1\right )} \cosh \left (b x + a\right ) - {\left (i \, \cosh \left (b x + a\right )^{4} + 4 i \, \cosh \left (b x + a\right ) \sinh \left (b x + a\right )^{3} + i \, \sinh \left (b x + a\right )^{4} - 2 \, {\left (-3 i \, \cosh \left (b x + a\right )^{2} - i\right )} \sinh \left (b x + a\right )^{2} + 2 i \, \cosh \left (b x + a\right )^{2} - 4 \, {\left (-i \, \cosh \left (b x + a\right )^{3} - i \, \cosh \left (b x + a\right )\right )} \sinh \left (b x + a\right ) + i\right )} {\rm Li}_2\left (i \, \cosh \left (b x + a\right ) + i \, \sinh \left (b x + a\right )\right ) - {\left (-i \, \cosh \left (b x + a\right )^{4} - 4 i \, \cosh \left (b x + a\right ) \sinh \left (b x + a\right )^{3} - i \, \sinh \left (b x + a\right )^{4} - 2 \, {\left (3 i \, \cosh \left (b x + a\right )^{2} + i\right )} \sinh \left (b x + a\right )^{2} - 2 i \, \cosh \left (b x + a\right )^{2} - 4 \, {\left (i \, \cosh \left (b x + a\right )^{3} + i \, \cosh \left (b x + a\right )\right )} \sinh \left (b x + a\right ) - i\right )} {\rm Li}_2\left (-i \, \cosh \left (b x + a\right ) - i \, \sinh \left (b x + a\right )\right ) - {\left (-i \, a \cosh \left (b x + a\right )^{4} - 4 i \, a \cosh \left (b x + a\right ) \sinh \left (b x + a\right )^{3} - i \, a \sinh \left (b x + a\right )^{4} - 2 i \, a \cosh \left (b x + a\right )^{2} - 2 \, {\left (3 i \, a \cosh \left (b x + a\right )^{2} + i \, a\right )} \sinh \left (b x + a\right )^{2} - 4 \, {\left (i \, a \cosh \left (b x + a\right )^{3} + i \, a \cosh \left (b x + a\right )\right )} \sinh \left (b x + a\right ) - i \, a\right )} \log \left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right ) + i\right ) - {\left (i \, a \cosh \left (b x + a\right )^{4} + 4 i \, a \cosh \left (b x + a\right ) \sinh \left (b x + a\right )^{3} + i \, a \sinh \left (b x + a\right )^{4} + 2 i \, a \cosh \left (b x + a\right )^{2} - 2 \, {\left (-3 i \, a \cosh \left (b x + a\right )^{2} - i \, a\right )} \sinh \left (b x + a\right )^{2} - 4 \, {\left (-i \, a \cosh \left (b x + a\right )^{3} - i \, a \cosh \left (b x + a\right )\right )} \sinh \left (b x + a\right ) + i \, a\right )} \log \left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right ) - i\right ) - {\left ({\left (-i \, b x - i \, a\right )} \cosh \left (b x + a\right )^{4} - 4 \, {\left (i \, b x + i \, a\right )} \cosh \left (b x + a\right ) \sinh \left (b x + a\right )^{3} + {\left (-i \, b x - i \, a\right )} \sinh \left (b x + a\right )^{4} - 2 \, {\left (i \, b x + i \, a\right )} \cosh \left (b x + a\right )^{2} - 2 \, {\left (3 \, {\left (i \, b x + i \, a\right )} \cosh \left (b x + a\right )^{2} + i \, b x + i \, a\right )} \sinh \left (b x + a\right )^{2} - i \, b x - 4 \, {\left ({\left (i \, b x + i \, a\right )} \cosh \left (b x + a\right )^{3} + {\left (i \, b x + i \, a\right )} \cosh \left (b x + a\right )\right )} \sinh \left (b x + a\right ) - i \, a\right )} \log \left (i \, \cosh \left (b x + a\right ) + i \, \sinh \left (b x + a\right ) + 1\right ) - {\left ({\left (i \, b x + i \, a\right )} \cosh \left (b x + a\right )^{4} - 4 \, {\left (-i \, b x - i \, a\right )} \cosh \left (b x + a\right ) \sinh \left (b x + a\right )^{3} + {\left (i \, b x + i \, a\right )} \sinh \left (b x + a\right )^{4} - 2 \, {\left (-i \, b x - i \, a\right )} \cosh \left (b x + a\right )^{2} - 2 \, {\left (3 \, {\left (-i \, b x - i \, a\right )} \cosh \left (b x + a\right )^{2} - i \, b x - i \, a\right )} \sinh \left (b x + a\right )^{2} + i \, b x - 4 \, {\left ({\left (-i \, b x - i \, a\right )} \cosh \left (b x + a\right )^{3} + {\left (-i \, b x - i \, a\right )} \cosh \left (b x + a\right )\right )} \sinh \left (b x + a\right ) + i \, a\right )} \log \left (-i \, \cosh \left (b x + a\right ) - i \, \sinh \left (b x + a\right ) + 1\right ) + 2 \, {\left (3 \, {\left (b x + 1\right )} \cosh \left (b x + a\right )^{2} - b x + 1\right )} \sinh \left (b x + a\right )}{2 \, {\left (b^{2} \cosh \left (b x + a\right )^{4} + 4 \, b^{2} \cosh \left (b x + a\right ) \sinh \left (b x + a\right )^{3} + b^{2} \sinh \left (b x + a\right )^{4} + 2 \, b^{2} \cosh \left (b x + a\right )^{2} + 2 \, {\left (3 \, b^{2} \cosh \left (b x + a\right )^{2} + b^{2}\right )} \sinh \left (b x + a\right )^{2} + b^{2} + 4 \, {\left (b^{2} \cosh \left (b x + a\right )^{3} + b^{2} \cosh \left (b x + a\right )\right )} \sinh \left (b x + a\right )\right )}} \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 \sinh ^{2}{\left (a + b x \right )} \operatorname {sech}^{3}{\left (a + b x \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 \frac {x\,{\mathrm {sinh}\left (a+b\,x\right )}^2}{{\mathrm {cosh}\left (a+b\,x\right )}^3} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________