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

   Optimal result
   Rubi [A] (verified)
   Mathematica [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)

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)} \]

[Out]

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))

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.462, Rules used = {3903, 3872, 3852, 8, 3853, 3855} \[ \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 {\tanh (x) \text {sech}^2(x)}{a \text {sech}(x)+a}+\frac {3 \tanh (x) \text {sech}(x)}{2 a} \]

[In]

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

[Out]

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

Rule 8

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

Rule 3852

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

Rule 3853

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] + Dist[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 3855

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

Rule 3872

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

Rule 3903

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] - Dist[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]

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {sech}^2(x) \tanh (x)}{a+a \text {sech}(x)}-\frac {\int \text {sech}^2(x) (2 a-3 a \text {sech}(x)) \, dx}{a^2} \\ & = -\frac {\text {sech}^2(x) \tanh (x)}{a+a \text {sech}(x)}-\frac {2 \int \text {sech}^2(x) \, dx}{a}+\frac {3 \int \text {sech}^3(x) \, dx}{a} \\ & = \frac {3 \text {sech}(x) \tanh (x)}{2 a}-\frac {\text {sech}^2(x) \tanh (x)}{a+a \text {sech}(x)}-\frac {(2 i) \text {Subst}(\int 1 \, dx,x,-i \tanh (x))}{a}+\frac {3 \int \text {sech}(x) \, dx}{2 a} \\ & = \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)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.12 (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} \]

[In]

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

[Out]

(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)

Maple [A] (verified)

Time = 0.31 (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 (1+\tanh \left (\frac {x}{2}\right )^{2}\right )^{2}}+3 \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{a}\) \(46\)
parallelrisch \(\frac {-3 i \ln \left (-i+\coth \left (x \right )-\operatorname {csch}\left (x \right )\right )+3 i \ln \left (i+\coth \left (x \right )-\operatorname {csch}\left (x \right )\right )+\left (-\operatorname {sech}\left (x \right )^{2}+2 \,\operatorname {sech}\left (x \right )+3\right ) \operatorname {csch}\left (x \right )-4 \coth \left (x \right )}{2 a}\) \(52\)
risch \(\frac {3 \,{\mathrm e}^{4 x}+3 \,{\mathrm e}^{3 x}+5 \,{\mathrm e}^{2 x}+{\mathrm e}^{x}+4}{a \left (1+{\mathrm e}^{2 x}\right )^{2} \left ({\mathrm e}^{x}+1\right )}+\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\)

[In]

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

[Out]

1/a*(-tanh(1/2*x)+2*(-3/2*tanh(1/2*x)^3-1/2*tanh(1/2*x))/(1+tanh(1/2*x)^2)^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.26 (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} \]

[In]

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

[Out]

(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)*sinh(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*cosh(x)^3 + 3*a*cosh(x)^2 + 3*a*cosh(x) + a)*sinh(x)^2 + a*cosh(x) + (5*a*cosh(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} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.30 (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} \]

[In]

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

[Out]

-(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)

none

Time = 0.27 (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 )}} \]

[In]

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

[Out]

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.04 (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 )} \]

[In]

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

[Out]

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))