### 3.87 $$\int \text{sech}^3(c+d x) (a+b \tanh ^2(c+d x)) \, dx$$

Optimal. Leaf size=66 $\frac{(4 a+b) \tan ^{-1}(\sinh (c+d x))}{8 d}+\frac{(4 a+b) \tanh (c+d x) \text{sech}(c+d x)}{8 d}-\frac{b \tanh (c+d x) \text{sech}^3(c+d x)}{4 d}$

[Out]

((4*a + b)*ArcTan[Sinh[c + d*x]])/(8*d) + ((4*a + b)*Sech[c + d*x]*Tanh[c + d*x])/(8*d) - (b*Sech[c + d*x]^3*T
anh[c + d*x])/(4*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0455378, antiderivative size = 66, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 21, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.19, Rules used = {3676, 385, 199, 203} $\frac{(4 a+b) \tan ^{-1}(\sinh (c+d x))}{8 d}+\frac{(4 a+b) \tanh (c+d x) \text{sech}(c+d x)}{8 d}-\frac{b \tanh (c+d x) \text{sech}^3(c+d x)}{4 d}$

Antiderivative was successfully veriﬁed.

[In]

Int[Sech[c + d*x]^3*(a + b*Tanh[c + d*x]^2),x]

[Out]

((4*a + b)*ArcTan[Sinh[c + d*x]])/(8*d) + ((4*a + b)*Sech[c + d*x]*Tanh[c + d*x])/(8*d) - (b*Sech[c + d*x]^3*T
anh[c + d*x])/(4*d)

Rule 3676

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_))^(p_.), x_Symbol] :> With[{ff = F
reeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[ExpandToSum[b*(ff*x)^n + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 -
ff^2*x^2)^((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n/2] && IntegerQ[p]

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> -Simp[((b*c - a*d)*x*(a + b*x^n)^(p +
1))/(a*b*n*(p + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /
; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 199

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> -Simp[(x*(a + b*x^n)^(p + 1))/(a*n*(p + 1)), x] + Dist[(n*(p +
1) + 1)/(a*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && LtQ[p, -1] && (In
tegerQ[2*p] || (n == 2 && IntegerQ[4*p]) || (n == 2 && IntegerQ[3*p]) || Denominator[p + 1/n] < Denominator[p]
)

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \text{sech}^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx &=\frac{\operatorname{Subst}\left (\int \frac{a+(a+b) x^2}{\left (1+x^2\right )^3} \, dx,x,\sinh (c+d x)\right )}{d}\\ &=-\frac{b \text{sech}^3(c+d x) \tanh (c+d x)}{4 d}+\frac{(4 a+b) \operatorname{Subst}\left (\int \frac{1}{\left (1+x^2\right )^2} \, dx,x,\sinh (c+d x)\right )}{4 d}\\ &=\frac{(4 a+b) \text{sech}(c+d x) \tanh (c+d x)}{8 d}-\frac{b \text{sech}^3(c+d x) \tanh (c+d x)}{4 d}+\frac{(4 a+b) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\sinh (c+d x)\right )}{8 d}\\ &=\frac{(4 a+b) \tan ^{-1}(\sinh (c+d x))}{8 d}+\frac{(4 a+b) \text{sech}(c+d x) \tanh (c+d x)}{8 d}-\frac{b \text{sech}^3(c+d x) \tanh (c+d x)}{4 d}\\ \end{align*}

Mathematica [A]  time = 0.0293792, size = 93, normalized size = 1.41 $\frac{a \tan ^{-1}(\sinh (c+d x))}{2 d}+\frac{a \tanh (c+d x) \text{sech}(c+d x)}{2 d}+\frac{b \tan ^{-1}(\sinh (c+d x))}{8 d}-\frac{b \tanh (c+d x) \text{sech}^3(c+d x)}{4 d}+\frac{b \tanh (c+d x) \text{sech}(c+d x)}{8 d}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[Sech[c + d*x]^3*(a + b*Tanh[c + d*x]^2),x]

[Out]

(a*ArcTan[Sinh[c + d*x]])/(2*d) + (b*ArcTan[Sinh[c + d*x]])/(8*d) + (a*Sech[c + d*x]*Tanh[c + d*x])/(2*d) + (b
*Sech[c + d*x]*Tanh[c + d*x])/(8*d) - (b*Sech[c + d*x]^3*Tanh[c + d*x])/(4*d)

________________________________________________________________________________________

Maple [A]  time = 0.044, size = 103, normalized size = 1.6 \begin{align*}{\frac{a{\rm sech} \left (dx+c\right )\tanh \left ( dx+c \right ) }{2\,d}}+{\frac{a\arctan \left ({{\rm e}^{dx+c}} \right ) }{d}}-{\frac{b\sinh \left ( dx+c \right ) }{3\,d \left ( \cosh \left ( dx+c \right ) \right ) ^{4}}}+{\frac{b \left ({\rm sech} \left (dx+c\right ) \right ) ^{3}\tanh \left ( dx+c \right ) }{12\,d}}+{\frac{b{\rm sech} \left (dx+c\right )\tanh \left ( dx+c \right ) }{8\,d}}+{\frac{b\arctan \left ({{\rm e}^{dx+c}} \right ) }{4\,d}} \end{align*}

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

[In]

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

[Out]

1/2/d*a*sech(d*x+c)*tanh(d*x+c)+1/d*a*arctan(exp(d*x+c))-1/3/d*b*sinh(d*x+c)/cosh(d*x+c)^4+1/12*b*sech(d*x+c)^
3*tanh(d*x+c)/d+1/8*b*sech(d*x+c)*tanh(d*x+c)/d+1/4/d*b*arctan(exp(d*x+c))

________________________________________________________________________________________

Maxima [B]  time = 1.61634, size = 244, normalized size = 3.7 \begin{align*} -\frac{1}{4} \, b{\left (\frac{\arctan \left (e^{\left (-d x - c\right )}\right )}{d} - \frac{e^{\left (-d x - c\right )} - 7 \, e^{\left (-3 \, d x - 3 \, c\right )} + 7 \, e^{\left (-5 \, d x - 5 \, c\right )} - e^{\left (-7 \, d x - 7 \, c\right )}}{d{\left (4 \, e^{\left (-2 \, d x - 2 \, c\right )} + 6 \, e^{\left (-4 \, d x - 4 \, c\right )} + 4 \, e^{\left (-6 \, d x - 6 \, c\right )} + e^{\left (-8 \, d x - 8 \, c\right )} + 1\right )}}\right )} - a{\left (\frac{\arctan \left (e^{\left (-d x - c\right )}\right )}{d} - \frac{e^{\left (-d x - c\right )} - e^{\left (-3 \, d x - 3 \, c\right )}}{d{\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + 1\right )}}\right )} \end{align*}

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

[In]

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

[Out]

-1/4*b*(arctan(e^(-d*x - c))/d - (e^(-d*x - c) - 7*e^(-3*d*x - 3*c) + 7*e^(-5*d*x - 5*c) - e^(-7*d*x - 7*c))/(
d*(4*e^(-2*d*x - 2*c) + 6*e^(-4*d*x - 4*c) + 4*e^(-6*d*x - 6*c) + e^(-8*d*x - 8*c) + 1))) - a*(arctan(e^(-d*x
- c))/d - (e^(-d*x - c) - e^(-3*d*x - 3*c))/(d*(2*e^(-2*d*x - 2*c) + e^(-4*d*x - 4*c) + 1)))

________________________________________________________________________________________

Fricas [B]  time = 2.01207, size = 2826, normalized size = 42.82 \begin{align*} \text{result too large to display} \end{align*}

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

[In]

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

[Out]

1/4*((4*a + b)*cosh(d*x + c)^7 + 7*(4*a + b)*cosh(d*x + c)*sinh(d*x + c)^6 + (4*a + b)*sinh(d*x + c)^7 + (4*a
- 7*b)*cosh(d*x + c)^5 + (21*(4*a + b)*cosh(d*x + c)^2 + 4*a - 7*b)*sinh(d*x + c)^5 + 5*(7*(4*a + b)*cosh(d*x
+ c)^3 + (4*a - 7*b)*cosh(d*x + c))*sinh(d*x + c)^4 - (4*a - 7*b)*cosh(d*x + c)^3 + (35*(4*a + b)*cosh(d*x + c
)^4 + 10*(4*a - 7*b)*cosh(d*x + c)^2 - 4*a + 7*b)*sinh(d*x + c)^3 + (21*(4*a + b)*cosh(d*x + c)^5 + 10*(4*a -
7*b)*cosh(d*x + c)^3 - 3*(4*a - 7*b)*cosh(d*x + c))*sinh(d*x + c)^2 + ((4*a + b)*cosh(d*x + c)^8 + 8*(4*a + b)
*cosh(d*x + c)*sinh(d*x + c)^7 + (4*a + b)*sinh(d*x + c)^8 + 4*(4*a + b)*cosh(d*x + c)^6 + 4*(7*(4*a + b)*cosh
(d*x + c)^2 + 4*a + b)*sinh(d*x + c)^6 + 8*(7*(4*a + b)*cosh(d*x + c)^3 + 3*(4*a + b)*cosh(d*x + c))*sinh(d*x
+ c)^5 + 6*(4*a + b)*cosh(d*x + c)^4 + 2*(35*(4*a + b)*cosh(d*x + c)^4 + 30*(4*a + b)*cosh(d*x + c)^2 + 12*a +
3*b)*sinh(d*x + c)^4 + 8*(7*(4*a + b)*cosh(d*x + c)^5 + 10*(4*a + b)*cosh(d*x + c)^3 + 3*(4*a + b)*cosh(d*x +
c))*sinh(d*x + c)^3 + 4*(4*a + b)*cosh(d*x + c)^2 + 4*(7*(4*a + b)*cosh(d*x + c)^6 + 15*(4*a + b)*cosh(d*x +
c)^4 + 9*(4*a + b)*cosh(d*x + c)^2 + 4*a + b)*sinh(d*x + c)^2 + 8*((4*a + b)*cosh(d*x + c)^7 + 3*(4*a + b)*cos
h(d*x + c)^5 + 3*(4*a + b)*cosh(d*x + c)^3 + (4*a + b)*cosh(d*x + c))*sinh(d*x + c) + 4*a + b)*arctan(cosh(d*x
+ c) + sinh(d*x + c)) - (4*a + b)*cosh(d*x + c) + (7*(4*a + b)*cosh(d*x + c)^6 + 5*(4*a - 7*b)*cosh(d*x + c)^
4 - 3*(4*a - 7*b)*cosh(d*x + c)^2 - 4*a - b)*sinh(d*x + c))/(d*cosh(d*x + c)^8 + 8*d*cosh(d*x + c)*sinh(d*x +
c)^7 + d*sinh(d*x + c)^8 + 4*d*cosh(d*x + c)^6 + 4*(7*d*cosh(d*x + c)^2 + d)*sinh(d*x + c)^6 + 8*(7*d*cosh(d*x
+ c)^3 + 3*d*cosh(d*x + c))*sinh(d*x + c)^5 + 6*d*cosh(d*x + c)^4 + 2*(35*d*cosh(d*x + c)^4 + 30*d*cosh(d*x +
c)^2 + 3*d)*sinh(d*x + c)^4 + 8*(7*d*cosh(d*x + c)^5 + 10*d*cosh(d*x + c)^3 + 3*d*cosh(d*x + c))*sinh(d*x + c
)^3 + 4*d*cosh(d*x + c)^2 + 4*(7*d*cosh(d*x + c)^6 + 15*d*cosh(d*x + c)^4 + 9*d*cosh(d*x + c)^2 + d)*sinh(d*x
+ c)^2 + 8*(d*cosh(d*x + c)^7 + 3*d*cosh(d*x + c)^5 + 3*d*cosh(d*x + c)^3 + d*cosh(d*x + c))*sinh(d*x + c) + d
)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tanh ^{2}{\left (c + d x \right )}\right ) \operatorname{sech}^{3}{\left (c + d x \right )}\, dx \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [B]  time = 1.22584, size = 178, normalized size = 2.7 \begin{align*} \frac{{\left (4 \, a e^{c} + b e^{c}\right )} \arctan \left (e^{\left (d x + c\right )}\right ) e^{\left (-c\right )} + \frac{4 \, a e^{\left (7 \, d x + 7 \, c\right )} + b e^{\left (7 \, d x + 7 \, c\right )} + 4 \, a e^{\left (5 \, d x + 5 \, c\right )} - 7 \, b e^{\left (5 \, d x + 5 \, c\right )} - 4 \, a e^{\left (3 \, d x + 3 \, c\right )} + 7 \, b e^{\left (3 \, d x + 3 \, c\right )} - 4 \, a e^{\left (d x + c\right )} - b e^{\left (d x + c\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{4}}}{4 \, d} \end{align*}

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

[In]

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

[Out]

1/4*((4*a*e^c + b*e^c)*arctan(e^(d*x + c))*e^(-c) + (4*a*e^(7*d*x + 7*c) + b*e^(7*d*x + 7*c) + 4*a*e^(5*d*x +
5*c) - 7*b*e^(5*d*x + 5*c) - 4*a*e^(3*d*x + 3*c) + 7*b*e^(3*d*x + 3*c) - 4*a*e^(d*x + c) - b*e^(d*x + c))/(e^(
2*d*x + 2*c) + 1)^4)/d