\(\int x \sinh ^2(a+b x) \tanh (a+b x) \, dx\) [121]

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

Optimal result

Integrand size = 16, antiderivative size = 89 \[ \int x \sinh ^2(a+b x) \tanh (a+b x) \, dx=\frac {x}{4 b}+\frac {x^2}{2}-\frac {x \log \left (1+e^{2 (a+b x)}\right )}{b}-\frac {\operatorname {PolyLog}\left (2,-e^{2 (a+b x)}\right )}{2 b^2}-\frac {\cosh (a+b x) \sinh (a+b x)}{4 b^2}+\frac {x \sinh ^2(a+b x)}{2 b} \] Output:

1/4*x/b+1/2*x^2-x*ln(1+exp(2*b*x+2*a))/b-1/2*polylog(2,-exp(2*b*x+2*a))/b^ 
2-1/4*cosh(b*x+a)*sinh(b*x+a)/b^2+1/2*x*sinh(b*x+a)^2/b
 

Mathematica [A] (verified)

Time = 0.27 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.81 \[ \int x \sinh ^2(a+b x) \tanh (a+b x) \, dx=-\frac {-4 a^2+4 b^2 x^2-2 b x \cosh (2 (a+b x))+8 b x \log \left (1+e^{-2 (a+b x)}\right )-4 \operatorname {PolyLog}\left (2,-e^{-2 (a+b x)}\right )+\sinh (2 (a+b x))}{8 b^2} \] Input:

Integrate[x*Sinh[a + b*x]^2*Tanh[a + b*x],x]
 

Output:

-1/8*(-4*a^2 + 4*b^2*x^2 - 2*b*x*Cosh[2*(a + b*x)] + 8*b*x*Log[1 + E^(-2*( 
a + b*x))] - 4*PolyLog[2, -E^(-2*(a + b*x))] + Sinh[2*(a + b*x)])/b^2
 

Rubi [C] (verified)

Result contains complex when optimal does not.

Time = 0.90 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.21, number of steps used = 13, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.750, Rules used = {5972, 3042, 26, 4201, 2620, 2715, 2838, 5895, 3042, 25, 3115, 24}

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 \sinh ^2(a+b x) \tanh (a+b x) \, dx\)

\(\Big \downarrow \) 5972

\(\displaystyle \int x \cosh (a+b x) \sinh (a+b x)dx-\int x \tanh (a+b x)dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int x \cosh (a+b x) \sinh (a+b x)dx-\int -i x \tan (i a+i b x)dx\)

\(\Big \downarrow \) 26

\(\displaystyle \int x \cosh (a+b x) \sinh (a+b x)dx+i \int x \tan (i a+i b x)dx\)

\(\Big \downarrow \) 4201

\(\displaystyle \int x \cosh (a+b x) \sinh (a+b x)dx+i \left (2 i \int \frac {e^{2 (a+b x)} x}{1+e^{2 (a+b x)}}dx-\frac {i x^2}{2}\right )\)

\(\Big \downarrow \) 2620

\(\displaystyle \int x \cosh (a+b x) \sinh (a+b x)dx+i \left (2 i \left (\frac {x \log \left (e^{2 (a+b x)}+1\right )}{2 b}-\frac {\int \log \left (1+e^{2 (a+b x)}\right )dx}{2 b}\right )-\frac {i x^2}{2}\right )\)

\(\Big \downarrow \) 2715

\(\displaystyle \int x \cosh (a+b x) \sinh (a+b x)dx+i \left (2 i \left (\frac {x \log \left (e^{2 (a+b x)}+1\right )}{2 b}-\frac {\int e^{-2 (a+b x)} \log \left (1+e^{2 (a+b x)}\right )de^{2 (a+b x)}}{4 b^2}\right )-\frac {i x^2}{2}\right )\)

\(\Big \downarrow \) 2838

\(\displaystyle \int x \cosh (a+b x) \sinh (a+b x)dx+i \left (2 i \left (\frac {\operatorname {PolyLog}\left (2,-e^{2 (a+b x)}\right )}{4 b^2}+\frac {x \log \left (e^{2 (a+b x)}+1\right )}{2 b}\right )-\frac {i x^2}{2}\right )\)

\(\Big \downarrow \) 5895

\(\displaystyle -\frac {\int \sinh ^2(a+b x)dx}{2 b}+i \left (2 i \left (\frac {\operatorname {PolyLog}\left (2,-e^{2 (a+b x)}\right )}{4 b^2}+\frac {x \log \left (e^{2 (a+b x)}+1\right )}{2 b}\right )-\frac {i x^2}{2}\right )+\frac {x \sinh ^2(a+b x)}{2 b}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {\int -\sin (i a+i b x)^2dx}{2 b}+i \left (2 i \left (\frac {\operatorname {PolyLog}\left (2,-e^{2 (a+b x)}\right )}{4 b^2}+\frac {x \log \left (e^{2 (a+b x)}+1\right )}{2 b}\right )-\frac {i x^2}{2}\right )+\frac {x \sinh ^2(a+b x)}{2 b}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\int \sin (i a+i b x)^2dx}{2 b}+i \left (2 i \left (\frac {\operatorname {PolyLog}\left (2,-e^{2 (a+b x)}\right )}{4 b^2}+\frac {x \log \left (e^{2 (a+b x)}+1\right )}{2 b}\right )-\frac {i x^2}{2}\right )+\frac {x \sinh ^2(a+b x)}{2 b}\)

\(\Big \downarrow \) 3115

\(\displaystyle \frac {\frac {\int 1dx}{2}-\frac {\sinh (a+b x) \cosh (a+b x)}{2 b}}{2 b}+i \left (2 i \left (\frac {\operatorname {PolyLog}\left (2,-e^{2 (a+b x)}\right )}{4 b^2}+\frac {x \log \left (e^{2 (a+b x)}+1\right )}{2 b}\right )-\frac {i x^2}{2}\right )+\frac {x \sinh ^2(a+b x)}{2 b}\)

\(\Big \downarrow \) 24

\(\displaystyle i \left (2 i \left (\frac {\operatorname {PolyLog}\left (2,-e^{2 (a+b x)}\right )}{4 b^2}+\frac {x \log \left (e^{2 (a+b x)}+1\right )}{2 b}\right )-\frac {i x^2}{2}\right )+\frac {x \sinh ^2(a+b x)}{2 b}+\frac {\frac {x}{2}-\frac {\sinh (a+b x) \cosh (a+b x)}{2 b}}{2 b}\)

Input:

Int[x*Sinh[a + b*x]^2*Tanh[a + b*x],x]
 

Output:

I*((-1/2*I)*x^2 + (2*I)*((x*Log[1 + E^(2*(a + b*x))])/(2*b) + PolyLog[2, - 
E^(2*(a + b*x))]/(4*b^2))) + (x*Sinh[a + b*x]^2)/(2*b) + (x/2 - (Cosh[a + 
b*x]*Sinh[a + b*x])/(2*b))/(2*b)
 

Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 26
Int[(Complex[0, a_])*(Fx_), x_Symbol] :> Simp[(Complex[Identity[0], a])   I 
nt[Fx, x], x] /; FreeQ[a, x] && EqQ[a^2, 1]
 

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

rule 2715
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] 
:> Simp[1/(d*e*n*Log[F])   Subst[Int[Log[a + b*x]/x, x], x, (F^(e*(c + d*x) 
))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
 

rule 2838
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 
, (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
 

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

rule 3115
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* 
x]*((b*Sin[c + d*x])^(n - 1)/(d*n)), x] + Simp[b^2*((n - 1)/n)   Int[(b*Sin 
[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && IntegerQ[ 
2*n]
 

rule 4201
Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + (Complex[0, fz_])*(f_.)*(x_)], x 
_Symbol] :> Simp[(-I)*((c + d*x)^(m + 1)/(d*(m + 1))), x] + Simp[2*I   Int[ 
(c + d*x)^m*(E^(2*((-I)*e + f*fz*x))/(1 + E^(2*((-I)*e + f*fz*x)))), x], x] 
 /; FreeQ[{c, d, e, f, fz}, x] && IGtQ[m, 0]
 

rule 5895
Int[Cosh[(a_.) + (b_.)*(x_)^(n_.)]*(x_)^(m_.)*Sinh[(a_.) + (b_.)*(x_)^(n_.) 
]^(p_.), x_Symbol] :> Simp[x^(m - n + 1)*(Sinh[a + b*x^n]^(p + 1)/(b*n*(p + 
 1))), x] - Simp[(m - n + 1)/(b*n*(p + 1))   Int[x^(m - n)*Sinh[a + b*x^n]^ 
(p + 1), x], x] /; FreeQ[{a, b, p}, x] && LtQ[0, n, m + 1] && NeQ[p, -1]
 

rule 5972
Int[((c_.) + (d_.)*(x_))^(m_.)*Sinh[(a_.) + (b_.)*(x_)]^(n_.)*Tanh[(a_.) + 
(b_.)*(x_)]^(p_.), x_Symbol] :> Int[(c + d*x)^m*Sinh[a + b*x]^n*Tanh[a + b* 
x]^(p - 2), x] - Int[(c + d*x)^m*Sinh[a + b*x]^(n - 2)*Tanh[a + b*x]^p, x] 
/; FreeQ[{a, b, c, d, m}, x] && IGtQ[n, 0] && IGtQ[p, 0]
 
Maple [A] (verified)

Time = 1.29 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.24

method result size
risch \(\frac {x^{2}}{2}+\frac {\left (2 b x -1\right ) {\mathrm e}^{2 b x +2 a}}{16 b^{2}}+\frac {\left (2 b x +1\right ) {\mathrm e}^{-2 b x -2 a}}{16 b^{2}}+\frac {2 a x}{b}+\frac {a^{2}}{b^{2}}-\frac {x \ln \left ({\mathrm e}^{2 b x +2 a}+1\right )}{b}-\frac {\operatorname {polylog}\left (2, -{\mathrm e}^{2 b x +2 a}\right )}{2 b^{2}}-\frac {2 a \ln \left ({\mathrm e}^{b x +a}\right )}{b^{2}}\) \(110\)

Input:

int(x*sinh(b*x+a)^2*tanh(b*x+a),x,method=_RETURNVERBOSE)
 

Output:

1/2*x^2+1/16*(2*b*x-1)/b^2*exp(2*b*x+2*a)+1/16*(2*b*x+1)/b^2*exp(-2*b*x-2* 
a)+2/b*a*x+1/b^2*a^2-x*ln(exp(2*b*x+2*a)+1)/b-1/2*polylog(2,-exp(2*b*x+2*a 
))/b^2-2/b^2*a*ln(exp(b*x+a))
 

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.09 (sec) , antiderivative size = 558, normalized size of antiderivative = 6.27 \[ \int x \sinh ^2(a+b x) \tanh (a+b x) \, dx =\text {Too large to display} \] Input:

integrate(x*sinh(b*x+a)^2*tanh(b*x+a),x, algorithm="fricas")
 

Output:

1/16*((2*b*x - 1)*cosh(b*x + a)^4 + 4*(2*b*x - 1)*cosh(b*x + a)*sinh(b*x + 
 a)^3 + (2*b*x - 1)*sinh(b*x + a)^4 + 8*(b^2*x^2 - 2*a^2)*cosh(b*x + a)^2 
+ 2*(4*b^2*x^2 + 3*(2*b*x - 1)*cosh(b*x + a)^2 - 8*a^2)*sinh(b*x + a)^2 + 
2*b*x - 16*(cosh(b*x + a)^2 + 2*cosh(b*x + a)*sinh(b*x + a) + sinh(b*x + a 
)^2)*dilog(I*cosh(b*x + a) + I*sinh(b*x + a)) - 16*(cosh(b*x + a)^2 + 2*co 
sh(b*x + a)*sinh(b*x + a) + sinh(b*x + a)^2)*dilog(-I*cosh(b*x + a) - I*si 
nh(b*x + a)) + 16*(a*cosh(b*x + a)^2 + 2*a*cosh(b*x + a)*sinh(b*x + a) + a 
*sinh(b*x + a)^2)*log(cosh(b*x + a) + sinh(b*x + a) + I) + 16*(a*cosh(b*x 
+ a)^2 + 2*a*cosh(b*x + a)*sinh(b*x + a) + a*sinh(b*x + a)^2)*log(cosh(b*x 
 + a) + sinh(b*x + a) - I) - 16*((b*x + a)*cosh(b*x + a)^2 + 2*(b*x + a)*c 
osh(b*x + a)*sinh(b*x + a) + (b*x + a)*sinh(b*x + a)^2)*log(I*cosh(b*x + a 
) + I*sinh(b*x + a) + 1) - 16*((b*x + a)*cosh(b*x + a)^2 + 2*(b*x + a)*cos 
h(b*x + a)*sinh(b*x + a) + (b*x + a)*sinh(b*x + a)^2)*log(-I*cosh(b*x + a) 
 - I*sinh(b*x + a) + 1) + 4*((2*b*x - 1)*cosh(b*x + a)^3 + 4*(b^2*x^2 - 2* 
a^2)*cosh(b*x + a))*sinh(b*x + a) + 1)/(b^2*cosh(b*x + a)^2 + 2*b^2*cosh(b 
*x + a)*sinh(b*x + a) + b^2*sinh(b*x + a)^2)
 

Sympy [F]

\[ \int x \sinh ^2(a+b x) \tanh (a+b x) \, dx=\int x \sinh ^{2}{\left (a + b x \right )} \tanh {\left (a + b x \right )}\, dx \] Input:

integrate(x*sinh(b*x+a)**2*tanh(b*x+a),x)
                                                                                    
                                                                                    
 

Output:

Integral(x*sinh(a + b*x)**2*tanh(a + b*x), x)
 

Maxima [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.07 \[ \int x \sinh ^2(a+b x) \tanh (a+b x) \, dx=x^{2} - \frac {{\left (8 \, b^{2} x^{2} e^{\left (2 \, a\right )} - {\left (2 \, b x e^{\left (4 \, a\right )} - e^{\left (4 \, a\right )}\right )} e^{\left (2 \, b x\right )} - {\left (2 \, b x + 1\right )} e^{\left (-2 \, b x\right )}\right )} e^{\left (-2 \, a\right )}}{16 \, b^{2}} - \frac {2 \, b x \log \left (e^{\left (2 \, b x + 2 \, a\right )} + 1\right ) + {\rm Li}_2\left (-e^{\left (2 \, b x + 2 \, a\right )}\right )}{2 \, b^{2}} \] Input:

integrate(x*sinh(b*x+a)^2*tanh(b*x+a),x, algorithm="maxima")
 

Output:

x^2 - 1/16*(8*b^2*x^2*e^(2*a) - (2*b*x*e^(4*a) - e^(4*a))*e^(2*b*x) - (2*b 
*x + 1)*e^(-2*b*x))*e^(-2*a)/b^2 - 1/2*(2*b*x*log(e^(2*b*x + 2*a) + 1) + d 
ilog(-e^(2*b*x + 2*a)))/b^2
 

Giac [F]

\[ \int x \sinh ^2(a+b x) \tanh (a+b x) \, dx=\int { x \sinh \left (b x + a\right )^{2} \tanh \left (b x + a\right ) \,d x } \] Input:

integrate(x*sinh(b*x+a)^2*tanh(b*x+a),x, algorithm="giac")
 

Output:

integrate(x*sinh(b*x + a)^2*tanh(b*x + a), x)
 

Mupad [F(-1)]

Timed out. \[ \int x \sinh ^2(a+b x) \tanh (a+b x) \, dx=\int x\,{\mathrm {sinh}\left (a+b\,x\right )}^2\,\mathrm {tanh}\left (a+b\,x\right ) \,d x \] Input:

int(x*sinh(a + b*x)^2*tanh(a + b*x),x)
 

Output:

int(x*sinh(a + b*x)^2*tanh(a + b*x), x)
 

Reduce [F]

\[ \int x \sinh ^2(a+b x) \tanh (a+b x) \, dx=\frac {2 e^{4 b x +4 a} b x -e^{4 b x +4 a}-32 e^{2 b x +2 a} \left (\int \frac {x}{e^{4 b x +4 a}+e^{2 b x +2 a}}d x \right ) b^{2}-8 e^{2 b x +2 a} b^{2} x^{2}-14 b x -7}{16 e^{2 b x +2 a} b^{2}} \] Input:

int(x*sinh(b*x+a)^2*tanh(b*x+a),x)
 

Output:

(2*e**(4*a + 4*b*x)*b*x - e**(4*a + 4*b*x) - 32*e**(2*a + 2*b*x)*int(x/(e* 
*(4*a + 4*b*x) + e**(2*a + 2*b*x)),x)*b**2 - 8*e**(2*a + 2*b*x)*b**2*x**2 
- 14*b*x - 7)/(16*e**(2*a + 2*b*x)*b**2)