\(\int \text {sech}(c+d x) (a+b \text {sech}^2(c+d x))^2 \, dx\) [61]

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

Optimal result

Integrand size = 21, antiderivative size = 81 \[ \int \text {sech}(c+d x) \left (a+b \text {sech}^2(c+d x)\right )^2 \, dx=\frac {\left (8 a^2+8 a b+3 b^2\right ) \arctan (\sinh (c+d x))}{8 d}+\frac {b (8 a+3 b) \text {sech}(c+d x) \tanh (c+d x)}{8 d}+\frac {b^2 \text {sech}^3(c+d x) \tanh (c+d x)}{4 d} \] Output:

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

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.36 \[ \int \text {sech}(c+d x) \left (a+b \text {sech}^2(c+d x)\right )^2 \, dx=-\frac {a^2 \cot ^{-1}(\sinh (c+d x))}{d}+\frac {a b \arctan (\sinh (c+d x))}{d}+\frac {3 b^2 \arctan (\sinh (c+d x))}{8 d}+\frac {a b \text {sech}(c+d x) \tanh (c+d x)}{d}+\frac {3 b^2 \text {sech}(c+d x) \tanh (c+d x)}{8 d}+\frac {b^2 \text {sech}^3(c+d x) \tanh (c+d x)}{4 d} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.27 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.23, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3042, 4635, 315, 298, 216}

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 \text {sech}(c+d x) \left (a+b \text {sech}^2(c+d x)\right )^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \sec (i c+i d x) \left (a+b \sec (i c+i d x)^2\right )^2dx\)

\(\Big \downarrow \) 4635

\(\displaystyle \frac {\int \frac {\left (a \sinh ^2(c+d x)+a+b\right )^2}{\left (\sinh ^2(c+d x)+1\right )^3}d\sinh (c+d x)}{d}\)

\(\Big \downarrow \) 315

\(\displaystyle \frac {\frac {1}{4} \int \frac {a (4 a+b) \sinh ^2(c+d x)+(a+b) (4 a+3 b)}{\left (\sinh ^2(c+d x)+1\right )^2}d\sinh (c+d x)+\frac {b \sinh (c+d x) \left (a \sinh ^2(c+d x)+a+b\right )}{4 \left (\sinh ^2(c+d x)+1\right )^2}}{d}\)

\(\Big \downarrow \) 298

\(\displaystyle \frac {\frac {1}{4} \left (\frac {1}{2} \left (8 a^2+8 a b+3 b^2\right ) \int \frac {1}{\sinh ^2(c+d x)+1}d\sinh (c+d x)+\frac {3 b (2 a+b) \sinh (c+d x)}{2 \left (\sinh ^2(c+d x)+1\right )}\right )+\frac {b \sinh (c+d x) \left (a \sinh ^2(c+d x)+a+b\right )}{4 \left (\sinh ^2(c+d x)+1\right )^2}}{d}\)

\(\Big \downarrow \) 216

\(\displaystyle \frac {\frac {1}{4} \left (\frac {1}{2} \left (8 a^2+8 a b+3 b^2\right ) \arctan (\sinh (c+d x))+\frac {3 b (2 a+b) \sinh (c+d x)}{2 \left (\sinh ^2(c+d x)+1\right )}\right )+\frac {b \sinh (c+d x) \left (a \sinh ^2(c+d x)+a+b\right )}{4 \left (\sinh ^2(c+d x)+1\right )^2}}{d}\)

Input:

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

Output:

((b*Sinh[c + d*x]*(a + b + a*Sinh[c + d*x]^2))/(4*(1 + Sinh[c + d*x]^2)^2) 
 + (((8*a^2 + 8*a*b + 3*b^2)*ArcTan[Sinh[c + d*x]])/2 + (3*b*(2*a + b)*Sin 
h[c + d*x])/(2*(1 + Sinh[c + d*x]^2)))/4)/d
 

Defintions of rubi rules used

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

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

rule 315
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Sim 
p[(a*d - c*b)*x*(a + b*x^2)^(p + 1)*((c + d*x^2)^(q - 1)/(2*a*b*(p + 1))), 
x] - Simp[1/(2*a*b*(p + 1))   Int[(a + b*x^2)^(p + 1)*(c + d*x^2)^(q - 2)*S 
imp[c*(a*d - c*b*(2*p + 3)) + d*(a*d*(2*(q - 1) + 1) - b*c*(2*(p + q) + 1)) 
*x^2, x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, - 
1] && GtQ[q, 1] && IntBinomialQ[a, b, c, d, 2, p, q, x]
 

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

rule 4635
Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_ 
))^(p_), x_Symbol] :> With[{ff = FreeFactors[Sin[e + f*x], x]}, Simp[ff/f 
 Subst[Int[ExpandToSum[b + 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] && In 
tegerQ[(m - 1)/2] && IntegerQ[n/2] && IntegerQ[p]
 
Maple [A] (verified)

Time = 1.08 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.04

method result size
derivativedivides \(\frac {2 a^{2} \arctan \left ({\mathrm e}^{d x +c}\right )+2 a b \left (\frac {\operatorname {sech}\left (d x +c \right ) \tanh \left (d x +c \right )}{2}+\arctan \left ({\mathrm e}^{d x +c}\right )\right )+b^{2} \left (\left (\frac {\operatorname {sech}\left (d x +c \right )^{3}}{4}+\frac {3 \,\operatorname {sech}\left (d x +c \right )}{8}\right ) \tanh \left (d x +c \right )+\frac {3 \arctan \left ({\mathrm e}^{d x +c}\right )}{4}\right )}{d}\) \(84\)
default \(\frac {2 a^{2} \arctan \left ({\mathrm e}^{d x +c}\right )+2 a b \left (\frac {\operatorname {sech}\left (d x +c \right ) \tanh \left (d x +c \right )}{2}+\arctan \left ({\mathrm e}^{d x +c}\right )\right )+b^{2} \left (\left (\frac {\operatorname {sech}\left (d x +c \right )^{3}}{4}+\frac {3 \,\operatorname {sech}\left (d x +c \right )}{8}\right ) \tanh \left (d x +c \right )+\frac {3 \arctan \left ({\mathrm e}^{d x +c}\right )}{4}\right )}{d}\) \(84\)
parts \(\frac {a^{2} \arctan \left (\sinh \left (d x +c \right )\right )}{d}+\frac {b^{2} \left (\left (\frac {\operatorname {sech}\left (d x +c \right )^{3}}{4}+\frac {3 \,\operatorname {sech}\left (d x +c \right )}{8}\right ) \tanh \left (d x +c \right )+\frac {3 \arctan \left ({\mathrm e}^{d x +c}\right )}{4}\right )}{d}+\frac {2 a b \left (\frac {\operatorname {sech}\left (d x +c \right ) \tanh \left (d x +c \right )}{2}+\arctan \left ({\mathrm e}^{d x +c}\right )\right )}{d}\) \(88\)
parallelrisch \(\frac {-4 i \left (a b +\frac {3}{8} b^{2}+a^{2}\right ) \left (\frac {3}{4}+\frac {\cosh \left (4 d x +4 c \right )}{4}+\cosh \left (2 d x +2 c \right )\right ) \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-i\right )+4 i \left (a b +\frac {3}{8} b^{2}+a^{2}\right ) \left (\frac {3}{4}+\frac {\cosh \left (4 d x +4 c \right )}{4}+\cosh \left (2 d x +2 c \right )\right ) \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+i\right )+2 b \left (\left (a +\frac {3 b}{8}\right ) \sinh \left (3 d x +3 c \right )+\sinh \left (d x +c \right ) \left (a +\frac {11 b}{8}\right )\right )}{d \left (\cosh \left (4 d x +4 c \right )+4 \cosh \left (2 d x +2 c \right )+3\right )}\) \(161\)
risch \(\frac {b \,{\mathrm e}^{d x +c} \left (8 \,{\mathrm e}^{6 d x +6 c} a +3 \,{\mathrm e}^{6 d x +6 c} b +8 \,{\mathrm e}^{4 d x +4 c} a +11 \,{\mathrm e}^{4 d x +4 c} b -8 a \,{\mathrm e}^{2 d x +2 c}-11 b \,{\mathrm e}^{2 d x +2 c}-8 a -3 b \right )}{4 d \left ({\mathrm e}^{2 d x +2 c}+1\right )^{4}}+\frac {i \ln \left ({\mathrm e}^{d x +c}+i\right ) a^{2}}{d}+\frac {i b a \ln \left ({\mathrm e}^{d x +c}+i\right )}{d}+\frac {3 i b^{2} \ln \left ({\mathrm e}^{d x +c}+i\right )}{8 d}-\frac {i \ln \left ({\mathrm e}^{d x +c}-i\right ) a^{2}}{d}-\frac {i b a \ln \left ({\mathrm e}^{d x +c}-i\right )}{d}-\frac {3 i b^{2} \ln \left ({\mathrm e}^{d x +c}-i\right )}{8 d}\) \(218\)

Input:

int(sech(d*x+c)*(a+b*sech(d*x+c)^2)^2,x,method=_RETURNVERBOSE)
 

Output:

1/d*(2*a^2*arctan(exp(d*x+c))+2*a*b*(1/2*sech(d*x+c)*tanh(d*x+c)+arctan(ex 
p(d*x+c)))+b^2*((1/4*sech(d*x+c)^3+3/8*sech(d*x+c))*tanh(d*x+c)+3/4*arctan 
(exp(d*x+c))))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1372 vs. \(2 (75) = 150\).

Time = 0.19 (sec) , antiderivative size = 1372, normalized size of antiderivative = 16.94 \[ \int \text {sech}(c+d x) \left (a+b \text {sech}^2(c+d x)\right )^2 \, dx=\text {Too large to display} \] Input:

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

Output:

1/4*((8*a*b + 3*b^2)*cosh(d*x + c)^7 + 7*(8*a*b + 3*b^2)*cosh(d*x + c)*sin 
h(d*x + c)^6 + (8*a*b + 3*b^2)*sinh(d*x + c)^7 + (8*a*b + 11*b^2)*cosh(d*x 
 + c)^5 + (21*(8*a*b + 3*b^2)*cosh(d*x + c)^2 + 8*a*b + 11*b^2)*sinh(d*x + 
 c)^5 + 5*(7*(8*a*b + 3*b^2)*cosh(d*x + c)^3 + (8*a*b + 11*b^2)*cosh(d*x + 
 c))*sinh(d*x + c)^4 - (8*a*b + 11*b^2)*cosh(d*x + c)^3 + (35*(8*a*b + 3*b 
^2)*cosh(d*x + c)^4 + 10*(8*a*b + 11*b^2)*cosh(d*x + c)^2 - 8*a*b - 11*b^2 
)*sinh(d*x + c)^3 + (21*(8*a*b + 3*b^2)*cosh(d*x + c)^5 + 10*(8*a*b + 11*b 
^2)*cosh(d*x + c)^3 - 3*(8*a*b + 11*b^2)*cosh(d*x + c))*sinh(d*x + c)^2 + 
((8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c)^8 + 8*(8*a^2 + 8*a*b + 3*b^2)*cosh( 
d*x + c)*sinh(d*x + c)^7 + (8*a^2 + 8*a*b + 3*b^2)*sinh(d*x + c)^8 + 4*(8* 
a^2 + 8*a*b + 3*b^2)*cosh(d*x + c)^6 + 4*(7*(8*a^2 + 8*a*b + 3*b^2)*cosh(d 
*x + c)^2 + 8*a^2 + 8*a*b + 3*b^2)*sinh(d*x + c)^6 + 8*(7*(8*a^2 + 8*a*b + 
 3*b^2)*cosh(d*x + c)^3 + 3*(8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c))*sinh(d* 
x + c)^5 + 6*(8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c)^4 + 2*(35*(8*a^2 + 8*a* 
b + 3*b^2)*cosh(d*x + c)^4 + 30*(8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c)^2 + 
24*a^2 + 24*a*b + 9*b^2)*sinh(d*x + c)^4 + 8*(7*(8*a^2 + 8*a*b + 3*b^2)*co 
sh(d*x + c)^5 + 10*(8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c)^3 + 3*(8*a^2 + 8* 
a*b + 3*b^2)*cosh(d*x + c))*sinh(d*x + c)^3 + 4*(8*a^2 + 8*a*b + 3*b^2)*co 
sh(d*x + c)^2 + 4*(7*(8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c)^6 + 15*(8*a^2 + 
 8*a*b + 3*b^2)*cosh(d*x + c)^4 + 9*(8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + ...
 

Sympy [F]

\[ \int \text {sech}(c+d x) \left (a+b \text {sech}^2(c+d x)\right )^2 \, dx=\int \left (a + b \operatorname {sech}^{2}{\left (c + d x \right )}\right )^{2} \operatorname {sech}{\left (c + d x \right )}\, dx \] Input:

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

Output:

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 201 vs. \(2 (75) = 150\).

Time = 0.13 (sec) , antiderivative size = 201, normalized size of antiderivative = 2.48 \[ \int \text {sech}(c+d x) \left (a+b \text {sech}^2(c+d x)\right )^2 \, dx=-\frac {1}{4} \, b^{2} {\left (\frac {3 \, \arctan \left (e^{\left (-d x - c\right )}\right )}{d} - \frac {3 \, e^{\left (-d x - c\right )} + 11 \, e^{\left (-3 \, d x - 3 \, c\right )} - 11 \, e^{\left (-5 \, d x - 5 \, c\right )} - 3 \, 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 )} - 2 \, a b {\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 )} + \frac {a^{2} \arctan \left (\sinh \left (d x + c\right )\right )}{d} \] Input:

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

Output:

-1/4*b^2*(3*arctan(e^(-d*x - c))/d - (3*e^(-d*x - c) + 11*e^(-3*d*x - 3*c) 
 - 11*e^(-5*d*x - 5*c) - 3*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))) - 2*a*b*(arc 
tan(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))) + a^2*arctan(sinh(d*x + c))/d
                                                                                    
                                                                                    
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 170 vs. \(2 (75) = 150\).

Time = 0.13 (sec) , antiderivative size = 170, normalized size of antiderivative = 2.10 \[ \int \text {sech}(c+d x) \left (a+b \text {sech}^2(c+d x)\right )^2 \, dx=\frac {{\left (\pi + 2 \, \arctan \left (\frac {1}{2} \, {\left (e^{\left (2 \, d x + 2 \, c\right )} - 1\right )} e^{\left (-d x - c\right )}\right )\right )} {\left (8 \, a^{2} + 8 \, a b + 3 \, b^{2}\right )} + \frac {4 \, {\left (8 \, a b {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )}^{3} + 3 \, b^{2} {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )}^{3} + 32 \, a b {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )} + 20 \, b^{2} {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )}\right )}}{{\left ({\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )}^{2} + 4\right )}^{2}}}{16 \, d} \] Input:

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

Output:

1/16*((pi + 2*arctan(1/2*(e^(2*d*x + 2*c) - 1)*e^(-d*x - c)))*(8*a^2 + 8*a 
*b + 3*b^2) + 4*(8*a*b*(e^(d*x + c) - e^(-d*x - c))^3 + 3*b^2*(e^(d*x + c) 
 - e^(-d*x - c))^3 + 32*a*b*(e^(d*x + c) - e^(-d*x - c)) + 20*b^2*(e^(d*x 
+ c) - e^(-d*x - c)))/((e^(d*x + c) - e^(-d*x - c))^2 + 4)^2)/d
 

Mupad [B] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 303, normalized size of antiderivative = 3.74 \[ \int \text {sech}(c+d x) \left (a+b \text {sech}^2(c+d x)\right )^2 \, dx=\frac {\mathrm {atan}\left (\frac {{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\,\left (8\,a^2\,\sqrt {d^2}+3\,b^2\,\sqrt {d^2}+8\,a\,b\,\sqrt {d^2}\right )}{d\,\sqrt {64\,a^4+128\,a^3\,b+112\,a^2\,b^2+48\,a\,b^3+9\,b^4}}\right )\,\sqrt {64\,a^4+128\,a^3\,b+112\,a^2\,b^2+48\,a\,b^3+9\,b^4}}{4\,\sqrt {d^2}}-\frac {6\,b^2\,{\mathrm {e}}^{c+d\,x}}{d\,\left (3\,{\mathrm {e}}^{2\,c+2\,d\,x}+3\,{\mathrm {e}}^{4\,c+4\,d\,x}+{\mathrm {e}}^{6\,c+6\,d\,x}+1\right )}+\frac {4\,b^2\,{\mathrm {e}}^{c+d\,x}}{d\,\left (4\,{\mathrm {e}}^{2\,c+2\,d\,x}+6\,{\mathrm {e}}^{4\,c+4\,d\,x}+4\,{\mathrm {e}}^{6\,c+6\,d\,x}+{\mathrm {e}}^{8\,c+8\,d\,x}+1\right )}+\frac {{\mathrm {e}}^{c+d\,x}\,\left (3\,b^2+8\,a\,b\right )}{4\,d\,\left ({\mathrm {e}}^{2\,c+2\,d\,x}+1\right )}-\frac {{\mathrm {e}}^{c+d\,x}\,\left (8\,a\,b-b^2\right )}{2\,d\,\left (2\,{\mathrm {e}}^{2\,c+2\,d\,x}+{\mathrm {e}}^{4\,c+4\,d\,x}+1\right )} \] Input:

int((a + b/cosh(c + d*x)^2)^2/cosh(c + d*x),x)
 

Output:

(atan((exp(d*x)*exp(c)*(8*a^2*(d^2)^(1/2) + 3*b^2*(d^2)^(1/2) + 8*a*b*(d^2 
)^(1/2)))/(d*(48*a*b^3 + 128*a^3*b + 64*a^4 + 9*b^4 + 112*a^2*b^2)^(1/2))) 
*(48*a*b^3 + 128*a^3*b + 64*a^4 + 9*b^4 + 112*a^2*b^2)^(1/2))/(4*(d^2)^(1/ 
2)) - (6*b^2*exp(c + d*x))/(d*(3*exp(2*c + 2*d*x) + 3*exp(4*c + 4*d*x) + e 
xp(6*c + 6*d*x) + 1)) + (4*b^2*exp(c + d*x))/(d*(4*exp(2*c + 2*d*x) + 6*ex 
p(4*c + 4*d*x) + 4*exp(6*c + 6*d*x) + exp(8*c + 8*d*x) + 1)) + (exp(c + d* 
x)*(8*a*b + 3*b^2))/(4*d*(exp(2*c + 2*d*x) + 1)) - (exp(c + d*x)*(8*a*b - 
b^2))/(2*d*(2*exp(2*c + 2*d*x) + exp(4*c + 4*d*x) + 1))
 

Reduce [B] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 476, normalized size of antiderivative = 5.88 \[ \int \text {sech}(c+d x) \left (a+b \text {sech}^2(c+d x)\right )^2 \, dx=\frac {8 e^{8 d x +8 c} \mathit {atan} \left (e^{d x +c}\right ) a^{2}+8 e^{8 d x +8 c} \mathit {atan} \left (e^{d x +c}\right ) a b +3 e^{8 d x +8 c} \mathit {atan} \left (e^{d x +c}\right ) b^{2}+32 e^{6 d x +6 c} \mathit {atan} \left (e^{d x +c}\right ) a^{2}+32 e^{6 d x +6 c} \mathit {atan} \left (e^{d x +c}\right ) a b +12 e^{6 d x +6 c} \mathit {atan} \left (e^{d x +c}\right ) b^{2}+48 e^{4 d x +4 c} \mathit {atan} \left (e^{d x +c}\right ) a^{2}+48 e^{4 d x +4 c} \mathit {atan} \left (e^{d x +c}\right ) a b +18 e^{4 d x +4 c} \mathit {atan} \left (e^{d x +c}\right ) b^{2}+32 e^{2 d x +2 c} \mathit {atan} \left (e^{d x +c}\right ) a^{2}+32 e^{2 d x +2 c} \mathit {atan} \left (e^{d x +c}\right ) a b +12 e^{2 d x +2 c} \mathit {atan} \left (e^{d x +c}\right ) b^{2}+8 \mathit {atan} \left (e^{d x +c}\right ) a^{2}+8 \mathit {atan} \left (e^{d x +c}\right ) a b +3 \mathit {atan} \left (e^{d x +c}\right ) b^{2}+8 e^{7 d x +7 c} a b +3 e^{7 d x +7 c} b^{2}+8 e^{5 d x +5 c} a b +11 e^{5 d x +5 c} b^{2}-8 e^{3 d x +3 c} a b -11 e^{3 d x +3 c} b^{2}-8 e^{d x +c} a b -3 e^{d x +c} b^{2}}{4 d \left (e^{8 d x +8 c}+4 e^{6 d x +6 c}+6 e^{4 d x +4 c}+4 e^{2 d x +2 c}+1\right )} \] Input:

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

Output:

(8*e**(8*c + 8*d*x)*atan(e**(c + d*x))*a**2 + 8*e**(8*c + 8*d*x)*atan(e**( 
c + d*x))*a*b + 3*e**(8*c + 8*d*x)*atan(e**(c + d*x))*b**2 + 32*e**(6*c + 
6*d*x)*atan(e**(c + d*x))*a**2 + 32*e**(6*c + 6*d*x)*atan(e**(c + d*x))*a* 
b + 12*e**(6*c + 6*d*x)*atan(e**(c + d*x))*b**2 + 48*e**(4*c + 4*d*x)*atan 
(e**(c + d*x))*a**2 + 48*e**(4*c + 4*d*x)*atan(e**(c + d*x))*a*b + 18*e**( 
4*c + 4*d*x)*atan(e**(c + d*x))*b**2 + 32*e**(2*c + 2*d*x)*atan(e**(c + d* 
x))*a**2 + 32*e**(2*c + 2*d*x)*atan(e**(c + d*x))*a*b + 12*e**(2*c + 2*d*x 
)*atan(e**(c + d*x))*b**2 + 8*atan(e**(c + d*x))*a**2 + 8*atan(e**(c + d*x 
))*a*b + 3*atan(e**(c + d*x))*b**2 + 8*e**(7*c + 7*d*x)*a*b + 3*e**(7*c + 
7*d*x)*b**2 + 8*e**(5*c + 5*d*x)*a*b + 11*e**(5*c + 5*d*x)*b**2 - 8*e**(3* 
c + 3*d*x)*a*b - 11*e**(3*c + 3*d*x)*b**2 - 8*e**(c + d*x)*a*b - 3*e**(c + 
 d*x)*b**2)/(4*d*(e**(8*c + 8*d*x) + 4*e**(6*c + 6*d*x) + 6*e**(4*c + 4*d* 
x) + 4*e**(2*c + 2*d*x) + 1))