\(\int \frac {\text {sech}^4(x)}{a+a \text {sech}(x)} \, dx\) [75]

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

Optimal result

Integrand size = 13, antiderivative size = 45 \[ \int \frac {\text {sech}^4(x)}{a+a \text {sech}(x)} \, dx=\frac {3 \arctan (\sinh (x))}{2 a}-\frac {2 \tanh (x)}{a}+\frac {3 \text {sech}(x) \tanh (x)}{2 a}-\frac {\text {sech}^2(x) \tanh (x)}{a+a \text {sech}(x)} \] Output:

3/2*arctan(sinh(x))/a-2*tanh(x)/a+3/2*sech(x)*tanh(x)/a-sech(x)^2*tanh(x)/ 
(a+a*sech(x))
 

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 41, normalized size of antiderivative = 0.91 \[ \int \frac {\text {sech}^4(x)}{a+a \text {sech}(x)} \, dx=\frac {3 \arctan (\sinh (x))+2 \text {sech}^3(x) \tanh \left (\frac {x}{2}\right )-6 \tanh (x)+3 \text {sech}(x) \tanh (x)+2 \tanh ^3(x)}{2 a} \] Input:

Integrate[Sech[x]^4/(a + a*Sech[x]),x]
 

Output:

(3*ArcTan[Sinh[x]] + 2*Sech[x]^3*Tanh[x/2] - 6*Tanh[x] + 3*Sech[x]*Tanh[x] 
 + 2*Tanh[x]^3)/(2*a)
 

Rubi [A] (verified)

Time = 0.86 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.04, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.769, Rules used = {3042, 4305, 3042, 4274, 3042, 4254, 24, 4255, 3042, 4257}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4305

\(\displaystyle -\frac {\int \text {sech}^2(x) (2 a-3 a \text {sech}(x))dx}{a^2}-\frac {\tanh (x) \text {sech}^2(x)}{a \text {sech}(x)+a}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {\tanh (x) \text {sech}^2(x)}{a \text {sech}(x)+a}-\frac {\int \csc \left (i x+\frac {\pi }{2}\right )^2 \left (2 a-3 a \csc \left (i x+\frac {\pi }{2}\right )\right )dx}{a^2}\)

\(\Big \downarrow \) 4274

\(\displaystyle -\frac {2 a \int \text {sech}^2(x)dx-3 a \int \text {sech}^3(x)dx}{a^2}-\frac {\tanh (x) \text {sech}^2(x)}{a \text {sech}(x)+a}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {\tanh (x) \text {sech}^2(x)}{a \text {sech}(x)+a}-\frac {2 a \int \csc \left (i x+\frac {\pi }{2}\right )^2dx-3 a \int \csc \left (i x+\frac {\pi }{2}\right )^3dx}{a^2}\)

\(\Big \downarrow \) 4254

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

\(\Big \downarrow \) 24

\(\displaystyle -\frac {\tanh (x) \text {sech}^2(x)}{a \text {sech}(x)+a}-\frac {2 a \tanh (x)-3 a \int \csc \left (i x+\frac {\pi }{2}\right )^3dx}{a^2}\)

\(\Big \downarrow \) 4255

\(\displaystyle -\frac {2 a \tanh (x)-3 a \left (\frac {\int \text {sech}(x)dx}{2}+\frac {1}{2} \tanh (x) \text {sech}(x)\right )}{a^2}-\frac {\tanh (x) \text {sech}^2(x)}{a \text {sech}(x)+a}\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4257

\(\displaystyle -\frac {2 a \tanh (x)-3 a \left (\frac {1}{2} \arctan (\sinh (x))+\frac {1}{2} \tanh (x) \text {sech}(x)\right )}{a^2}-\frac {\tanh (x) \text {sech}^2(x)}{a \text {sech}(x)+a}\)

Input:

Int[Sech[x]^4/(a + a*Sech[x]),x]
 

Output:

-((Sech[x]^2*Tanh[x])/(a + a*Sech[x])) - (2*a*Tanh[x] - 3*a*(ArcTan[Sinh[x 
]]/2 + (Sech[x]*Tanh[x])/2))/a^2
 

Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

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

rule 4254
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1)   Subst[Int[Exp 
andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, 
 d}, x] && IGtQ[n/2, 0]
 

rule 4255
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* 
x]*((b*Csc[c + d*x])^(n - 1)/(d*(n - 1))), x] + Simp[b^2*((n - 2)/(n - 1)) 
  Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] 
&& IntegerQ[2*n]
 

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 

rule 4274
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + 
(a_)), x_Symbol] :> Simp[a   Int[(d*Csc[e + f*x])^n, x], x] + Simp[b/d   In 
t[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]
 

rule 4305
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)/(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( 
a_)), x_Symbol] :> Simp[d^2*Cot[e + f*x]*((d*Csc[e + f*x])^(n - 2)/(f*(a + 
b*Csc[e + f*x]))), x] - Simp[d^2/(a*b)   Int[(d*Csc[e + f*x])^(n - 2)*(b*(n 
 - 2) - a*(n - 1)*Csc[e + f*x]), x], x] /; FreeQ[{a, b, d, e, f}, x] && EqQ 
[a^2 - b^2, 0] && GtQ[n, 1]
 
Maple [A] (verified)

Time = 0.35 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.02

method result size
default \(\frac {-\tanh \left (\frac {x}{2}\right )+\frac {-3 \tanh \left (\frac {x}{2}\right )^{3}-\tanh \left (\frac {x}{2}\right )}{\left (\tanh \left (\frac {x}{2}\right )^{2}+1\right )^{2}}+3 \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{a}\) \(46\)
risch \(\frac {3 \,{\mathrm e}^{4 x}+3 \,{\mathrm e}^{3 x}+5 \,{\mathrm e}^{2 x}+{\mathrm e}^{x}+4}{\left (1+{\mathrm e}^{x}\right ) a \left ({\mathrm e}^{2 x}+1\right )^{2}}+\frac {3 i \ln \left ({\mathrm e}^{x}+i\right )}{2 a}-\frac {3 i \ln \left ({\mathrm e}^{x}-i\right )}{2 a}\) \(66\)
parallelrisch \(\frac {3 i \left (-1-\cosh \left (2 x \right )\right ) \ln \left (\tanh \left (\frac {x}{2}\right )-i\right )+3 i \left (1+\cosh \left (2 x \right )\right ) \ln \left (\tanh \left (\frac {x}{2}\right )+i\right )-2 \tanh \left (\frac {x}{2}\right ) \left (\cosh \left (x \right )+2 \cosh \left (2 x \right )+1\right )}{2 a \left (1+\cosh \left (2 x \right )\right )}\) \(67\)

Input:

int(sech(x)^4/(a+a*sech(x)),x,method=_RETURNVERBOSE)
 

Output:

1/a*(-tanh(1/2*x)+2*(-3/2*tanh(1/2*x)^3-1/2*tanh(1/2*x))/(tanh(1/2*x)^2+1) 
^2+3*arctan(tanh(1/2*x)))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 325 vs. \(2 (41) = 82\).

Time = 0.08 (sec) , antiderivative size = 325, normalized size of antiderivative = 7.22 \[ \int \frac {\text {sech}^4(x)}{a+a \text {sech}(x)} \, dx=\frac {3 \, \cosh \left (x\right )^{4} + 3 \, {\left (4 \, \cosh \left (x\right ) + 1\right )} \sinh \left (x\right )^{3} + 3 \, \sinh \left (x\right )^{4} + 3 \, \cosh \left (x\right )^{3} + {\left (18 \, \cosh \left (x\right )^{2} + 9 \, \cosh \left (x\right ) + 5\right )} \sinh \left (x\right )^{2} + 3 \, {\left (\cosh \left (x\right )^{5} + {\left (5 \, \cosh \left (x\right ) + 1\right )} \sinh \left (x\right )^{4} + \sinh \left (x\right )^{5} + \cosh \left (x\right )^{4} + 2 \, {\left (5 \, \cosh \left (x\right )^{2} + 2 \, \cosh \left (x\right ) + 1\right )} \sinh \left (x\right )^{3} + 2 \, \cosh \left (x\right )^{3} + 2 \, {\left (5 \, \cosh \left (x\right )^{3} + 3 \, \cosh \left (x\right )^{2} + 3 \, \cosh \left (x\right ) + 1\right )} \sinh \left (x\right )^{2} + 2 \, \cosh \left (x\right )^{2} + {\left (5 \, \cosh \left (x\right )^{4} + 4 \, \cosh \left (x\right )^{3} + 6 \, \cosh \left (x\right )^{2} + 4 \, \cosh \left (x\right ) + 1\right )} \sinh \left (x\right ) + \cosh \left (x\right ) + 1\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) + 5 \, \cosh \left (x\right )^{2} + {\left (12 \, \cosh \left (x\right )^{3} + 9 \, \cosh \left (x\right )^{2} + 10 \, \cosh \left (x\right ) + 1\right )} \sinh \left (x\right ) + \cosh \left (x\right ) + 4}{a \cosh \left (x\right )^{5} + a \sinh \left (x\right )^{5} + a \cosh \left (x\right )^{4} + {\left (5 \, a \cosh \left (x\right ) + a\right )} \sinh \left (x\right )^{4} + 2 \, a \cosh \left (x\right )^{3} + 2 \, {\left (5 \, a \cosh \left (x\right )^{2} + 2 \, a \cosh \left (x\right ) + a\right )} \sinh \left (x\right )^{3} + 2 \, a \cosh \left (x\right )^{2} + 2 \, {\left (5 \, a \cosh \left (x\right )^{3} + 3 \, a \cosh \left (x\right )^{2} + 3 \, a \cosh \left (x\right ) + a\right )} \sinh \left (x\right )^{2} + a \cosh \left (x\right ) + {\left (5 \, a \cosh \left (x\right )^{4} + 4 \, a \cosh \left (x\right )^{3} + 6 \, a \cosh \left (x\right )^{2} + 4 \, a \cosh \left (x\right ) + a\right )} \sinh \left (x\right ) + a} \] Input:

integrate(sech(x)^4/(a+a*sech(x)),x, algorithm="fricas")
 

Output:

(3*cosh(x)^4 + 3*(4*cosh(x) + 1)*sinh(x)^3 + 3*sinh(x)^4 + 3*cosh(x)^3 + ( 
18*cosh(x)^2 + 9*cosh(x) + 5)*sinh(x)^2 + 3*(cosh(x)^5 + (5*cosh(x) + 1)*s 
inh(x)^4 + sinh(x)^5 + cosh(x)^4 + 2*(5*cosh(x)^2 + 2*cosh(x) + 1)*sinh(x) 
^3 + 2*cosh(x)^3 + 2*(5*cosh(x)^3 + 3*cosh(x)^2 + 3*cosh(x) + 1)*sinh(x)^2 
 + 2*cosh(x)^2 + (5*cosh(x)^4 + 4*cosh(x)^3 + 6*cosh(x)^2 + 4*cosh(x) + 1) 
*sinh(x) + cosh(x) + 1)*arctan(cosh(x) + sinh(x)) + 5*cosh(x)^2 + (12*cosh 
(x)^3 + 9*cosh(x)^2 + 10*cosh(x) + 1)*sinh(x) + cosh(x) + 4)/(a*cosh(x)^5 
+ a*sinh(x)^5 + a*cosh(x)^4 + (5*a*cosh(x) + a)*sinh(x)^4 + 2*a*cosh(x)^3 
+ 2*(5*a*cosh(x)^2 + 2*a*cosh(x) + a)*sinh(x)^3 + 2*a*cosh(x)^2 + 2*(5*a*c 
osh(x)^3 + 3*a*cosh(x)^2 + 3*a*cosh(x) + a)*sinh(x)^2 + a*cosh(x) + (5*a*c 
osh(x)^4 + 4*a*cosh(x)^3 + 6*a*cosh(x)^2 + 4*a*cosh(x) + a)*sinh(x) + a)
 

Sympy [F]

\[ \int \frac {\text {sech}^4(x)}{a+a \text {sech}(x)} \, dx=\frac {\int \frac {\operatorname {sech}^{4}{\left (x \right )}}{\operatorname {sech}{\left (x \right )} + 1}\, dx}{a} \] Input:

integrate(sech(x)**4/(a+a*sech(x)),x)
 

Output:

Integral(sech(x)**4/(sech(x) + 1), x)/a
 

Maxima [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.62 \[ \int \frac {\text {sech}^4(x)}{a+a \text {sech}(x)} \, dx=-\frac {e^{\left (-x\right )} + 5 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-3 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + 4}{a e^{\left (-x\right )} + 2 \, a e^{\left (-2 \, x\right )} + 2 \, a e^{\left (-3 \, x\right )} + a e^{\left (-4 \, x\right )} + a e^{\left (-5 \, x\right )} + a} - \frac {3 \, \arctan \left (e^{\left (-x\right )}\right )}{a} \] Input:

integrate(sech(x)^4/(a+a*sech(x)),x, algorithm="maxima")
 

Output:

-(e^(-x) + 5*e^(-2*x) + 3*e^(-3*x) + 3*e^(-4*x) + 4)/(a*e^(-x) + 2*a*e^(-2 
*x) + 2*a*e^(-3*x) + a*e^(-4*x) + a*e^(-5*x) + a) - 3*arctan(e^(-x))/a
 

Giac [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.07 \[ \int \frac {\text {sech}^4(x)}{a+a \text {sech}(x)} \, dx=\frac {3 \, \arctan \left (e^{x}\right )}{a} + \frac {e^{\left (3 \, x\right )} + 2 \, e^{\left (2 \, x\right )} - e^{x} + 2}{a {\left (e^{\left (2 \, x\right )} + 1\right )}^{2}} + \frac {2}{a {\left (e^{x} + 1\right )}} \] Input:

integrate(sech(x)^4/(a+a*sech(x)),x, algorithm="giac")
 

Output:

3*arctan(e^x)/a + (e^(3*x) + 2*e^(2*x) - e^x + 2)/(a*(e^(2*x) + 1)^2) + 2/ 
(a*(e^x + 1))
 

Mupad [B] (verification not implemented)

Time = 2.30 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.62 \[ \int \frac {\text {sech}^4(x)}{a+a \text {sech}(x)} \, dx=\frac {2}{a\,\left ({\mathrm {e}}^x+1\right )}+\frac {\frac {2}{a}+\frac {{\mathrm {e}}^x}{a}}{{\mathrm {e}}^{2\,x}+1}+\frac {3\,\mathrm {atan}\left (\frac {{\mathrm {e}}^x\,\sqrt {a^2}}{a}\right )}{\sqrt {a^2}}-\frac {2\,{\mathrm {e}}^x}{a\,\left (2\,{\mathrm {e}}^{2\,x}+{\mathrm {e}}^{4\,x}+1\right )} \] Input:

int(1/(cosh(x)^4*(a + a/cosh(x))),x)
                                                                                    
                                                                                    
 

Output:

2/(a*(exp(x) + 1)) + (2/a + exp(x)/a)/(exp(2*x) + 1) + (3*atan((exp(x)*(a^ 
2)^(1/2))/a))/(a^2)^(1/2) - (2*exp(x))/(a*(2*exp(2*x) + exp(4*x) + 1))
 

Reduce [B] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 122, normalized size of antiderivative = 2.71 \[ \int \frac {\text {sech}^4(x)}{a+a \text {sech}(x)} \, dx=\frac {3 e^{5 x} \mathit {atan} \left (e^{x}\right )+3 e^{4 x} \mathit {atan} \left (e^{x}\right )+6 e^{3 x} \mathit {atan} \left (e^{x}\right )+6 e^{2 x} \mathit {atan} \left (e^{x}\right )+3 e^{x} \mathit {atan} \left (e^{x}\right )+3 \mathit {atan} \left (e^{x}\right )-3 e^{5 x}-3 e^{3 x}-e^{2 x}-2 e^{x}+1}{a \left (e^{5 x}+e^{4 x}+2 e^{3 x}+2 e^{2 x}+e^{x}+1\right )} \] Input:

int(sech(x)^4/(a+a*sech(x)),x)
 

Output:

(3*e**(5*x)*atan(e**x) + 3*e**(4*x)*atan(e**x) + 6*e**(3*x)*atan(e**x) + 6 
*e**(2*x)*atan(e**x) + 3*e**x*atan(e**x) + 3*atan(e**x) - 3*e**(5*x) - 3*e 
**(3*x) - e**(2*x) - 2*e**x + 1)/(a*(e**(5*x) + e**(4*x) + 2*e**(3*x) + 2* 
e**(2*x) + e**x + 1))