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

Optimal. Leaf size=143 $-\frac{i x \text{PolyLog}\left (2,-i e^{a+b x}\right )}{b^2}+\frac{i x \text{PolyLog}\left (2,i e^{a+b x}\right )}{b^2}+\frac{i \text{PolyLog}\left (3,-i e^{a+b x}\right )}{b^3}-\frac{i \text{PolyLog}\left (3,i e^{a+b x}\right )}{b^3}-\frac{x \text{sech}(a+b x)}{b^2}+\frac{\tan ^{-1}(\sinh (a+b x))}{b^3}+\frac{x^2 \tan ^{-1}\left (e^{a+b x}\right )}{b}-\frac{x^2 \tanh (a+b x) \text{sech}(a+b x)}{2 b}$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.198598, antiderivative size = 143, normalized size of antiderivative = 1., number of steps used = 17, number of rules used = 7, integrand size = 18, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.389, Rules used = {5455, 4180, 2531, 2282, 6589, 4186, 3770} $-\frac{i x \text{PolyLog}\left (2,-i e^{a+b x}\right )}{b^2}+\frac{i x \text{PolyLog}\left (2,i e^{a+b x}\right )}{b^2}+\frac{i \text{PolyLog}\left (3,-i e^{a+b x}\right )}{b^3}-\frac{i \text{PolyLog}\left (3,i e^{a+b x}\right )}{b^3}-\frac{x \text{sech}(a+b x)}{b^2}+\frac{\tan ^{-1}(\sinh (a+b x))}{b^3}+\frac{x^2 \tan ^{-1}\left (e^{a+b x}\right )}{b}-\frac{x^2 \tanh (a+b x) \text{sech}(a+b x)}{2 b}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 5455

Int[((c_.) + (d_.)*(x_))^(m_.)*Sech[(a_.) + (b_.)*(x_)]*Tanh[(a_.) + (b_.)*(x_)]^(p_), x_Symbol] :> Int[(c + d
*x)^m*Sech[a + b*x]*Tanh[a + b*x]^(p - 2), x] - Int[(c + d*x)^m*Sech[a + b*x]^3*Tanh[a + b*x]^(p - 2), x] /; F
reeQ[{a, b, c, d, m}, x] && IGtQ[p/2, 0]

Rule 4180

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

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

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{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 6589

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> 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]

Rule 4186

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

Rule 3770

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

Rubi steps

\begin{align*} \int x^2 \text{sech}(a+b x) \tanh ^2(a+b x) \, dx &=\int x^2 \text{sech}(a+b x) \, dx-\int x^2 \text{sech}^3(a+b x) \, dx\\ &=\frac{2 x^2 \tan ^{-1}\left (e^{a+b x}\right )}{b}-\frac{x \text{sech}(a+b x)}{b^2}-\frac{x^2 \text{sech}(a+b x) \tanh (a+b x)}{2 b}-\frac{1}{2} \int x^2 \text{sech}(a+b x) \, dx+\frac{\int \text{sech}(a+b x) \, dx}{b^2}-\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{x^2 \tan ^{-1}\left (e^{a+b x}\right )}{b}+\frac{\tan ^{-1}(\sinh (a+b x))}{b^3}-\frac{2 i x \text{Li}_2\left (-i e^{a+b x}\right )}{b^2}+\frac{2 i x \text{Li}_2\left (i e^{a+b x}\right )}{b^2}-\frac{x \text{sech}(a+b x)}{b^2}-\frac{x^2 \text{sech}(a+b x) \tanh (a+b x)}{2 b}+\frac{(2 i) \int \text{Li}_2\left (-i e^{a+b x}\right ) \, dx}{b^2}-\frac{(2 i) \int \text{Li}_2\left (i e^{a+b x}\right ) \, dx}{b^2}+\frac{i \int x \log \left (1-i e^{a+b x}\right ) \, dx}{b}-\frac{i \int x \log \left (1+i e^{a+b x}\right ) \, dx}{b}\\ &=\frac{x^2 \tan ^{-1}\left (e^{a+b x}\right )}{b}+\frac{\tan ^{-1}(\sinh (a+b x))}{b^3}-\frac{i x \text{Li}_2\left (-i e^{a+b x}\right )}{b^2}+\frac{i x \text{Li}_2\left (i e^{a+b x}\right )}{b^2}-\frac{x \text{sech}(a+b x)}{b^2}-\frac{x^2 \text{sech}(a+b x) \tanh (a+b x)}{2 b}+\frac{(2 i) \operatorname{Subst}\left (\int \frac{\text{Li}_2(-i x)}{x} \, dx,x,e^{a+b x}\right )}{b^3}-\frac{(2 i) \operatorname{Subst}\left (\int \frac{\text{Li}_2(i x)}{x} \, dx,x,e^{a+b x}\right )}{b^3}-\frac{i \int \text{Li}_2\left (-i e^{a+b x}\right ) \, dx}{b^2}+\frac{i \int \text{Li}_2\left (i e^{a+b x}\right ) \, dx}{b^2}\\ &=\frac{x^2 \tan ^{-1}\left (e^{a+b x}\right )}{b}+\frac{\tan ^{-1}(\sinh (a+b x))}{b^3}-\frac{i x \text{Li}_2\left (-i e^{a+b x}\right )}{b^2}+\frac{i x \text{Li}_2\left (i e^{a+b x}\right )}{b^2}+\frac{2 i \text{Li}_3\left (-i e^{a+b x}\right )}{b^3}-\frac{2 i \text{Li}_3\left (i e^{a+b x}\right )}{b^3}-\frac{x \text{sech}(a+b x)}{b^2}-\frac{x^2 \text{sech}(a+b x) \tanh (a+b x)}{2 b}-\frac{i \operatorname{Subst}\left (\int \frac{\text{Li}_2(-i x)}{x} \, dx,x,e^{a+b x}\right )}{b^3}+\frac{i \operatorname{Subst}\left (\int \frac{\text{Li}_2(i x)}{x} \, dx,x,e^{a+b x}\right )}{b^3}\\ &=\frac{x^2 \tan ^{-1}\left (e^{a+b x}\right )}{b}+\frac{\tan ^{-1}(\sinh (a+b x))}{b^3}-\frac{i x \text{Li}_2\left (-i e^{a+b x}\right )}{b^2}+\frac{i x \text{Li}_2\left (i e^{a+b x}\right )}{b^2}+\frac{i \text{Li}_3\left (-i e^{a+b x}\right )}{b^3}-\frac{i \text{Li}_3\left (i e^{a+b x}\right )}{b^3}-\frac{x \text{sech}(a+b x)}{b^2}-\frac{x^2 \text{sech}(a+b x) \tanh (a+b x)}{2 b}\\ \end{align*}

Mathematica [A]  time = 1.6052, size = 180, normalized size = 1.26 $\frac{i \left (-2 b x \text{PolyLog}\left (2,-i e^{a+b x}\right )+2 b x \text{PolyLog}\left (2,i e^{a+b x}\right )+2 \text{PolyLog}\left (3,-i e^{a+b x}\right )-2 \text{PolyLog}\left (3,i e^{a+b x}\right )+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 )-4 i \tan ^{-1}\left (e^{a+b x}\right )\right )}{2 b^3}-\frac{x \text{sech}(a) \text{sech}(a+b x) (b x \sinh (a)+2 \cosh (a))}{2 b^2}-\frac{x^2 \text{sech}(a) \sinh (b x) \text{sech}^2(a+b x)}{2 b}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

((I/2)*((-4*I)*ArcTan[E^(a + b*x)] + 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*P
olyLog[2, (-I)*E^(a + b*x)] + 2*b*x*PolyLog[2, I*E^(a + b*x)] + 2*PolyLog[3, (-I)*E^(a + b*x)] - 2*PolyLog[3,
I*E^(a + b*x)]))/b^3 - (x*Sech[a]*Sech[a + b*x]*(2*Cosh[a] + b*x*Sinh[a]))/(2*b^2) - (x^2*Sech[a]*Sech[a + b*x
]^2*Sinh[b*x])/(2*b)

________________________________________________________________________________________

Maple [F]  time = 0.182, size = 0, normalized size = 0. \begin{align*} \int{x}^{2} \left ({\rm sech} \left (bx+a\right ) \right ) ^{3} \left ( \sinh \left ( bx+a \right ) \right ) ^{2}\, dx \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)^2,x)

[Out]

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

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} 2 \, b^{2} \int \frac{x^{2} e^{\left (b x + a\right )}}{2 \,{\left (b^{2} e^{\left (2 \, b x + 2 \, a\right )} + b^{2}\right )}}\,{d x} - \frac{{\left (b x^{2} e^{\left (3 \, a\right )} + 2 \, x e^{\left (3 \, a\right )}\right )} e^{\left (3 \, b x\right )} -{\left (b x^{2} e^{a} - 2 \, x e^{a}\right )} e^{\left (b x\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{2 \, \arctan \left (e^{\left (b x + 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)^2,x, algorithm="maxima")

[Out]

2*b^2*integrate(1/2*x^2*e^(b*x + a)/(b^2*e^(2*b*x + 2*a) + b^2), x) - ((b*x^2*e^(3*a) + 2*x*e^(3*a))*e^(3*b*x)
- (b*x^2*e^a - 2*x*e^a)*e^(b*x))/(b^2*e^(4*b*x + 4*a) + 2*b^2*e^(2*b*x + 2*a) + b^2) + 2*arctan(e^(b*x + a))/
b^3

________________________________________________________________________________________

Fricas [C]  time = 2.52738, size = 4242, normalized size = 29.66 \begin{align*} \text{result too large to display} \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)^2,x, algorithm="fricas")

[Out]

-1/2*(2*(b^2*x^2 + 2*b*x)*cosh(b*x + a)^3 + 6*(b^2*x^2 + 2*b*x)*cosh(b*x + a)*sinh(b*x + a)^2 + 2*(b^2*x^2 + 2
*b*x)*sinh(b*x + a)^3 - 2*(b^2*x^2 - 2*b*x)*cosh(b*x + a) - (2*I*b*x*cosh(b*x + a)^4 + 8*I*b*x*cosh(b*x + a)*s
inh(b*x + a)^3 + 2*I*b*x*sinh(b*x + a)^4 + 4*I*b*x*cosh(b*x + a)^2 + (12*I*b*x*cosh(b*x + a)^2 + 4*I*b*x)*sinh
(b*x + a)^2 + 2*I*b*x + (8*I*b*x*cosh(b*x + a)^3 + 8*I*b*x*cosh(b*x + a))*sinh(b*x + a))*dilog(I*cosh(b*x + a)
+ I*sinh(b*x + a)) - (-2*I*b*x*cosh(b*x + a)^4 - 8*I*b*x*cosh(b*x + a)*sinh(b*x + a)^3 - 2*I*b*x*sinh(b*x + a
)^4 - 4*I*b*x*cosh(b*x + a)^2 + (-12*I*b*x*cosh(b*x + a)^2 - 4*I*b*x)*sinh(b*x + a)^2 - 2*I*b*x + (-8*I*b*x*co
sh(b*x + a)^3 - 8*I*b*x*cosh(b*x + a))*sinh(b*x + a))*dilog(-I*cosh(b*x + a) - I*sinh(b*x + a)) - ((I*a^2 + 2*
I)*cosh(b*x + a)^4 + (4*I*a^2 + 8*I)*cosh(b*x + a)*sinh(b*x + a)^3 + (I*a^2 + 2*I)*sinh(b*x + a)^4 + (2*I*a^2
+ 4*I)*cosh(b*x + a)^2 + ((6*I*a^2 + 12*I)*cosh(b*x + a)^2 + 2*I*a^2 + 4*I)*sinh(b*x + a)^2 + I*a^2 + ((4*I*a^
2 + 8*I)*cosh(b*x + a)^3 + (4*I*a^2 + 8*I)*cosh(b*x + a))*sinh(b*x + a) + 2*I)*log(cosh(b*x + a) + sinh(b*x +
a) + I) - ((-I*a^2 - 2*I)*cosh(b*x + a)^4 + (-4*I*a^2 - 8*I)*cosh(b*x + a)*sinh(b*x + a)^3 + (-I*a^2 - 2*I)*si
nh(b*x + a)^4 + (-2*I*a^2 - 4*I)*cosh(b*x + a)^2 + ((-6*I*a^2 - 12*I)*cosh(b*x + a)^2 - 2*I*a^2 - 4*I)*sinh(b*
x + a)^2 - I*a^2 + ((-4*I*a^2 - 8*I)*cosh(b*x + a)^3 + (-4*I*a^2 - 8*I)*cosh(b*x + a))*sinh(b*x + a) - 2*I)*lo
g(cosh(b*x + a) + sinh(b*x + a) - I) - ((-I*b^2*x^2 + I*a^2)*cosh(b*x + a)^4 + (-4*I*b^2*x^2 + 4*I*a^2)*cosh(b
*x + a)*sinh(b*x + a)^3 + (-I*b^2*x^2 + I*a^2)*sinh(b*x + a)^4 - I*b^2*x^2 + (-2*I*b^2*x^2 + 2*I*a^2)*cosh(b*x
+ a)^2 + (-2*I*b^2*x^2 + (-6*I*b^2*x^2 + 6*I*a^2)*cosh(b*x + a)^2 + 2*I*a^2)*sinh(b*x + a)^2 + I*a^2 + ((-4*I
*b^2*x^2 + 4*I*a^2)*cosh(b*x + a)^3 + (-4*I*b^2*x^2 + 4*I*a^2)*cosh(b*x + a))*sinh(b*x + a))*log(I*cosh(b*x +
a) + I*sinh(b*x + a) + 1) - ((I*b^2*x^2 - I*a^2)*cosh(b*x + a)^4 + (4*I*b^2*x^2 - 4*I*a^2)*cosh(b*x + a)*sinh(
b*x + a)^3 + (I*b^2*x^2 - I*a^2)*sinh(b*x + a)^4 + I*b^2*x^2 + (2*I*b^2*x^2 - 2*I*a^2)*cosh(b*x + a)^2 + (2*I*
b^2*x^2 + (6*I*b^2*x^2 - 6*I*a^2)*cosh(b*x + a)^2 - 2*I*a^2)*sinh(b*x + a)^2 - I*a^2 + ((4*I*b^2*x^2 - 4*I*a^2
)*cosh(b*x + a)^3 + (4*I*b^2*x^2 - 4*I*a^2)*cosh(b*x + a))*sinh(b*x + a))*log(-I*cosh(b*x + a) - I*sinh(b*x +
a) + 1) - (-2*I*cosh(b*x + a)^4 - 8*I*cosh(b*x + a)*sinh(b*x + a)^3 - 2*I*sinh(b*x + a)^4 + (-12*I*cosh(b*x +
a)^2 - 4*I)*sinh(b*x + a)^2 - 4*I*cosh(b*x + a)^2 + (-8*I*cosh(b*x + a)^3 - 8*I*cosh(b*x + a))*sinh(b*x + a) -
2*I)*polylog(3, I*cosh(b*x + a) + I*sinh(b*x + a)) - (2*I*cosh(b*x + a)^4 + 8*I*cosh(b*x + a)*sinh(b*x + a)^3
+ 2*I*sinh(b*x + a)^4 + (12*I*cosh(b*x + a)^2 + 4*I)*sinh(b*x + a)^2 + 4*I*cosh(b*x + a)^2 + (8*I*cosh(b*x +
a)^3 + 8*I*cosh(b*x + a))*sinh(b*x + a) + 2*I)*polylog(3, -I*cosh(b*x + a) - I*sinh(b*x + a)) - 2*(b^2*x^2 - 3
*(b^2*x^2 + 2*b*x)*cosh(b*x + a)^2 - 2*b*x)*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)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int x^{2} \operatorname{sech}\left (b x + a\right )^{3} \sinh \left (b x + a\right )^{2}\,{d x} \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)^2,x, algorithm="giac")

[Out]

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