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

Optimal result
Mathematica [A] (verified)
Rubi [A] (warning: unable to verify)
Maple [A] (warning: unable to verify)
Fricas [B] (verification not implemented)
Sympy [A] (verification not implemented)
Maxima [A] (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 = 71 \[ \int \left (a+b \text {sech}^2(c+d x)\right )^3 \tanh (c+d x) \, dx=\frac {a^3 \log (\cosh (c+d x))}{d}-\frac {3 a^2 b \text {sech}^2(c+d x)}{2 d}-\frac {3 a b^2 \text {sech}^4(c+d x)}{4 d}-\frac {b^3 \text {sech}^6(c+d x)}{6 d} \] Output:

a^3*ln(cosh(d*x+c))/d-3/2*a^2*b*sech(d*x+c)^2/d-3/4*a*b^2*sech(d*x+c)^4/d- 
1/6*b^3*sech(d*x+c)^6/d
 

Mathematica [A] (verified)

Time = 0.84 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.41 \[ \int \left (a+b \text {sech}^2(c+d x)\right )^3 \tanh (c+d x) \, dx=\frac {\cosh ^6(c+d x) \left (a+b \text {sech}^2(c+d x)\right )^3 \left (8 a^3 \log (\cosh (c+d x))-12 a^2 b \text {sech}^2(c+d x)-6 a b^2 \text {sech}^4(c+d x)-\frac {4}{3} b^3 \text {sech}^6(c+d x)\right )}{d (a+2 b+a \cosh (2 c+2 d x))^3} \] Input:

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

Output:

(Cosh[c + d*x]^6*(a + b*Sech[c + d*x]^2)^3*(8*a^3*Log[Cosh[c + d*x]] - 12* 
a^2*b*Sech[c + d*x]^2 - 6*a*b^2*Sech[c + d*x]^4 - (4*b^3*Sech[c + d*x]^6)/ 
3))/(d*(a + 2*b + a*Cosh[2*c + 2*d*x])^3)
 

Rubi [A] (warning: unable to verify)

Time = 0.30 (sec) , antiderivative size = 64, normalized size of antiderivative = 0.90, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 26, 4626, 243, 49, 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 \tanh (c+d x) \left (a+b \text {sech}^2(c+d x)\right )^3 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 26

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

\(\Big \downarrow \) 4626

\(\displaystyle \frac {\int \left (a \cosh ^2(c+d x)+b\right )^3 \text {sech}^7(c+d x)d\cosh (c+d x)}{d}\)

\(\Big \downarrow \) 243

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

\(\Big \downarrow \) 49

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {a^3 \log \left (\cosh ^2(c+d x)\right )-3 a^2 b \text {sech}(c+d x)-\frac {3}{2} a b^2 \text {sech}^2(c+d x)-\frac {1}{3} b^3 \text {sech}^3(c+d x)}{2 d}\)

Input:

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

Output:

(a^3*Log[Cosh[c + d*x]^2] - 3*a^2*b*Sech[c + d*x] - (3*a*b^2*Sech[c + d*x] 
^2)/2 - (b^3*Sech[c + d*x]^3)/3)/(2*d)
 

Defintions of rubi rules used

rule 26
Int[(Complex[0, a_])*(Fx_), x_Symbol] :> Simp[(Complex[Identity[0], a])   I 
nt[Fx, x], x] /; FreeQ[a, x] && EqQ[a^2, 1]
 

rule 49
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int 
[ExpandIntegrand[(a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d}, x] 
&& IGtQ[m, 0] && IGtQ[m + n + 2, 0]
 

rule 243
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[1/2   Subst[In 
t[x^((m - 1)/2)*(a + b*x)^p, x], x, x^2], x] /; FreeQ[{a, b, m, p}, x] && I 
ntegerQ[(m - 1)/2]
 

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 4626
Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_ 
)]^(m_.), x_Symbol] :> Module[{ff = FreeFactors[Cos[e + f*x], x]}, Simp[-(f 
*ff^(m + n*p - 1))^(-1)   Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*((b + a*(ff* 
x)^n)^p/x^(m + n*p)), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n} 
, x] && IntegerQ[(m - 1)/2] && IntegerQ[n] && IntegerQ[p]
 
Maple [A] (warning: unable to verify)

Time = 58.92 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.83

method result size
derivativedivides \(-\frac {\frac {\operatorname {sech}\left (d x +c \right )^{6} b^{3}}{6}+\frac {3 \operatorname {sech}\left (d x +c \right )^{4} a \,b^{2}}{4}+\frac {3 \operatorname {sech}\left (d x +c \right )^{2} a^{2} b}{2}+a^{3} \ln \left (\operatorname {sech}\left (d x +c \right )\right )}{d}\) \(59\)
default \(-\frac {\frac {\operatorname {sech}\left (d x +c \right )^{6} b^{3}}{6}+\frac {3 \operatorname {sech}\left (d x +c \right )^{4} a \,b^{2}}{4}+\frac {3 \operatorname {sech}\left (d x +c \right )^{2} a^{2} b}{2}+a^{3} \ln \left (\operatorname {sech}\left (d x +c \right )\right )}{d}\) \(59\)
parts \(\frac {a^{3} \ln \left (\cosh \left (d x +c \right )\right )}{d}-\frac {b^{3} \operatorname {sech}\left (d x +c \right )^{6}}{6 d}+\frac {3 a^{2} b \tanh \left (d x +c \right )^{2}}{2 d}-\frac {3 a \,b^{2} \operatorname {sech}\left (d x +c \right )^{4}}{4 d}\) \(66\)
risch \(-a^{3} x -\frac {2 a^{3} c}{d}-\frac {2 b \,{\mathrm e}^{2 d x +2 c} \left (9 a^{2} {\mathrm e}^{8 d x +8 c}+36 a^{2} {\mathrm e}^{6 d x +6 c}+18 a b \,{\mathrm e}^{6 d x +6 c}+54 a^{2} {\mathrm e}^{4 d x +4 c}+36 a b \,{\mathrm e}^{4 d x +4 c}+16 b^{2} {\mathrm e}^{4 d x +4 c}+36 a^{2} {\mathrm e}^{2 d x +2 c}+18 a b \,{\mathrm e}^{2 d x +2 c}+9 a^{2}\right )}{3 d \left ({\mathrm e}^{2 d x +2 c}+1\right )^{6}}+\frac {a^{3} \ln \left ({\mathrm e}^{2 d x +2 c}+1\right )}{d}\) \(179\)

Input:

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

Output:

-1/d*(1/6*sech(d*x+c)^6*b^3+3/4*sech(d*x+c)^4*a*b^2+3/2*sech(d*x+c)^2*a^2* 
b+a^3*ln(sech(d*x+c)))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 2519 vs. \(2 (65) = 130\).

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

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

Output:

-1/3*(3*a^3*d*x*cosh(d*x + c)^12 + 36*a^3*d*x*cosh(d*x + c)*sinh(d*x + c)^ 
11 + 3*a^3*d*x*sinh(d*x + c)^12 + 18*(a^3*d*x + a^2*b)*cosh(d*x + c)^10 + 
18*(11*a^3*d*x*cosh(d*x + c)^2 + a^3*d*x + a^2*b)*sinh(d*x + c)^10 + 60*(1 
1*a^3*d*x*cosh(d*x + c)^3 + 3*(a^3*d*x + a^2*b)*cosh(d*x + c))*sinh(d*x + 
c)^9 + 9*(5*a^3*d*x + 8*a^2*b + 4*a*b^2)*cosh(d*x + c)^8 + 9*(165*a^3*d*x* 
cosh(d*x + c)^4 + 5*a^3*d*x + 8*a^2*b + 4*a*b^2 + 90*(a^3*d*x + a^2*b)*cos 
h(d*x + c)^2)*sinh(d*x + c)^8 + 72*(33*a^3*d*x*cosh(d*x + c)^5 + 30*(a^3*d 
*x + a^2*b)*cosh(d*x + c)^3 + (5*a^3*d*x + 8*a^2*b + 4*a*b^2)*cosh(d*x + c 
))*sinh(d*x + c)^7 + 4*(15*a^3*d*x + 27*a^2*b + 18*a*b^2 + 8*b^3)*cosh(d*x 
 + c)^6 + 4*(693*a^3*d*x*cosh(d*x + c)^6 + 15*a^3*d*x + 945*(a^3*d*x + a^2 
*b)*cosh(d*x + c)^4 + 27*a^2*b + 18*a*b^2 + 8*b^3 + 63*(5*a^3*d*x + 8*a^2* 
b + 4*a*b^2)*cosh(d*x + c)^2)*sinh(d*x + c)^6 + 24*(99*a^3*d*x*cosh(d*x + 
c)^7 + 189*(a^3*d*x + a^2*b)*cosh(d*x + c)^5 + 21*(5*a^3*d*x + 8*a^2*b + 4 
*a*b^2)*cosh(d*x + c)^3 + (15*a^3*d*x + 27*a^2*b + 18*a*b^2 + 8*b^3)*cosh( 
d*x + c))*sinh(d*x + c)^5 + 3*a^3*d*x + 9*(5*a^3*d*x + 8*a^2*b + 4*a*b^2)* 
cosh(d*x + c)^4 + 3*(495*a^3*d*x*cosh(d*x + c)^8 + 1260*(a^3*d*x + a^2*b)* 
cosh(d*x + c)^6 + 15*a^3*d*x + 210*(5*a^3*d*x + 8*a^2*b + 4*a*b^2)*cosh(d* 
x + c)^4 + 24*a^2*b + 12*a*b^2 + 20*(15*a^3*d*x + 27*a^2*b + 18*a*b^2 + 8* 
b^3)*cosh(d*x + c)^2)*sinh(d*x + c)^4 + 4*(165*a^3*d*x*cosh(d*x + c)^9 + 5 
40*(a^3*d*x + a^2*b)*cosh(d*x + c)^7 + 126*(5*a^3*d*x + 8*a^2*b + 4*a*b...
 

Sympy [A] (verification not implemented)

Time = 0.61 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.23 \[ \int \left (a+b \text {sech}^2(c+d x)\right )^3 \tanh (c+d x) \, dx=\begin {cases} a^{3} x - \frac {a^{3} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {3 a^{2} b \operatorname {sech}^{2}{\left (c + d x \right )}}{2 d} - \frac {3 a b^{2} \operatorname {sech}^{4}{\left (c + d x \right )}}{4 d} - \frac {b^{3} \operatorname {sech}^{6}{\left (c + d x \right )}}{6 d} & \text {for}\: d \neq 0 \\x \left (a + b \operatorname {sech}^{2}{\left (c \right )}\right )^{3} \tanh {\left (c \right )} & \text {otherwise} \end {cases} \] Input:

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

Output:

Piecewise((a**3*x - a**3*log(tanh(c + d*x) + 1)/d - 3*a**2*b*sech(c + d*x) 
**2/(2*d) - 3*a*b**2*sech(c + d*x)**4/(4*d) - b**3*sech(c + d*x)**6/(6*d), 
 Ne(d, 0)), (x*(a + b*sech(c)**2)**3*tanh(c), True))
 

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.20 \[ \int \left (a+b \text {sech}^2(c+d x)\right )^3 \tanh (c+d x) \, dx=\frac {3 \, a^{2} b \tanh \left (d x + c\right )^{2}}{2 \, d} + \frac {a^{3} \log \left (\cosh \left (d x + c\right )\right )}{d} - \frac {12 \, a b^{2}}{d {\left (e^{\left (d x + c\right )} + e^{\left (-d x - c\right )}\right )}^{4}} - \frac {32 \, b^{3}}{3 \, d {\left (e^{\left (d x + c\right )} + e^{\left (-d x - c\right )}\right )}^{6}} \] Input:

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

Output:

3/2*a^2*b*tanh(d*x + c)^2/d + a^3*log(cosh(d*x + c))/d - 12*a*b^2/(d*(e^(d 
*x + c) + e^(-d*x - c))^4) - 32/3*b^3/(d*(e^(d*x + c) + e^(-d*x - c))^6)
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 271 vs. \(2 (65) = 130\).

Time = 0.15 (sec) , antiderivative size = 271, normalized size of antiderivative = 3.82 \[ \int \left (a+b \text {sech}^2(c+d x)\right )^3 \tanh (c+d x) \, dx=-\frac {60 \, {\left (d x + c\right )} a^{3} - 60 \, a^{3} \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) + \frac {147 \, a^{3} e^{\left (12 \, d x + 12 \, c\right )} + 882 \, a^{3} e^{\left (10 \, d x + 10 \, c\right )} + 360 \, a^{2} b e^{\left (10 \, d x + 10 \, c\right )} + 2205 \, a^{3} e^{\left (8 \, d x + 8 \, c\right )} + 1440 \, a^{2} b e^{\left (8 \, d x + 8 \, c\right )} + 720 \, a b^{2} e^{\left (8 \, d x + 8 \, c\right )} + 2940 \, a^{3} e^{\left (6 \, d x + 6 \, c\right )} + 2160 \, a^{2} b e^{\left (6 \, d x + 6 \, c\right )} + 1440 \, a b^{2} e^{\left (6 \, d x + 6 \, c\right )} + 640 \, b^{3} e^{\left (6 \, d x + 6 \, c\right )} + 2205 \, a^{3} e^{\left (4 \, d x + 4 \, c\right )} + 1440 \, a^{2} b e^{\left (4 \, d x + 4 \, c\right )} + 720 \, a b^{2} e^{\left (4 \, d x + 4 \, c\right )} + 882 \, a^{3} e^{\left (2 \, d x + 2 \, c\right )} + 360 \, a^{2} b e^{\left (2 \, d x + 2 \, c\right )} + 147 \, a^{3}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{6}}}{60 \, d} \] Input:

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

Output:

-1/60*(60*(d*x + c)*a^3 - 60*a^3*log(e^(2*d*x + 2*c) + 1) + (147*a^3*e^(12 
*d*x + 12*c) + 882*a^3*e^(10*d*x + 10*c) + 360*a^2*b*e^(10*d*x + 10*c) + 2 
205*a^3*e^(8*d*x + 8*c) + 1440*a^2*b*e^(8*d*x + 8*c) + 720*a*b^2*e^(8*d*x 
+ 8*c) + 2940*a^3*e^(6*d*x + 6*c) + 2160*a^2*b*e^(6*d*x + 6*c) + 1440*a*b^ 
2*e^(6*d*x + 6*c) + 640*b^3*e^(6*d*x + 6*c) + 2205*a^3*e^(4*d*x + 4*c) + 1 
440*a^2*b*e^(4*d*x + 4*c) + 720*a*b^2*e^(4*d*x + 4*c) + 882*a^3*e^(2*d*x + 
 2*c) + 360*a^2*b*e^(2*d*x + 2*c) + 147*a^3)/(e^(2*d*x + 2*c) + 1)^6)/d
 

Mupad [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 347, normalized size of antiderivative = 4.89 \[ \int \left (a+b \text {sech}^2(c+d x)\right )^3 \tanh (c+d x) \, dx=\frac {32\,b^3}{3\,d\,\left (6\,{\mathrm {e}}^{2\,c+2\,d\,x}+15\,{\mathrm {e}}^{4\,c+4\,d\,x}+20\,{\mathrm {e}}^{6\,c+6\,d\,x}+15\,{\mathrm {e}}^{8\,c+8\,d\,x}+6\,{\mathrm {e}}^{10\,c+10\,d\,x}+{\mathrm {e}}^{12\,c+12\,d\,x}+1\right )}-\frac {4\,\left (3\,a\,b^2-8\,b^3\right )}{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 )}-a^3\,x-\frac {6\,\left (2\,a\,b^2-a^2\,b\right )}{d\,\left (2\,{\mathrm {e}}^{2\,c+2\,d\,x}+{\mathrm {e}}^{4\,c+4\,d\,x}+1\right )}+\frac {a^3\,\ln \left ({\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}+1\right )}{d}+\frac {8\,\left (9\,a\,b^2-4\,b^3\right )}{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 {32\,b^3}{d\,\left (5\,{\mathrm {e}}^{2\,c+2\,d\,x}+10\,{\mathrm {e}}^{4\,c+4\,d\,x}+10\,{\mathrm {e}}^{6\,c+6\,d\,x}+5\,{\mathrm {e}}^{8\,c+8\,d\,x}+{\mathrm {e}}^{10\,c+10\,d\,x}+1\right )}-\frac {6\,a^2\,b}{d\,\left ({\mathrm {e}}^{2\,c+2\,d\,x}+1\right )} \] Input:

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

Output:

(32*b^3)/(3*d*(6*exp(2*c + 2*d*x) + 15*exp(4*c + 4*d*x) + 20*exp(6*c + 6*d 
*x) + 15*exp(8*c + 8*d*x) + 6*exp(10*c + 10*d*x) + exp(12*c + 12*d*x) + 1) 
) - (4*(3*a*b^2 - 8*b^3))/(d*(4*exp(2*c + 2*d*x) + 6*exp(4*c + 4*d*x) + 4* 
exp(6*c + 6*d*x) + exp(8*c + 8*d*x) + 1)) - a^3*x - (6*(2*a*b^2 - a^2*b))/ 
(d*(2*exp(2*c + 2*d*x) + exp(4*c + 4*d*x) + 1)) + (a^3*log(exp(2*c)*exp(2* 
d*x) + 1))/d + (8*(9*a*b^2 - 4*b^3))/(3*d*(3*exp(2*c + 2*d*x) + 3*exp(4*c 
+ 4*d*x) + exp(6*c + 6*d*x) + 1)) - (32*b^3)/(d*(5*exp(2*c + 2*d*x) + 10*e 
xp(4*c + 4*d*x) + 10*exp(6*c + 6*d*x) + 5*exp(8*c + 8*d*x) + exp(10*c + 10 
*d*x) + 1)) - (6*a^2*b)/(d*(exp(2*c + 2*d*x) + 1))
 

Reduce [B] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.01 \[ \int \left (a+b \text {sech}^2(c+d x)\right )^3 \tanh (c+d x) \, dx=\frac {12 \,\mathrm {log}\left (e^{2 d x +2 c}+1\right ) a^{3}-2 \mathrm {sech}\left (d x +c \right )^{6} b^{3}-9 \mathrm {sech}\left (d x +c \right )^{4} a \,b^{2}-18 \mathrm {sech}\left (d x +c \right )^{2} a^{2} b -12 a^{3} d x}{12 d} \] Input:

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

Output:

(12*log(e**(2*c + 2*d*x) + 1)*a**3 - 2*sech(c + d*x)**6*b**3 - 9*sech(c + 
d*x)**4*a*b**2 - 18*sech(c + d*x)**2*a**2*b - 12*a**3*d*x)/(12*d)