### 3.350 $$\int x^2 \text{sech}^2(a+b x) \tanh (a+b x) \, dx$$

Optimal. Leaf size=42 $\frac{x \tanh (a+b x)}{b^2}-\frac{\log (\cosh (a+b x))}{b^3}-\frac{x^2 \text{sech}^2(a+b x)}{2 b}$

[Out]

-(Log[Cosh[a + b*x]]/b^3) - (x^2*Sech[a + b*x]^2)/(2*b) + (x*Tanh[a + b*x])/b^2

________________________________________________________________________________________

Rubi [A]  time = 0.0610636, antiderivative size = 42, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 18, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.167, Rules used = {5418, 4184, 3475} $\frac{x \tanh (a+b x)}{b^2}-\frac{\log (\cosh (a+b x))}{b^3}-\frac{x^2 \text{sech}^2(a+b x)}{2 b}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

-(Log[Cosh[a + b*x]]/b^3) - (x^2*Sech[a + b*x]^2)/(2*b) + (x*Tanh[a + b*x])/b^2

Rule 5418

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] + Dist[(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 4184

Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> -Simp[((c + d*x)^m*Cot[e + f*x])/f, x]
+ Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int x^2 \text{sech}^2(a+b x) \tanh (a+b x) \, dx &=-\frac{x^2 \text{sech}^2(a+b x)}{2 b}+\frac{\int x \text{sech}^2(a+b x) \, dx}{b}\\ &=-\frac{x^2 \text{sech}^2(a+b x)}{2 b}+\frac{x \tanh (a+b x)}{b^2}-\frac{\int \tanh (a+b x) \, dx}{b^2}\\ &=-\frac{\log (\cosh (a+b x))}{b^3}-\frac{x^2 \text{sech}^2(a+b x)}{2 b}+\frac{x \tanh (a+b x)}{b^2}\\ \end{align*}

Mathematica [A]  time = 0.117808, size = 55, normalized size = 1.31 $\frac{x \tanh (a)}{b^2}-\frac{\log (\cosh (a+b x))}{b^3}+\frac{x \text{sech}(a) \sinh (b x) \text{sech}(a+b x)}{b^2}-\frac{x^2 \text{sech}^2(a+b x)}{2 b}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

-(Log[Cosh[a + b*x]]/b^3) - (x^2*Sech[a + b*x]^2)/(2*b) + (x*Sech[a]*Sech[a + b*x]*Sinh[b*x])/b^2 + (x*Tanh[a]
)/b^2

________________________________________________________________________________________

Maple [A]  time = 0.029, size = 73, normalized size = 1.7 \begin{align*} 2\,{\frac{x}{{b}^{2}}}+2\,{\frac{a}{{b}^{3}}}-2\,{\frac{x \left ( bx{{\rm e}^{2\,bx+2\,a}}+{{\rm e}^{2\,bx+2\,a}}+1 \right ) }{{b}^{2} \left ( 1+{{\rm e}^{2\,bx+2\,a}} \right ) ^{2}}}-{\frac{\ln \left ( 1+{{\rm e}^{2\,bx+2\,a}} \right ) }{{b}^{3}}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*x/b^2+2/b^3*a-2*x*(b*x*exp(2*b*x+2*a)+exp(2*b*x+2*a)+1)/b^2/(1+exp(2*b*x+2*a))^2-1/b^3*ln(1+exp(2*b*x+2*a))

________________________________________________________________________________________

Maxima [B]  time = 1.34775, size = 127, normalized size = 3.02 \begin{align*} -\frac{2 \,{\left ({\left (b x^{2} e^{\left (2 \, a\right )} - x e^{\left (2 \, a\right )}\right )} e^{\left (2 \, b x\right )} - x e^{\left (4 \, b x + 4 \, a\right )}\right )}}{b^{2} e^{\left (4 \, b x + 4 \, a\right )} + 2 \, b^{2} e^{\left (2 \, b x + 2 \, a\right )} + b^{2}} - \frac{\log \left ({\left (e^{\left (2 \, b x + 2 \, a\right )} + 1\right )} e^{\left (-2 \, a\right )}\right )}{b^{3}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-2*((b*x^2*e^(2*a) - x*e^(2*a))*e^(2*b*x) - x*e^(4*b*x + 4*a))/(b^2*e^(4*b*x + 4*a) + 2*b^2*e^(2*b*x + 2*a) +
b^2) - log((e^(2*b*x + 2*a) + 1)*e^(-2*a))/b^3

________________________________________________________________________________________

Fricas [B]  time = 1.82506, size = 977, normalized size = 23.26 \begin{align*} \frac{2 \, b x \cosh \left (b x + a\right )^{4} + 8 \, b x \cosh \left (b x + a\right ) \sinh \left (b x + a\right )^{3} + 2 \, b x \sinh \left (b x + a\right )^{4} - 2 \,{\left (b^{2} x^{2} - b x\right )} \cosh \left (b x + a\right )^{2} - 2 \,{\left (b^{2} x^{2} - 6 \, b x \cosh \left (b x + a\right )^{2} - b x\right )} \sinh \left (b x + a\right )^{2} -{\left (\cosh \left (b x + a\right )^{4} + 4 \, \cosh \left (b x + a\right ) \sinh \left (b x + a\right )^{3} + \sinh \left (b x + a\right )^{4} + 2 \,{\left (3 \, \cosh \left (b x + a\right )^{2} + 1\right )} \sinh \left (b x + a\right )^{2} + 2 \, \cosh \left (b x + a\right )^{2} + 4 \,{\left (\cosh \left (b x + a\right )^{3} + \cosh \left (b x + a\right )\right )} \sinh \left (b x + a\right ) + 1\right )} \log \left (\frac{2 \, \cosh \left (b x + a\right )}{\cosh \left (b x + a\right ) - \sinh \left (b x + a\right )}\right ) + 4 \,{\left (2 \, b x \cosh \left (b x + a\right )^{3} -{\left (b^{2} x^{2} - b x\right )} \cosh \left (b x + a\right )\right )} \sinh \left (b x + a\right )}{b^{3} \cosh \left (b x + a\right )^{4} + 4 \, b^{3} \cosh \left (b x + a\right ) \sinh \left (b x + a\right )^{3} + b^{3} \sinh \left (b x + a\right )^{4} + 2 \, b^{3} \cosh \left (b x + a\right )^{2} + b^{3} + 2 \,{\left (3 \, b^{3} \cosh \left (b x + a\right )^{2} + b^{3}\right )} \sinh \left (b x + a\right )^{2} + 4 \,{\left (b^{3} \cosh \left (b x + a\right )^{3} + b^{3} \cosh \left (b x + a\right )\right )} \sinh \left (b x + a\right )} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(2*b*x*cosh(b*x + a)^4 + 8*b*x*cosh(b*x + a)*sinh(b*x + a)^3 + 2*b*x*sinh(b*x + a)^4 - 2*(b^2*x^2 - b*x)*cosh(
b*x + a)^2 - 2*(b^2*x^2 - 6*b*x*cosh(b*x + a)^2 - b*x)*sinh(b*x + a)^2 - (cosh(b*x + a)^4 + 4*cosh(b*x + a)*si
nh(b*x + a)^3 + sinh(b*x + a)^4 + 2*(3*cosh(b*x + a)^2 + 1)*sinh(b*x + a)^2 + 2*cosh(b*x + a)^2 + 4*(cosh(b*x
+ a)^3 + cosh(b*x + a))*sinh(b*x + a) + 1)*log(2*cosh(b*x + a)/(cosh(b*x + a) - sinh(b*x + a))) + 4*(2*b*x*cos
h(b*x + a)^3 - (b^2*x^2 - b*x)*cosh(b*x + a))*sinh(b*x + a))/(b^3*cosh(b*x + a)^4 + 4*b^3*cosh(b*x + a)*sinh(b
*x + a)^3 + b^3*sinh(b*x + a)^4 + 2*b^3*cosh(b*x + a)^2 + b^3 + 2*(3*b^3*cosh(b*x + a)^2 + b^3)*sinh(b*x + a)^
2 + 4*(b^3*cosh(b*x + a)^3 + b^3*cosh(b*x + a))*sinh(b*x + a))

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*sech(b*x+a)**3*sinh(b*x+a),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.225, size = 192, normalized size = 4.57 \begin{align*} -\frac{2 \, b^{2} x^{2} e^{\left (2 \, b x + 2 \, a\right )} - 2 \, b x e^{\left (4 \, b x + 4 \, a\right )} - 2 \, b x e^{\left (2 \, b x + 2 \, a\right )} + e^{\left (4 \, b x + 4 \, a\right )} \log \left (-e^{\left (2 \, b x + 2 \, a\right )} - 1\right ) + 2 \, e^{\left (2 \, b x + 2 \, a\right )} \log \left (-e^{\left (2 \, b x + 2 \, a\right )} - 1\right ) + \log \left (-e^{\left (2 \, b x + 2 \, a\right )} - 1\right )}{b^{3} e^{\left (4 \, b x + 4 \, a\right )} + 2 \, b^{3} e^{\left (2 \, b x + 2 \, a\right )} + b^{3}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-(2*b^2*x^2*e^(2*b*x + 2*a) - 2*b*x*e^(4*b*x + 4*a) - 2*b*x*e^(2*b*x + 2*a) + e^(4*b*x + 4*a)*log(-e^(2*b*x +
2*a) - 1) + 2*e^(2*b*x + 2*a)*log(-e^(2*b*x + 2*a) - 1) + log(-e^(2*b*x + 2*a) - 1))/(b^3*e^(4*b*x + 4*a) + 2*
b^3*e^(2*b*x + 2*a) + b^3)