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

Optimal. Leaf size=76 $\frac{a^2 \tanh (c+d x)}{d}-\frac{b (2 a-b) \tanh ^5(c+d x)}{5 d}-\frac{a (a-2 b) \tanh ^3(c+d x)}{3 d}-\frac{b^2 \tanh ^7(c+d x)}{7 d}$

[Out]

(a^2*Tanh[c + d*x])/d - (a*(a - 2*b)*Tanh[c + d*x]^3)/(3*d) - ((2*a - b)*b*Tanh[c + d*x]^5)/(5*d) - (b^2*Tanh[
c + d*x]^7)/(7*d)

________________________________________________________________________________________

Rubi [A]  time = 0.070226, antiderivative size = 76, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 23, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.087, Rules used = {3675, 373} $\frac{a^2 \tanh (c+d x)}{d}-\frac{b (2 a-b) \tanh ^5(c+d x)}{5 d}-\frac{a (a-2 b) \tanh ^3(c+d x)}{3 d}-\frac{b^2 \tanh ^7(c+d x)}{7 d}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(a^2*Tanh[c + d*x])/d - (a*(a - 2*b)*Tanh[c + d*x]^3)/(3*d) - ((2*a - b)*b*Tanh[c + d*x]^5)/(5*d) - (b^2*Tanh[
c + d*x]^7)/(7*d)

Rule 3675

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[ff/(c^(m - 1)*f), Subst[Int[(c^2 + ff^2*x^2)^(m/2 - 1)*(a + b*(ff*x)
^n)^p, x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2] && (IntegersQ[n, p
] || IGtQ[m, 0] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])

Rule 373

Int[((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x^n
)^p*(c + d*x^n)^q, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] && IGtQ[q, 0]

Rubi steps

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

Mathematica [A]  time = 0.514829, size = 83, normalized size = 1.09 $\frac{\tanh (c+d x) \left (\left (35 a^2+14 a b+3 b^2\right ) \text{sech}^2(c+d x)+70 a^2-6 b (7 a+4 b) \text{sech}^4(c+d x)+28 a b+15 b^2 \text{sech}^6(c+d x)+6 b^2\right )}{105 d}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

((70*a^2 + 28*a*b + 6*b^2 + (35*a^2 + 14*a*b + 3*b^2)*Sech[c + d*x]^2 - 6*b*(7*a + 4*b)*Sech[c + d*x]^4 + 15*b
^2*Sech[c + d*x]^6)*Tanh[c + d*x])/(105*d)

________________________________________________________________________________________

Maple [B]  time = 0.057, size = 158, normalized size = 2.1 \begin{align*}{\frac{1}{d} \left ({a}^{2} \left ({\frac{2}{3}}+{\frac{ \left ({\rm sech} \left (dx+c\right ) \right ) ^{2}}{3}} \right ) \tanh \left ( dx+c \right ) +2\,ab \left ( -1/4\,{\frac{\sinh \left ( dx+c \right ) }{ \left ( \cosh \left ( dx+c \right ) \right ) ^{5}}}+1/4\, \left ({\frac{8}{15}}+1/5\, \left ({\rm sech} \left (dx+c\right ) \right ) ^{4}+{\frac{4\, \left ({\rm sech} \left (dx+c\right ) \right ) ^{2}}{15}} \right ) \tanh \left ( dx+c \right ) \right ) +{b}^{2} \left ( -{\frac{ \left ( \sinh \left ( dx+c \right ) \right ) ^{3}}{4\, \left ( \cosh \left ( dx+c \right ) \right ) ^{7}}}-{\frac{\sinh \left ( dx+c \right ) }{8\, \left ( \cosh \left ( dx+c \right ) \right ) ^{7}}}+{\frac{\tanh \left ( dx+c \right ) }{8} \left ({\frac{16}{35}}+{\frac{ \left ({\rm sech} \left (dx+c\right ) \right ) ^{6}}{7}}+{\frac{6\, \left ({\rm sech} \left (dx+c\right ) \right ) ^{4}}{35}}+{\frac{8\, \left ({\rm sech} \left (dx+c\right ) \right ) ^{2}}{35}} \right ) } \right ) \right ) } \end{align*}

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

[In]

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

[Out]

1/d*(a^2*(2/3+1/3*sech(d*x+c)^2)*tanh(d*x+c)+2*a*b*(-1/4*sinh(d*x+c)/cosh(d*x+c)^5+1/4*(8/15+1/5*sech(d*x+c)^4
+4/15*sech(d*x+c)^2)*tanh(d*x+c))+b^2*(-1/4*sinh(d*x+c)^3/cosh(d*x+c)^7-1/8*sinh(d*x+c)/cosh(d*x+c)^7+1/8*(16/
35+1/7*sech(d*x+c)^6+6/35*sech(d*x+c)^4+8/35*sech(d*x+c)^2)*tanh(d*x+c)))

________________________________________________________________________________________

Maxima [B]  time = 1.21135, size = 1253, normalized size = 16.49 \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)^4*(a+b*tanh(d*x+c)^2)^2,x, algorithm="maxima")

[Out]

4/35*b^2*(7*e^(-2*d*x - 2*c)/(d*(7*e^(-2*d*x - 2*c) + 21*e^(-4*d*x - 4*c) + 35*e^(-6*d*x - 6*c) + 35*e^(-8*d*x
- 8*c) + 21*e^(-10*d*x - 10*c) + 7*e^(-12*d*x - 12*c) + e^(-14*d*x - 14*c) + 1)) - 14*e^(-4*d*x - 4*c)/(d*(7*
e^(-2*d*x - 2*c) + 21*e^(-4*d*x - 4*c) + 35*e^(-6*d*x - 6*c) + 35*e^(-8*d*x - 8*c) + 21*e^(-10*d*x - 10*c) + 7
*e^(-12*d*x - 12*c) + e^(-14*d*x - 14*c) + 1)) + 70*e^(-6*d*x - 6*c)/(d*(7*e^(-2*d*x - 2*c) + 21*e^(-4*d*x - 4
*c) + 35*e^(-6*d*x - 6*c) + 35*e^(-8*d*x - 8*c) + 21*e^(-10*d*x - 10*c) + 7*e^(-12*d*x - 12*c) + e^(-14*d*x -
14*c) + 1)) - 35*e^(-8*d*x - 8*c)/(d*(7*e^(-2*d*x - 2*c) + 21*e^(-4*d*x - 4*c) + 35*e^(-6*d*x - 6*c) + 35*e^(-
8*d*x - 8*c) + 21*e^(-10*d*x - 10*c) + 7*e^(-12*d*x - 12*c) + e^(-14*d*x - 14*c) + 1)) + 35*e^(-10*d*x - 10*c)
/(d*(7*e^(-2*d*x - 2*c) + 21*e^(-4*d*x - 4*c) + 35*e^(-6*d*x - 6*c) + 35*e^(-8*d*x - 8*c) + 21*e^(-10*d*x - 10
*c) + 7*e^(-12*d*x - 12*c) + e^(-14*d*x - 14*c) + 1)) + 1/(d*(7*e^(-2*d*x - 2*c) + 21*e^(-4*d*x - 4*c) + 35*e^
(-6*d*x - 6*c) + 35*e^(-8*d*x - 8*c) + 21*e^(-10*d*x - 10*c) + 7*e^(-12*d*x - 12*c) + e^(-14*d*x - 14*c) + 1))
) + 8/15*a*b*(5*e^(-2*d*x - 2*c)/(d*(5*e^(-2*d*x - 2*c) + 10*e^(-4*d*x - 4*c) + 10*e^(-6*d*x - 6*c) + 5*e^(-8*
d*x - 8*c) + e^(-10*d*x - 10*c) + 1)) - 5*e^(-4*d*x - 4*c)/(d*(5*e^(-2*d*x - 2*c) + 10*e^(-4*d*x - 4*c) + 10*e
^(-6*d*x - 6*c) + 5*e^(-8*d*x - 8*c) + e^(-10*d*x - 10*c) + 1)) + 15*e^(-6*d*x - 6*c)/(d*(5*e^(-2*d*x - 2*c) +
10*e^(-4*d*x - 4*c) + 10*e^(-6*d*x - 6*c) + 5*e^(-8*d*x - 8*c) + e^(-10*d*x - 10*c) + 1)) + 1/(d*(5*e^(-2*d*x
- 2*c) + 10*e^(-4*d*x - 4*c) + 10*e^(-6*d*x - 6*c) + 5*e^(-8*d*x - 8*c) + e^(-10*d*x - 10*c) + 1))) + 4/3*a^2
*(3*e^(-2*d*x - 2*c)/(d*(3*e^(-2*d*x - 2*c) + 3*e^(-4*d*x - 4*c) + e^(-6*d*x - 6*c) + 1)) + 1/(d*(3*e^(-2*d*x
- 2*c) + 3*e^(-4*d*x - 4*c) + e^(-6*d*x - 6*c) + 1)))

________________________________________________________________________________________

Fricas [B]  time = 1.90376, size = 1829, normalized size = 24.07 \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)^4*(a+b*tanh(d*x+c)^2)^2,x, algorithm="fricas")

[Out]

-8/105*(2*(35*a^2 + 56*a*b + 27*b^2)*cosh(d*x + c)^5 + 10*(35*a^2 + 56*a*b + 27*b^2)*cosh(d*x + c)*sinh(d*x +
c)^4 + (35*a^2 + 98*a*b + 51*b^2)*sinh(d*x + c)^5 + 14*(25*a^2 + 16*a*b - 3*b^2)*cosh(d*x + c)^3 + (10*(35*a^2
+ 98*a*b + 51*b^2)*cosh(d*x + c)^2 + 105*a^2 + 126*a*b - 63*b^2)*sinh(d*x + c)^3 + 2*(10*(35*a^2 + 56*a*b + 2
7*b^2)*cosh(d*x + c)^3 + 21*(25*a^2 + 16*a*b - 3*b^2)*cosh(d*x + c))*sinh(d*x + c)^2 + 28*(25*a^2 + 4*a*b + 3*
b^2)*cosh(d*x + c) + (5*(35*a^2 + 98*a*b + 51*b^2)*cosh(d*x + c)^4 + 63*(5*a^2 + 6*a*b - 3*b^2)*cosh(d*x + c)^
2 + 70*a^2 + 28*a*b + 126*b^2)*sinh(d*x + c))/(d*cosh(d*x + c)^9 + 9*d*cosh(d*x + c)*sinh(d*x + c)^8 + d*sinh(
d*x + c)^9 + 7*d*cosh(d*x + c)^7 + (36*d*cosh(d*x + c)^2 + 7*d)*sinh(d*x + c)^7 + 7*(12*d*cosh(d*x + c)^3 + 7*
d*cosh(d*x + c))*sinh(d*x + c)^6 + 22*d*cosh(d*x + c)^5 + (126*d*cosh(d*x + c)^4 + 147*d*cosh(d*x + c)^2 + 20*
d)*sinh(d*x + c)^5 + (126*d*cosh(d*x + c)^5 + 245*d*cosh(d*x + c)^3 + 110*d*cosh(d*x + c))*sinh(d*x + c)^4 + 4
2*d*cosh(d*x + c)^3 + (84*d*cosh(d*x + c)^6 + 245*d*cosh(d*x + c)^4 + 200*d*cosh(d*x + c)^2 + 28*d)*sinh(d*x +
c)^3 + (36*d*cosh(d*x + c)^7 + 147*d*cosh(d*x + c)^5 + 220*d*cosh(d*x + c)^3 + 126*d*cosh(d*x + c))*sinh(d*x
+ c)^2 + 56*d*cosh(d*x + c) + (9*d*cosh(d*x + c)^8 + 49*d*cosh(d*x + c)^6 + 100*d*cosh(d*x + c)^4 + 84*d*cosh(
d*x + c)^2 + 14*d)*sinh(d*x + c))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tanh ^{2}{\left (c + d x \right )}\right )^{2} \operatorname{sech}^{4}{\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)**4*(a+b*tanh(d*x+c)**2)**2,x)

[Out]

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

________________________________________________________________________________________

Giac [B]  time = 1.45603, size = 321, normalized size = 4.22 \begin{align*} -\frac{4 \,{\left (105 \, a^{2} e^{\left (10 \, d x + 10 \, c\right )} + 210 \, a b e^{\left (10 \, d x + 10 \, c\right )} + 105 \, b^{2} e^{\left (10 \, d x + 10 \, c\right )} + 455 \, a^{2} e^{\left (8 \, d x + 8 \, c\right )} + 350 \, a b e^{\left (8 \, d x + 8 \, c\right )} - 105 \, b^{2} e^{\left (8 \, d x + 8 \, c\right )} + 770 \, a^{2} e^{\left (6 \, d x + 6 \, c\right )} + 140 \, a b e^{\left (6 \, d x + 6 \, c\right )} + 210 \, b^{2} e^{\left (6 \, d x + 6 \, c\right )} + 630 \, a^{2} e^{\left (4 \, d x + 4 \, c\right )} + 84 \, a b e^{\left (4 \, d x + 4 \, c\right )} - 42 \, b^{2} e^{\left (4 \, d x + 4 \, c\right )} + 245 \, a^{2} e^{\left (2 \, d x + 2 \, c\right )} + 98 \, a b e^{\left (2 \, d x + 2 \, c\right )} + 21 \, b^{2} e^{\left (2 \, d x + 2 \, c\right )} + 35 \, a^{2} + 14 \, a b + 3 \, b^{2}\right )}}{105 \, d{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{7}} \end{align*}

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

[In]

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

[Out]

-4/105*(105*a^2*e^(10*d*x + 10*c) + 210*a*b*e^(10*d*x + 10*c) + 105*b^2*e^(10*d*x + 10*c) + 455*a^2*e^(8*d*x +
8*c) + 350*a*b*e^(8*d*x + 8*c) - 105*b^2*e^(8*d*x + 8*c) + 770*a^2*e^(6*d*x + 6*c) + 140*a*b*e^(6*d*x + 6*c)
+ 210*b^2*e^(6*d*x + 6*c) + 630*a^2*e^(4*d*x + 4*c) + 84*a*b*e^(4*d*x + 4*c) - 42*b^2*e^(4*d*x + 4*c) + 245*a^
2*e^(2*d*x + 2*c) + 98*a*b*e^(2*d*x + 2*c) + 21*b^2*e^(2*d*x + 2*c) + 35*a^2 + 14*a*b + 3*b^2)/(d*(e^(2*d*x +
2*c) + 1)^7)