3.102 \(\int \frac{\text{sech}^4(x)}{a+b \text{sech}(x)} \, dx\)

Optimal. Leaf size=87 \[ -\frac{2 a^3 \tan ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{b^3 \sqrt{a-b} \sqrt{a+b}}+\frac{\left (2 a^2+b^2\right ) \tan ^{-1}(\sinh (x))}{2 b^3}-\frac{a \tanh (x)}{b^2}+\frac{\tanh (x) \text{sech}(x)}{2 b} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.242076, antiderivative size = 87, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 7, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.538, Rules used = {3851, 4082, 3998, 3770, 3831, 2659, 205} \[ -\frac{2 a^3 \tan ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{b^3 \sqrt{a-b} \sqrt{a+b}}+\frac{\left (2 a^2+b^2\right ) \tan ^{-1}(\sinh (x))}{2 b^3}-\frac{a \tanh (x)}{b^2}+\frac{\tanh (x) \text{sech}(x)}{2 b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 3851

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

Rule 4082

Int[csc[(e_.) + (f_.)*(x_)]*((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_
.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_Symbol] :> -Simp[(C*Cot[e + f*x]*(a + b*Csc[e + f*x])^(m + 1))/(b*f*(m
+ 2)), x] + Dist[1/(b*(m + 2)), Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^m*Simp[b*A*(m + 2) + b*C*(m + 1) + (b*B*
(m + 2) - a*C)*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] &&  !LtQ[m, -1]

Rule 3998

Int[(csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x
_Symbol] :> Dist[B/b, Int[Csc[e + f*x], x], x] + Dist[(A*b - a*B)/b, Int[Csc[e + f*x]/(a + b*Csc[e + f*x]), x]
, x] /; FreeQ[{a, b, e, f, A, B}, x] && NeQ[A*b - a*B, 0]

Rule 3770

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

Rule 3831

Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[1/b, Int[1/(1 + (a*Sin[e
 + f*x])/b), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]

Rule 2659

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[(2*e)/d, Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{\text{sech}^4(x)}{a+b \text{sech}(x)} \, dx &=\frac{\text{sech}(x) \tanh (x)}{2 b}+\frac{\int \frac{\text{sech}(x) \left (a+b \text{sech}(x)-2 a \text{sech}^2(x)\right )}{a+b \text{sech}(x)} \, dx}{2 b}\\ &=-\frac{a \tanh (x)}{b^2}+\frac{\text{sech}(x) \tanh (x)}{2 b}+\frac{\int \frac{\text{sech}(x) \left (a b+\left (2 a^2+b^2\right ) \text{sech}(x)\right )}{a+b \text{sech}(x)} \, dx}{2 b^2}\\ &=-\frac{a \tanh (x)}{b^2}+\frac{\text{sech}(x) \tanh (x)}{2 b}-\frac{a^3 \int \frac{\text{sech}(x)}{a+b \text{sech}(x)} \, dx}{b^3}+\frac{\left (2 a^2+b^2\right ) \int \text{sech}(x) \, dx}{2 b^3}\\ &=\frac{\left (2 a^2+b^2\right ) \tan ^{-1}(\sinh (x))}{2 b^3}-\frac{a \tanh (x)}{b^2}+\frac{\text{sech}(x) \tanh (x)}{2 b}-\frac{a^3 \int \frac{1}{1+\frac{a \cosh (x)}{b}} \, dx}{b^4}\\ &=\frac{\left (2 a^2+b^2\right ) \tan ^{-1}(\sinh (x))}{2 b^3}-\frac{a \tanh (x)}{b^2}+\frac{\text{sech}(x) \tanh (x)}{2 b}-\frac{\left (2 a^3\right ) \operatorname{Subst}\left (\int \frac{1}{1+\frac{a}{b}-\left (1-\frac{a}{b}\right ) x^2} \, dx,x,\tanh \left (\frac{x}{2}\right )\right )}{b^4}\\ &=\frac{\left (2 a^2+b^2\right ) \tan ^{-1}(\sinh (x))}{2 b^3}-\frac{2 a^3 \tan ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{\sqrt{a-b} b^3 \sqrt{a+b}}-\frac{a \tanh (x)}{b^2}+\frac{\text{sech}(x) \tanh (x)}{2 b}\\ \end{align*}

Mathematica [A]  time = 0.200481, size = 82, normalized size = 0.94 \[ \frac{\frac{4 a^3 \tan ^{-1}\left (\frac{(b-a) \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2-b^2}}\right )}{\sqrt{a^2-b^2}}+2 \left (2 a^2+b^2\right ) \tan ^{-1}\left (\tanh \left (\frac{x}{2}\right )\right )+b \tanh (x) (b \text{sech}(x)-2 a)}{2 b^3} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.021, size = 146, normalized size = 1.7 \begin{align*} -2\,{\frac{ \left ( \tanh \left ( x/2 \right ) \right ) ^{3}a}{{b}^{2} \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{2}}}-{\frac{1}{b} \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{3} \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) ^{-2}}-2\,{\frac{a\tanh \left ( x/2 \right ) }{{b}^{2} \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{2}}}+{\frac{1}{b}\tanh \left ({\frac{x}{2}} \right ) \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) ^{-2}}+2\,{\frac{\arctan \left ( \tanh \left ( x/2 \right ) \right ){a}^{2}}{{b}^{3}}}+{\frac{1}{b}\arctan \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) }-2\,{\frac{{a}^{3}}{{b}^{3}\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}\arctan \left ({\frac{ \left ( a-b \right ) \tanh \left ( x/2 \right ) }{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 3.54353, size = 3321, normalized size = 38.17 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

[(2*a^3*b - 2*a*b^3 + (a^2*b^2 - b^4)*cosh(x)^3 + (a^2*b^2 - b^4)*sinh(x)^3 + 2*(a^3*b - a*b^3)*cosh(x)^2 + (2
*a^3*b - 2*a*b^3 + 3*(a^2*b^2 - b^4)*cosh(x))*sinh(x)^2 - (a^3*cosh(x)^4 + 4*a^3*cosh(x)*sinh(x)^3 + a^3*sinh(
x)^4 + 2*a^3*cosh(x)^2 + a^3 + 2*(3*a^3*cosh(x)^2 + a^3)*sinh(x)^2 + 4*(a^3*cosh(x)^3 + a^3*cosh(x))*sinh(x))*
sqrt(-a^2 + b^2)*log((a^2*cosh(x)^2 + a^2*sinh(x)^2 + 2*a*b*cosh(x) - a^2 + 2*b^2 + 2*(a^2*cosh(x) + a*b)*sinh
(x) + 2*sqrt(-a^2 + b^2)*(a*cosh(x) + a*sinh(x) + b))/(a*cosh(x)^2 + a*sinh(x)^2 + 2*b*cosh(x) + 2*(a*cosh(x)
+ b)*sinh(x) + a)) + ((2*a^4 - a^2*b^2 - b^4)*cosh(x)^4 + 4*(2*a^4 - a^2*b^2 - b^4)*cosh(x)*sinh(x)^3 + (2*a^4
 - a^2*b^2 - b^4)*sinh(x)^4 + 2*a^4 - a^2*b^2 - b^4 + 2*(2*a^4 - a^2*b^2 - b^4)*cosh(x)^2 + 2*(2*a^4 - a^2*b^2
 - b^4 + 3*(2*a^4 - a^2*b^2 - b^4)*cosh(x)^2)*sinh(x)^2 + 4*((2*a^4 - a^2*b^2 - b^4)*cosh(x)^3 + (2*a^4 - a^2*
b^2 - b^4)*cosh(x))*sinh(x))*arctan(cosh(x) + sinh(x)) - (a^2*b^2 - b^4)*cosh(x) - (a^2*b^2 - b^4 - 3*(a^2*b^2
 - b^4)*cosh(x)^2 - 4*(a^3*b - a*b^3)*cosh(x))*sinh(x))/(a^2*b^3 - b^5 + (a^2*b^3 - b^5)*cosh(x)^4 + 4*(a^2*b^
3 - b^5)*cosh(x)*sinh(x)^3 + (a^2*b^3 - b^5)*sinh(x)^4 + 2*(a^2*b^3 - b^5)*cosh(x)^2 + 2*(a^2*b^3 - b^5 + 3*(a
^2*b^3 - b^5)*cosh(x)^2)*sinh(x)^2 + 4*((a^2*b^3 - b^5)*cosh(x)^3 + (a^2*b^3 - b^5)*cosh(x))*sinh(x)), (2*a^3*
b - 2*a*b^3 + (a^2*b^2 - b^4)*cosh(x)^3 + (a^2*b^2 - b^4)*sinh(x)^3 + 2*(a^3*b - a*b^3)*cosh(x)^2 + (2*a^3*b -
 2*a*b^3 + 3*(a^2*b^2 - b^4)*cosh(x))*sinh(x)^2 + 2*(a^3*cosh(x)^4 + 4*a^3*cosh(x)*sinh(x)^3 + a^3*sinh(x)^4 +
 2*a^3*cosh(x)^2 + a^3 + 2*(3*a^3*cosh(x)^2 + a^3)*sinh(x)^2 + 4*(a^3*cosh(x)^3 + a^3*cosh(x))*sinh(x))*sqrt(a
^2 - b^2)*arctan(-(a*cosh(x) + a*sinh(x) + b)/sqrt(a^2 - b^2)) + ((2*a^4 - a^2*b^2 - b^4)*cosh(x)^4 + 4*(2*a^4
 - a^2*b^2 - b^4)*cosh(x)*sinh(x)^3 + (2*a^4 - a^2*b^2 - b^4)*sinh(x)^4 + 2*a^4 - a^2*b^2 - b^4 + 2*(2*a^4 - a
^2*b^2 - b^4)*cosh(x)^2 + 2*(2*a^4 - a^2*b^2 - b^4 + 3*(2*a^4 - a^2*b^2 - b^4)*cosh(x)^2)*sinh(x)^2 + 4*((2*a^
4 - a^2*b^2 - b^4)*cosh(x)^3 + (2*a^4 - a^2*b^2 - b^4)*cosh(x))*sinh(x))*arctan(cosh(x) + sinh(x)) - (a^2*b^2
- b^4)*cosh(x) - (a^2*b^2 - b^4 - 3*(a^2*b^2 - b^4)*cosh(x)^2 - 4*(a^3*b - a*b^3)*cosh(x))*sinh(x))/(a^2*b^3 -
 b^5 + (a^2*b^3 - b^5)*cosh(x)^4 + 4*(a^2*b^3 - b^5)*cosh(x)*sinh(x)^3 + (a^2*b^3 - b^5)*sinh(x)^4 + 2*(a^2*b^
3 - b^5)*cosh(x)^2 + 2*(a^2*b^3 - b^5 + 3*(a^2*b^3 - b^5)*cosh(x)^2)*sinh(x)^2 + 4*((a^2*b^3 - b^5)*cosh(x)^3
+ (a^2*b^3 - b^5)*cosh(x))*sinh(x))]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\operatorname{sech}^{4}{\left (x \right )}}{a + b \operatorname{sech}{\left (x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.1367, size = 120, normalized size = 1.38 \begin{align*} -\frac{2 \, a^{3} \arctan \left (\frac{a e^{x} + b}{\sqrt{a^{2} - b^{2}}}\right )}{\sqrt{a^{2} - b^{2}} b^{3}} + \frac{{\left (2 \, a^{2} + b^{2}\right )} \arctan \left (e^{x}\right )}{b^{3}} + \frac{b e^{\left (3 \, x\right )} + 2 \, a e^{\left (2 \, x\right )} - b e^{x} + 2 \, a}{b^{2}{\left (e^{\left (2 \, x\right )} + 1\right )}^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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