3.1.87 \(\int (a+b \text {sech}(c+d x))^4 \, dx\) [87]

3.1.87.1 Optimal result
3.1.87.2 Mathematica [A] (verified)
3.1.87.3 Rubi [A] (verified)
3.1.87.4 Maple [A] (verified)
3.1.87.5 Fricas [B] (verification not implemented)
3.1.87.6 Sympy [F]
3.1.87.7 Maxima [B] (verification not implemented)
3.1.87.8 Giac [A] (verification not implemented)
3.1.87.9 Mupad [B] (verification not implemented)

3.1.87.1 Optimal result

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

output
a^4*x+2*a*b*(2*a^2+b^2)*arctan(sinh(d*x+c))/d+1/3*b^2*(17*a^2+2*b^2)*tanh( 
d*x+c)/d+4/3*a*b^3*sech(d*x+c)*tanh(d*x+c)/d+1/3*b^2*(a+b*sech(d*x+c))^2*t 
anh(d*x+c)/d
 
3.1.87.2 Mathematica [A] (verified)

Time = 0.27 (sec) , antiderivative size = 78, normalized size of antiderivative = 0.73 \[ \int (a+b \text {sech}(c+d x))^4 \, dx=\frac {3 a^4 d x+6 a b \left (2 a^2+b^2\right ) \arctan (\sinh (c+d x))+3 b^2 \left (6 a^2+b^2+2 a b \text {sech}(c+d x)\right ) \tanh (c+d x)-b^4 \tanh ^3(c+d x)}{3 d} \]

input
Integrate[(a + b*Sech[c + d*x])^4,x]
 
output
(3*a^4*d*x + 6*a*b*(2*a^2 + b^2)*ArcTan[Sinh[c + d*x]] + 3*b^2*(6*a^2 + b^ 
2 + 2*a*b*Sech[c + d*x])*Tanh[c + d*x] - b^4*Tanh[c + d*x]^3)/(3*d)
 
3.1.87.3 Rubi [A] (verified)

Time = 0.44 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.07, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.417, Rules used = {3042, 4269, 3042, 4536, 2009}

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

\(\Big \downarrow \) 3042

\(\displaystyle \int \left (a+b \csc \left (i c+i d x+\frac {\pi }{2}\right )\right )^4dx\)

\(\Big \downarrow \) 4269

\(\displaystyle \frac {1}{3} \int (a+b \text {sech}(c+d x)) \left (3 a^3+8 b^2 \text {sech}^2(c+d x) a+b \left (9 a^2+2 b^2\right ) \text {sech}(c+d x)\right )dx+\frac {b^2 \tanh (c+d x) (a+b \text {sech}(c+d x))^2}{3 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {b^2 \tanh (c+d x) (a+b \text {sech}(c+d x))^2}{3 d}+\frac {1}{3} \int \left (a+b \csc \left (i c+i d x+\frac {\pi }{2}\right )\right ) \left (3 a^3+8 b^2 \csc \left (i c+i d x+\frac {\pi }{2}\right )^2 a+b \left (9 a^2+2 b^2\right ) \csc \left (i c+i d x+\frac {\pi }{2}\right )\right )dx\)

\(\Big \downarrow \) 4536

\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \int \left (6 a^4+12 b \left (2 a^2+b^2\right ) \text {sech}(c+d x) a+2 b^2 \left (17 a^2+2 b^2\right ) \text {sech}^2(c+d x)\right )dx+\frac {4 a b^3 \tanh (c+d x) \text {sech}(c+d x)}{d}\right )+\frac {b^2 \tanh (c+d x) (a+b \text {sech}(c+d x))^2}{3 d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \left (6 a^4 x+\frac {12 a b \left (2 a^2+b^2\right ) \arctan (\sinh (c+d x))}{d}+\frac {2 b^2 \left (17 a^2+2 b^2\right ) \tanh (c+d x)}{d}\right )+\frac {4 a b^3 \tanh (c+d x) \text {sech}(c+d x)}{d}\right )+\frac {b^2 \tanh (c+d x) (a+b \text {sech}(c+d x))^2}{3 d}\)

input
Int[(a + b*Sech[c + d*x])^4,x]
 
output
(b^2*(a + b*Sech[c + d*x])^2*Tanh[c + d*x])/(3*d) + ((4*a*b^3*Sech[c + d*x 
]*Tanh[c + d*x])/d + (6*a^4*x + (12*a*b*(2*a^2 + b^2)*ArcTan[Sinh[c + d*x] 
])/d + (2*b^2*(17*a^2 + 2*b^2)*Tanh[c + d*x])/d)/2)/3
 

3.1.87.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

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

rule 4269
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Simp[(-b^2)*C 
ot[c + d*x]*((a + b*Csc[c + d*x])^(n - 2)/(d*(n - 1))), x] + Simp[1/(n - 1) 
   Int[(a + b*Csc[c + d*x])^(n - 3)*Simp[a^3*(n - 1) + (b*(b^2*(n - 2) + 3* 
a^2*(n - 1)))*Csc[c + d*x] + (a*b^2*(3*n - 4))*Csc[c + d*x]^2, x], x], x] / 
; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0] && GtQ[n, 2] && IntegerQ[2*n]
 

rule 4536
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. 
))*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[(-b)*C*Csc[e + 
 f*x]*(Cot[e + f*x]/(2*f)), x] + Simp[1/2   Int[Simp[2*A*a + (2*B*a + b*(2* 
A + C))*Csc[e + f*x] + 2*(a*C + B*b)*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a 
, b, e, f, A, B, C}, x]
 
3.1.87.4 Maple [A] (verified)

Time = 1.41 (sec) , antiderivative size = 92, normalized size of antiderivative = 0.86

method result size
derivativedivides \(\frac {a^{4} \left (d x +c \right )+8 a^{3} b \arctan \left ({\mathrm e}^{d x +c}\right )+6 a^{2} b^{2} \tanh \left (d x +c \right )+4 a \,b^{3} \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^{4} \left (\frac {2}{3}+\frac {\operatorname {sech}\left (d x +c \right )^{2}}{3}\right ) \tanh \left (d x +c \right )}{d}\) \(92\)
default \(\frac {a^{4} \left (d x +c \right )+8 a^{3} b \arctan \left ({\mathrm e}^{d x +c}\right )+6 a^{2} b^{2} \tanh \left (d x +c \right )+4 a \,b^{3} \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^{4} \left (\frac {2}{3}+\frac {\operatorname {sech}\left (d x +c \right )^{2}}{3}\right ) \tanh \left (d x +c \right )}{d}\) \(92\)
parts \(x \,a^{4}+\frac {b^{4} \left (\frac {2}{3}+\frac {\operatorname {sech}\left (d x +c \right )^{2}}{3}\right ) \tanh \left (d x +c \right )}{d}+\frac {4 a \,b^{3} \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}+\frac {6 a^{2} b^{2} \tanh \left (d x +c \right )}{d}+\frac {4 a^{3} b \arctan \left (\sinh \left (d x +c \right )\right )}{d}\) \(96\)
risch \(x \,a^{4}-\frac {4 b^{2} \left (-3 a b \,{\mathrm e}^{5 d x +5 c}+9 a^{2} {\mathrm e}^{4 d x +4 c}+18 a^{2} {\mathrm e}^{2 d x +2 c}+3 \,{\mathrm e}^{2 d x +2 c} b^{2}+3 \,{\mathrm e}^{d x +c} a b +9 a^{2}+b^{2}\right )}{3 d \left ({\mathrm e}^{2 d x +2 c}+1\right )^{3}}+\frac {4 i a^{3} b \ln \left ({\mathrm e}^{d x +c}+i\right )}{d}+\frac {2 i a \,b^{3} \ln \left ({\mathrm e}^{d x +c}+i\right )}{d}-\frac {4 i a^{3} b \ln \left ({\mathrm e}^{d x +c}-i\right )}{d}-\frac {2 i a \,b^{3} \ln \left ({\mathrm e}^{d x +c}-i\right )}{d}\) \(182\)
parallelrisch \(\frac {-36 i \left (\frac {\cosh \left (3 d x +3 c \right )}{3}+\cosh \left (d x +c \right )\right ) b a \left (a^{2}+\frac {b^{2}}{2}\right ) \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-i\right )+36 i \left (\frac {\cosh \left (3 d x +3 c \right )}{3}+\cosh \left (d x +c \right )\right ) b a \left (a^{2}+\frac {b^{2}}{2}\right ) \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+i\right )+3 a^{4} d x \cosh \left (3 d x +3 c \right )+2 \left (9 a^{2} b^{2}+b^{4}\right ) \sinh \left (3 d x +3 c \right )+12 a \,b^{3} \sinh \left (2 d x +2 c \right )+9 a^{4} d x \cosh \left (d x +c \right )+6 \left (3 a^{2} b^{2}+b^{4}\right ) \sinh \left (d x +c \right )}{3 d \left (\cosh \left (3 d x +3 c \right )+3 \cosh \left (d x +c \right )\right )}\) \(204\)

input
int((a+b*sech(d*x+c))^4,x,method=_RETURNVERBOSE)
 
output
1/d*(a^4*(d*x+c)+8*a^3*b*arctan(exp(d*x+c))+6*a^2*b^2*tanh(d*x+c)+4*a*b^3* 
(1/2*sech(d*x+c)*tanh(d*x+c)+arctan(exp(d*x+c)))+b^4*(2/3+1/3*sech(d*x+c)^ 
2)*tanh(d*x+c))
 
3.1.87.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1028 vs. \(2 (101) = 202\).

Time = 0.27 (sec) , antiderivative size = 1028, normalized size of antiderivative = 9.61 \[ \int (a+b \text {sech}(c+d x))^4 \, dx=\text {Too large to display} \]

input
integrate((a+b*sech(d*x+c))^4,x, algorithm="fricas")
 
output
1/3*(3*a^4*d*x*cosh(d*x + c)^6 + 3*a^4*d*x*sinh(d*x + c)^6 + 12*a*b^3*cosh 
(d*x + c)^5 + 3*a^4*d*x + 6*(3*a^4*d*x*cosh(d*x + c) + 2*a*b^3)*sinh(d*x + 
 c)^5 - 12*a*b^3*cosh(d*x + c) + 9*(a^4*d*x - 4*a^2*b^2)*cosh(d*x + c)^4 + 
 3*(15*a^4*d*x*cosh(d*x + c)^2 + 3*a^4*d*x + 20*a*b^3*cosh(d*x + c) - 12*a 
^2*b^2)*sinh(d*x + c)^4 - 36*a^2*b^2 - 4*b^4 + 12*(5*a^4*d*x*cosh(d*x + c) 
^3 + 10*a*b^3*cosh(d*x + c)^2 + 3*(a^4*d*x - 4*a^2*b^2)*cosh(d*x + c))*sin 
h(d*x + c)^3 + 3*(3*a^4*d*x - 24*a^2*b^2 - 4*b^4)*cosh(d*x + c)^2 + 3*(15* 
a^4*d*x*cosh(d*x + c)^4 + 40*a*b^3*cosh(d*x + c)^3 + 3*a^4*d*x - 24*a^2*b^ 
2 - 4*b^4 + 18*(a^4*d*x - 4*a^2*b^2)*cosh(d*x + c)^2)*sinh(d*x + c)^2 + 12 
*((2*a^3*b + a*b^3)*cosh(d*x + c)^6 + 6*(2*a^3*b + a*b^3)*cosh(d*x + c)*si 
nh(d*x + c)^5 + (2*a^3*b + a*b^3)*sinh(d*x + c)^6 + 3*(2*a^3*b + a*b^3)*co 
sh(d*x + c)^4 + 3*(2*a^3*b + a*b^3 + 5*(2*a^3*b + a*b^3)*cosh(d*x + c)^2)* 
sinh(d*x + c)^4 + 2*a^3*b + a*b^3 + 4*(5*(2*a^3*b + a*b^3)*cosh(d*x + c)^3 
 + 3*(2*a^3*b + a*b^3)*cosh(d*x + c))*sinh(d*x + c)^3 + 3*(2*a^3*b + a*b^3 
)*cosh(d*x + c)^2 + 3*(5*(2*a^3*b + a*b^3)*cosh(d*x + c)^4 + 2*a^3*b + a*b 
^3 + 6*(2*a^3*b + a*b^3)*cosh(d*x + c)^2)*sinh(d*x + c)^2 + 6*((2*a^3*b + 
a*b^3)*cosh(d*x + c)^5 + 2*(2*a^3*b + a*b^3)*cosh(d*x + c)^3 + (2*a^3*b + 
a*b^3)*cosh(d*x + c))*sinh(d*x + c))*arctan(cosh(d*x + c) + sinh(d*x + c)) 
 + 6*(3*a^4*d*x*cosh(d*x + c)^5 + 10*a*b^3*cosh(d*x + c)^4 - 2*a*b^3 + 6*( 
a^4*d*x - 4*a^2*b^2)*cosh(d*x + c)^3 + (3*a^4*d*x - 24*a^2*b^2 - 4*b^4)...
 
3.1.87.6 Sympy [F]

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

input
integrate((a+b*sech(d*x+c))**4,x)
 
output
Integral((a + b*sech(c + d*x))**4, x)
 
3.1.87.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 211 vs. \(2 (101) = 202\).

Time = 0.28 (sec) , antiderivative size = 211, normalized size of antiderivative = 1.97 \[ \int (a+b \text {sech}(c+d x))^4 \, dx=a^{4} x - 4 \, a b^{3} {\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 {4}{3} \, b^{4} {\left (\frac {3 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d {\left (3 \, e^{\left (-2 \, d x - 2 \, c\right )} + 3 \, e^{\left (-4 \, d x - 4 \, c\right )} + e^{\left (-6 \, d x - 6 \, c\right )} + 1\right )}} + \frac {1}{d {\left (3 \, e^{\left (-2 \, d x - 2 \, c\right )} + 3 \, e^{\left (-4 \, d x - 4 \, c\right )} + e^{\left (-6 \, d x - 6 \, c\right )} + 1\right )}}\right )} + \frac {4 \, a^{3} b \arctan \left (\sinh \left (d x + c\right )\right )}{d} + \frac {12 \, a^{2} b^{2}}{d {\left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}} \]

input
integrate((a+b*sech(d*x+c))^4,x, algorithm="maxima")
 
output
a^4*x - 4*a*b^3*(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))) + 4/3*b^4*(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)) 
) + 4*a^3*b*arctan(sinh(d*x + c))/d + 12*a^2*b^2/(d*(e^(-2*d*x - 2*c) + 1) 
)
 
3.1.87.8 Giac [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.32 \[ \int (a+b \text {sech}(c+d x))^4 \, dx=\frac {3 \, {\left (d x + c\right )} a^{4} + 12 \, {\left (2 \, a^{3} b + a b^{3}\right )} \arctan \left (e^{\left (d x + c\right )}\right ) + \frac {4 \, {\left (3 \, a b^{3} e^{\left (5 \, d x + 5 \, c\right )} - 9 \, a^{2} b^{2} e^{\left (4 \, d x + 4 \, c\right )} - 18 \, a^{2} b^{2} e^{\left (2 \, d x + 2 \, c\right )} - 3 \, b^{4} e^{\left (2 \, d x + 2 \, c\right )} - 3 \, a b^{3} e^{\left (d x + c\right )} - 9 \, a^{2} b^{2} - b^{4}\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{3}}}{3 \, d} \]

input
integrate((a+b*sech(d*x+c))^4,x, algorithm="giac")
 
output
1/3*(3*(d*x + c)*a^4 + 12*(2*a^3*b + a*b^3)*arctan(e^(d*x + c)) + 4*(3*a*b 
^3*e^(5*d*x + 5*c) - 9*a^2*b^2*e^(4*d*x + 4*c) - 18*a^2*b^2*e^(2*d*x + 2*c 
) - 3*b^4*e^(2*d*x + 2*c) - 3*a*b^3*e^(d*x + c) - 9*a^2*b^2 - b^4)/(e^(2*d 
*x + 2*c) + 1)^3)/d
 
3.1.87.9 Mupad [B] (verification not implemented)

Time = 2.11 (sec) , antiderivative size = 233, normalized size of antiderivative = 2.18 \[ \int (a+b \text {sech}(c+d x))^4 \, dx=a^4\,x-\frac {\frac {12\,a^2\,b^2}{d}-\frac {4\,a\,b^3\,{\mathrm {e}}^{c+d\,x}}{d}}{{\mathrm {e}}^{2\,c+2\,d\,x}+1}-\frac {\frac {4\,b^4}{d}+\frac {8\,a\,b^3\,{\mathrm {e}}^{c+d\,x}}{d}}{2\,{\mathrm {e}}^{2\,c+2\,d\,x}+{\mathrm {e}}^{4\,c+4\,d\,x}+1}+\frac {8\,b^4}{3\,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\,\mathrm {atan}\left (\frac {{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\,\left (a\,b^3\,\sqrt {d^2}+2\,a^3\,b\,\sqrt {d^2}\right )}{d\,\sqrt {4\,a^6\,b^2+4\,a^4\,b^4+a^2\,b^6}}\right )\,\sqrt {4\,a^6\,b^2+4\,a^4\,b^4+a^2\,b^6}}{\sqrt {d^2}} \]

input
int((a + b/cosh(c + d*x))^4,x)
 
output
a^4*x - ((12*a^2*b^2)/d - (4*a*b^3*exp(c + d*x))/d)/(exp(2*c + 2*d*x) + 1) 
 - ((4*b^4)/d + (8*a*b^3*exp(c + d*x))/d)/(2*exp(2*c + 2*d*x) + exp(4*c + 
4*d*x) + 1) + (8*b^4)/(3*d*(3*exp(2*c + 2*d*x) + 3*exp(4*c + 4*d*x) + exp( 
6*c + 6*d*x) + 1)) + (4*atan((exp(d*x)*exp(c)*(a*b^3*(d^2)^(1/2) + 2*a^3*b 
*(d^2)^(1/2)))/(d*(a^2*b^6 + 4*a^4*b^4 + 4*a^6*b^2)^(1/2)))*(a^2*b^6 + 4*a 
^4*b^4 + 4*a^6*b^2)^(1/2))/(d^2)^(1/2)