\(\int x^3 \text {sech}(a+b x) \tanh (a+b x) \, dx\) [41]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [F]
Fricas [B] (verification not implemented)
Sympy [F]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 16, antiderivative size = 113 \[ \int x^3 \text {sech}(a+b x) \tanh (a+b x) \, dx=\frac {6 x^2 \arctan \left (e^{a+b x}\right )}{b^2}-\frac {6 i x \operatorname {PolyLog}\left (2,-i e^{a+b x}\right )}{b^3}+\frac {6 i x \operatorname {PolyLog}\left (2,i e^{a+b x}\right )}{b^3}+\frac {6 i \operatorname {PolyLog}\left (3,-i e^{a+b x}\right )}{b^4}-\frac {6 i \operatorname {PolyLog}\left (3,i e^{a+b x}\right )}{b^4}-\frac {x^3 \text {sech}(a+b x)}{b} \] Output:

6*x^2*arctan(exp(b*x+a))/b^2-6*I*x*polylog(2,-I*exp(b*x+a))/b^3+6*I*x*poly 
log(2,I*exp(b*x+a))/b^3+6*I*polylog(3,-I*exp(b*x+a))/b^4-6*I*polylog(3,I*e 
xp(b*x+a))/b^4-x^3*sech(b*x+a)/b
 

Mathematica [A] (verified)

Time = 0.25 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.15 \[ \int x^3 \text {sech}(a+b x) \tanh (a+b x) \, dx=\frac {3 i \left (b^2 x^2 \log \left (1-i e^{a+b x}\right )-b^2 x^2 \log \left (1+i e^{a+b x}\right )-2 b x \operatorname {PolyLog}\left (2,-i e^{a+b x}\right )+2 b x \operatorname {PolyLog}\left (2,i e^{a+b x}\right )+2 \operatorname {PolyLog}\left (3,-i e^{a+b x}\right )-2 \operatorname {PolyLog}\left (3,i e^{a+b x}\right )\right )}{b^4}-\frac {x^3 \text {sech}(a+b x)}{b} \] Input:

Integrate[x^3*Sech[a + b*x]*Tanh[a + b*x],x]
 

Output:

((3*I)*(b^2*x^2*Log[1 - I*E^(a + b*x)] - b^2*x^2*Log[1 + I*E^(a + b*x)] - 
2*b*x*PolyLog[2, (-I)*E^(a + b*x)] + 2*b*x*PolyLog[2, I*E^(a + b*x)] + 2*P 
olyLog[3, (-I)*E^(a + b*x)] - 2*PolyLog[3, I*E^(a + b*x)]))/b^4 - (x^3*Sec 
h[a + b*x])/b
 

Rubi [A] (verified)

Time = 0.95 (sec) , antiderivative size = 125, normalized size of antiderivative = 1.11, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {5941, 3042, 4668, 3011, 2720, 7143}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int x^3 \tanh (a+b x) \text {sech}(a+b x) \, dx\)

\(\Big \downarrow \) 5941

\(\displaystyle \frac {3 \int x^2 \text {sech}(a+b x)dx}{b}-\frac {x^3 \text {sech}(a+b x)}{b}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {x^3 \text {sech}(a+b x)}{b}+\frac {3 \int x^2 \csc \left (i a+i b x+\frac {\pi }{2}\right )dx}{b}\)

\(\Big \downarrow \) 4668

\(\displaystyle -\frac {x^3 \text {sech}(a+b x)}{b}+\frac {3 \left (-\frac {2 i \int x \log \left (1-i e^{a+b x}\right )dx}{b}+\frac {2 i \int x \log \left (1+i e^{a+b x}\right )dx}{b}+\frac {2 x^2 \arctan \left (e^{a+b x}\right )}{b}\right )}{b}\)

\(\Big \downarrow \) 3011

\(\displaystyle -\frac {x^3 \text {sech}(a+b x)}{b}+\frac {3 \left (\frac {2 i \left (\frac {\int \operatorname {PolyLog}\left (2,-i e^{a+b x}\right )dx}{b}-\frac {x \operatorname {PolyLog}\left (2,-i e^{a+b x}\right )}{b}\right )}{b}-\frac {2 i \left (\frac {\int \operatorname {PolyLog}\left (2,i e^{a+b x}\right )dx}{b}-\frac {x \operatorname {PolyLog}\left (2,i e^{a+b x}\right )}{b}\right )}{b}+\frac {2 x^2 \arctan \left (e^{a+b x}\right )}{b}\right )}{b}\)

\(\Big \downarrow \) 2720

\(\displaystyle -\frac {x^3 \text {sech}(a+b x)}{b}+\frac {3 \left (\frac {2 i \left (\frac {\int e^{-a-b x} \operatorname {PolyLog}\left (2,-i e^{a+b x}\right )de^{a+b x}}{b^2}-\frac {x \operatorname {PolyLog}\left (2,-i e^{a+b x}\right )}{b}\right )}{b}-\frac {2 i \left (\frac {\int e^{-a-b x} \operatorname {PolyLog}\left (2,i e^{a+b x}\right )de^{a+b x}}{b^2}-\frac {x \operatorname {PolyLog}\left (2,i e^{a+b x}\right )}{b}\right )}{b}+\frac {2 x^2 \arctan \left (e^{a+b x}\right )}{b}\right )}{b}\)

\(\Big \downarrow \) 7143

\(\displaystyle -\frac {x^3 \text {sech}(a+b x)}{b}+\frac {3 \left (\frac {2 x^2 \arctan \left (e^{a+b x}\right )}{b}+\frac {2 i \left (\frac {\operatorname {PolyLog}\left (3,-i e^{a+b x}\right )}{b^2}-\frac {x \operatorname {PolyLog}\left (2,-i e^{a+b x}\right )}{b}\right )}{b}-\frac {2 i \left (\frac {\operatorname {PolyLog}\left (3,i e^{a+b x}\right )}{b^2}-\frac {x \operatorname {PolyLog}\left (2,i e^{a+b x}\right )}{b}\right )}{b}\right )}{b}\)

Input:

Int[x^3*Sech[a + b*x]*Tanh[a + b*x],x]
 

Output:

(3*((2*x^2*ArcTan[E^(a + b*x)])/b + ((2*I)*(-((x*PolyLog[2, (-I)*E^(a + b* 
x)])/b) + PolyLog[3, (-I)*E^(a + b*x)]/b^2))/b - ((2*I)*(-((x*PolyLog[2, I 
*E^(a + b*x)])/b) + PolyLog[3, I*E^(a + b*x)]/b^2))/b))/b - (x^3*Sech[a + 
b*x])/b
 

Defintions of rubi rules used

rule 2720
Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Simp[v/D[v, x] 
   Subst[Int[FunctionOfExponentialFunction[u, x]/x, x], x, v], x]] /; Funct 
ionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; FreeQ 
[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x)) 
*(F_)[v_] /; FreeQ[{a, b, c}, x] && InverseFunctionQ[F[x]]]
 

rule 3011
Int[Log[1 + (e_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.)]*((f_.) + (g_.) 
*(x_))^(m_.), x_Symbol] :> Simp[(-(f + g*x)^m)*(PolyLog[2, (-e)*(F^(c*(a + 
b*x)))^n]/(b*c*n*Log[F])), x] + Simp[g*(m/(b*c*n*Log[F]))   Int[(f + g*x)^( 
m - 1)*PolyLog[2, (-e)*(F^(c*(a + b*x)))^n], x], x] /; FreeQ[{F, a, b, c, e 
, f, g, n}, x] && GtQ[m, 0]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4668
Int[csc[(e_.) + Pi*(k_.) + (Complex[0, fz_])*(f_.)*(x_)]*((c_.) + (d_.)*(x_ 
))^(m_.), x_Symbol] :> Simp[-2*(c + d*x)^m*(ArcTanh[E^((-I)*e + f*fz*x)/E^( 
I*k*Pi)]/(f*fz*I)), x] + (-Simp[d*(m/(f*fz*I))   Int[(c + d*x)^(m - 1)*Log[ 
1 - E^((-I)*e + f*fz*x)/E^(I*k*Pi)], x], x] + Simp[d*(m/(f*fz*I))   Int[(c 
+ d*x)^(m - 1)*Log[1 + E^((-I)*e + f*fz*x)/E^(I*k*Pi)], x], x]) /; FreeQ[{c 
, d, e, f, fz}, x] && IntegerQ[2*k] && IGtQ[m, 0]
 

rule 5941
Int[(x_)^(m_.)*Sech[(a_.) + (b_.)*(x_)^(n_.)]^(p_.)*Tanh[(a_.) + (b_.)*(x_) 
^(n_.)]^(q_.), x_Symbol] :> Simp[(-x^(m - n + 1))*(Sech[a + b*x^n]^p/(b*n*p 
)), x] + Simp[(m - n + 1)/(b*n*p)   Int[x^(m - n)*Sech[a + b*x^n]^p, x], x] 
 /; FreeQ[{a, b, p}, x] && RationalQ[m] && IntegerQ[n] && GeQ[m - n, 0] && 
EqQ[q, 1]
 

rule 7143
Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_S 
ymbol] :> Simp[PolyLog[n + 1, c*(a + b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d 
, e, n, p}, x] && EqQ[b*d, a*e]
 
Maple [F]

\[\int x^{3} \operatorname {sech}\left (b x +a \right ) \tanh \left (b x +a \right )d x\]

Input:

int(x^3*sech(b*x+a)*tanh(b*x+a),x)
 

Output:

int(x^3*sech(b*x+a)*tanh(b*x+a),x)
 

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 672 vs. \(2 (90) = 180\).

Time = 0.10 (sec) , antiderivative size = 672, normalized size of antiderivative = 5.95 \[ \int x^3 \text {sech}(a+b x) \tanh (a+b x) \, dx =\text {Too large to display} \] Input:

integrate(x^3*sech(b*x+a)*tanh(b*x+a),x, algorithm="fricas")
 

Output:

-(2*b^3*x^3*cosh(b*x + a) + 2*b^3*x^3*sinh(b*x + a) + 6*(-I*b*x*cosh(b*x + 
 a)^2 - 2*I*b*x*cosh(b*x + a)*sinh(b*x + a) - I*b*x*sinh(b*x + a)^2 - I*b* 
x)*dilog(I*cosh(b*x + a) + I*sinh(b*x + a)) + 6*(I*b*x*cosh(b*x + a)^2 + 2 
*I*b*x*cosh(b*x + a)*sinh(b*x + a) + I*b*x*sinh(b*x + a)^2 + I*b*x)*dilog( 
-I*cosh(b*x + a) - I*sinh(b*x + a)) + 3*(-I*a^2*cosh(b*x + a)^2 - 2*I*a^2* 
cosh(b*x + a)*sinh(b*x + a) - I*a^2*sinh(b*x + a)^2 - I*a^2)*log(cosh(b*x 
+ a) + sinh(b*x + a) + I) + 3*(I*a^2*cosh(b*x + a)^2 + 2*I*a^2*cosh(b*x + 
a)*sinh(b*x + a) + I*a^2*sinh(b*x + a)^2 + I*a^2)*log(cosh(b*x + a) + sinh 
(b*x + a) - I) + 3*(I*b^2*x^2 + (I*b^2*x^2 - I*a^2)*cosh(b*x + a)^2 + 2*(I 
*b^2*x^2 - I*a^2)*cosh(b*x + a)*sinh(b*x + a) + (I*b^2*x^2 - I*a^2)*sinh(b 
*x + a)^2 - I*a^2)*log(I*cosh(b*x + a) + I*sinh(b*x + a) + 1) + 3*(-I*b^2* 
x^2 + (-I*b^2*x^2 + I*a^2)*cosh(b*x + a)^2 + 2*(-I*b^2*x^2 + I*a^2)*cosh(b 
*x + a)*sinh(b*x + a) + (-I*b^2*x^2 + I*a^2)*sinh(b*x + a)^2 + I*a^2)*log( 
-I*cosh(b*x + a) - I*sinh(b*x + a) + 1) + 6*(I*cosh(b*x + a)^2 + 2*I*cosh( 
b*x + a)*sinh(b*x + a) + I*sinh(b*x + a)^2 + I)*polylog(3, I*cosh(b*x + a) 
 + I*sinh(b*x + a)) + 6*(-I*cosh(b*x + a)^2 - 2*I*cosh(b*x + a)*sinh(b*x + 
 a) - I*sinh(b*x + a)^2 - I)*polylog(3, -I*cosh(b*x + a) - I*sinh(b*x + a) 
))/(b^4*cosh(b*x + a)^2 + 2*b^4*cosh(b*x + a)*sinh(b*x + a) + b^4*sinh(b*x 
 + a)^2 + b^4)
                                                                                    
                                                                                    
 

Sympy [F]

\[ \int x^3 \text {sech}(a+b x) \tanh (a+b x) \, dx=\int x^{3} \tanh {\left (a + b x \right )} \operatorname {sech}{\left (a + b x \right )}\, dx \] Input:

integrate(x**3*sech(b*x+a)*tanh(b*x+a),x)
 

Output:

Integral(x**3*tanh(a + b*x)*sech(a + b*x), x)
 

Maxima [F]

\[ \int x^3 \text {sech}(a+b x) \tanh (a+b x) \, dx=\int { x^{3} \operatorname {sech}\left (b x + a\right ) \tanh \left (b x + a\right ) \,d x } \] Input:

integrate(x^3*sech(b*x+a)*tanh(b*x+a),x, algorithm="maxima")
 

Output:

-2*x^3*e^(b*x + a)/(b*e^(2*b*x + 2*a) + b) + 6*integrate(x^2*e^(b*x + a)/( 
b*e^(2*b*x + 2*a) + b), x)
 

Giac [F]

\[ \int x^3 \text {sech}(a+b x) \tanh (a+b x) \, dx=\int { x^{3} \operatorname {sech}\left (b x + a\right ) \tanh \left (b x + a\right ) \,d x } \] Input:

integrate(x^3*sech(b*x+a)*tanh(b*x+a),x, algorithm="giac")
 

Output:

integrate(x^3*sech(b*x + a)*tanh(b*x + a), x)
 

Mupad [F(-1)]

Timed out. \[ \int x^3 \text {sech}(a+b x) \tanh (a+b x) \, dx=\int \frac {x^3\,\mathrm {tanh}\left (a+b\,x\right )}{\mathrm {cosh}\left (a+b\,x\right )} \,d x \] Input:

int((x^3*tanh(a + b*x))/cosh(a + b*x),x)
 

Output:

int((x^3*tanh(a + b*x))/cosh(a + b*x), x)
 

Reduce [F]

\[ \int x^3 \text {sech}(a+b x) \tanh (a+b x) \, dx=\frac {12 e^{2 b x +2 a} \mathit {atan} \left (e^{b x +a}\right )+12 \mathit {atan} \left (e^{b x +a}\right )+12 e^{2 b x +3 a} \left (\int \frac {e^{b x} x^{2}}{e^{4 b x +4 a}+2 e^{2 b x +2 a}+1}d x \right ) b^{3}+24 e^{2 b x +3 a} \left (\int \frac {e^{b x} x}{e^{4 b x +4 a}+2 e^{2 b x +2 a}+1}d x \right ) b^{2}-2 e^{b x +a} b^{3} x^{3}-6 e^{b x +a} b^{2} x^{2}-12 e^{b x +a} b x +12 e^{a} \left (\int \frac {e^{b x} x^{2}}{e^{4 b x +4 a}+2 e^{2 b x +2 a}+1}d x \right ) b^{3}+24 e^{a} \left (\int \frac {e^{b x} x}{e^{4 b x +4 a}+2 e^{2 b x +2 a}+1}d x \right ) b^{2}}{b^{4} \left (e^{2 b x +2 a}+1\right )} \] Input:

int(x^3*sech(b*x+a)*tanh(b*x+a),x)
 

Output:

(2*(6*e**(2*a + 2*b*x)*atan(e**(a + b*x)) + 6*atan(e**(a + b*x)) + 6*e**(3 
*a + 2*b*x)*int((e**(b*x)*x**2)/(e**(4*a + 4*b*x) + 2*e**(2*a + 2*b*x) + 1 
),x)*b**3 + 12*e**(3*a + 2*b*x)*int((e**(b*x)*x)/(e**(4*a + 4*b*x) + 2*e** 
(2*a + 2*b*x) + 1),x)*b**2 - e**(a + b*x)*b**3*x**3 - 3*e**(a + b*x)*b**2* 
x**2 - 6*e**(a + b*x)*b*x + 6*e**a*int((e**(b*x)*x**2)/(e**(4*a + 4*b*x) + 
 2*e**(2*a + 2*b*x) + 1),x)*b**3 + 12*e**a*int((e**(b*x)*x)/(e**(4*a + 4*b 
*x) + 2*e**(2*a + 2*b*x) + 1),x)*b**2))/(b**4*(e**(2*a + 2*b*x) + 1))