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

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

Optimal result

Integrand size = 13, antiderivative size = 87 \[ \int \frac {\text {sech}^4(x)}{a+b \text {sech}(x)} \, dx=\frac {\left (2 a^2+b^2\right ) \arctan (\sinh (x))}{2 b^3}-\frac {2 a^3 \arctan \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} \] Output:

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

Mathematica [A] (verified)

Time = 0.18 (sec) , antiderivative size = 82, normalized size of antiderivative = 0.94 \[ \int \frac {\text {sech}^4(x)}{a+b \text {sech}(x)} \, dx=\frac {2 \left (2 a^2+b^2\right ) \arctan \left (\tanh \left (\frac {x}{2}\right )\right )+\frac {4 a^3 \arctan \left (\frac {(-a+b) \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}+b (-2 a+b \text {sech}(x)) \tanh (x)}{2 b^3} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.80 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.11, number of steps used = 13, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.923, Rules used = {3042, 4338, 3042, 4570, 3042, 4486, 3042, 4257, 4318, 3042, 3138, 218}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4338

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4570

\(\displaystyle \frac {\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}{b}-\frac {2 a \tanh (x)}{b}}{2 b}+\frac {\tanh (x) \text {sech}(x)}{2 b}\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4486

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4257

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

\(\Big \downarrow \) 4318

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3138

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

\(\Big \downarrow \) 218

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

Input:

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

Output:

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

Defintions of rubi rules used

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

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

rule 3138
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{ 
e = FreeFactors[Tan[(c + d*x)/2], x]}, Simp[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 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 

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

rule 4338
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] + Simp[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] && Gt 
Q[n, 3]
 

rule 4486
Int[(csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)))/(csc[( 
e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[B/b   Int[Csc[e + f*x], 
 x], x] + Simp[(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 4570
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_S 
ymbol] :> Simp[(-C)*Cot[e + f*x]*((a + b*Csc[e + f*x])^(m + 1)/(b*f*(m + 2) 
)), x] + Simp[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]
 
Maple [A] (verified)

Time = 0.54 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.25

method result size
default \(-\frac {2 a^{3} \arctan \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b^{3} \sqrt {\left (a -b \right ) \left (a +b \right )}}+\frac {\frac {2 \left (\left (-a b -\frac {1}{2} b^{2}\right ) \tanh \left (\frac {x}{2}\right )^{3}+\left (-a b +\frac {1}{2} b^{2}\right ) \tanh \left (\frac {x}{2}\right )\right )}{\left (\tanh \left (\frac {x}{2}\right )^{2}+1\right )^{2}}+\left (2 a^{2}+b^{2}\right ) \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{b^{3}}\) \(109\)
risch \(\frac {b \,{\mathrm e}^{3 x}+2 \,{\mathrm e}^{2 x} a -b \,{\mathrm e}^{x}+2 a}{\left ({\mathrm e}^{2 x}+1\right )^{2} b^{2}}-\frac {a^{3} \ln \left ({\mathrm e}^{x}+\frac {b \sqrt {-a^{2}+b^{2}}+a^{2}-b^{2}}{\sqrt {-a^{2}+b^{2}}\, a}\right )}{\sqrt {-a^{2}+b^{2}}\, b^{3}}+\frac {a^{3} \ln \left ({\mathrm e}^{x}+\frac {b \sqrt {-a^{2}+b^{2}}-a^{2}+b^{2}}{\sqrt {-a^{2}+b^{2}}\, a}\right )}{\sqrt {-a^{2}+b^{2}}\, b^{3}}+\frac {i \ln \left ({\mathrm e}^{x}+i\right ) a^{2}}{b^{3}}+\frac {i \ln \left ({\mathrm e}^{x}+i\right )}{2 b}-\frac {i \ln \left ({\mathrm e}^{x}-i\right ) a^{2}}{b^{3}}-\frac {i \ln \left ({\mathrm e}^{x}-i\right )}{2 b}\) \(209\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 682 vs. \(2 (73) = 146\).

Time = 0.16 (sec) , antiderivative size = 1444, normalized size of antiderivative = 16.60 \[ \int \frac {\text {sech}^4(x)}{a+b \text {sech}(x)} \, dx=\text {Too large to display} \] Input:

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

Output:

[(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)*c 
osh(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)*c 
osh(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...
 

Sympy [F]

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

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

Output:

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

Maxima [F(-2)]

Exception generated. \[ \int \frac {\text {sech}^4(x)}{a+b \text {sech}(x)} \, dx=\text {Exception raised: ValueError} \] Input:

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

Output:

Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?` f 
or more de
 

Giac [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.02 \[ \int \frac {\text {sech}^4(x)}{a+b \text {sech}(x)} \, dx=-\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}} \] Input:

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

Output:

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

Mupad [B] (verification not implemented)

Time = 5.56 (sec) , antiderivative size = 476, normalized size of antiderivative = 5.47 \[ \int \frac {\text {sech}^4(x)}{a+b \text {sech}(x)} \, dx=\frac {{\mathrm {e}}^x}{b+b\,{\mathrm {e}}^{2\,x}}-\frac {2\,{\mathrm {e}}^x}{b+2\,b\,{\mathrm {e}}^{2\,x}+b\,{\mathrm {e}}^{4\,x}}+\frac {2\,a}{b^2\,{\mathrm {e}}^{2\,x}+b^2}-\frac {\ln \left (1+{\mathrm {e}}^x\,1{}\mathrm {i}\right )\,1{}\mathrm {i}-\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2\,b}-\frac {a^2\,\left (\ln \left (1+{\mathrm {e}}^x\,1{}\mathrm {i}\right )\,1{}\mathrm {i}-\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )\,1{}\mathrm {i}\right )}{b^3}-\frac {a^3\,\ln \left (16\,a\,b^5-48\,a^5\,b-24\,a^5\,\sqrt {b^2-a^2}+32\,a^3\,b^3+24\,a^6\,{\mathrm {e}}^x+32\,b^6\,{\mathrm {e}}^x+16\,a\,b^4\,\sqrt {b^2-a^2}+40\,a^3\,b^2\,\sqrt {b^2-a^2}+32\,b^5\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}+56\,a^2\,b^4\,{\mathrm {e}}^x-112\,a^4\,b^2\,{\mathrm {e}}^x+72\,a^2\,b^3\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}-72\,a^4\,b\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}\right )}{b^3\,\sqrt {b^2-a^2}}+\frac {a^3\,\ln \left (16\,a\,b^5-48\,a^5\,b+24\,a^5\,\sqrt {b^2-a^2}+32\,a^3\,b^3+24\,a^6\,{\mathrm {e}}^x+32\,b^6\,{\mathrm {e}}^x-16\,a\,b^4\,\sqrt {b^2-a^2}-40\,a^3\,b^2\,\sqrt {b^2-a^2}-32\,b^5\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}+56\,a^2\,b^4\,{\mathrm {e}}^x-112\,a^4\,b^2\,{\mathrm {e}}^x-72\,a^2\,b^3\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}+72\,a^4\,b\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}\right )}{b^3\,\sqrt {b^2-a^2}} \] Input:

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

Output:

exp(x)/(b + b*exp(2*x)) - (2*exp(x))/(b + 2*b*exp(2*x) + b*exp(4*x)) + (2* 
a)/(b^2*exp(2*x) + b^2) - (log(exp(x)*1i + 1)*1i - log(exp(x) + 1i)*1i)/(2 
*b) - (a^2*(log(exp(x)*1i + 1)*1i - log(exp(x) + 1i)*1i))/b^3 - (a^3*log(1 
6*a*b^5 - 48*a^5*b - 24*a^5*(b^2 - a^2)^(1/2) + 32*a^3*b^3 + 24*a^6*exp(x) 
 + 32*b^6*exp(x) + 16*a*b^4*(b^2 - a^2)^(1/2) + 40*a^3*b^2*(b^2 - a^2)^(1/ 
2) + 32*b^5*exp(x)*(b^2 - a^2)^(1/2) + 56*a^2*b^4*exp(x) - 112*a^4*b^2*exp 
(x) + 72*a^2*b^3*exp(x)*(b^2 - a^2)^(1/2) - 72*a^4*b*exp(x)*(b^2 - a^2)^(1 
/2)))/(b^3*(b^2 - a^2)^(1/2)) + (a^3*log(16*a*b^5 - 48*a^5*b + 24*a^5*(b^2 
 - a^2)^(1/2) + 32*a^3*b^3 + 24*a^6*exp(x) + 32*b^6*exp(x) - 16*a*b^4*(b^2 
 - a^2)^(1/2) - 40*a^3*b^2*(b^2 - a^2)^(1/2) - 32*b^5*exp(x)*(b^2 - a^2)^( 
1/2) + 56*a^2*b^4*exp(x) - 112*a^4*b^2*exp(x) - 72*a^2*b^3*exp(x)*(b^2 - a 
^2)^(1/2) + 72*a^4*b*exp(x)*(b^2 - a^2)^(1/2)))/(b^3*(b^2 - a^2)^(1/2))
 

Reduce [B] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 365, normalized size of antiderivative = 4.20 \[ \int \frac {\text {sech}^4(x)}{a+b \text {sech}(x)} \, dx=\frac {2 e^{4 x} \mathit {atan} \left (e^{x}\right ) a^{4}-e^{4 x} \mathit {atan} \left (e^{x}\right ) a^{2} b^{2}-e^{4 x} \mathit {atan} \left (e^{x}\right ) b^{4}+4 e^{2 x} \mathit {atan} \left (e^{x}\right ) a^{4}-2 e^{2 x} \mathit {atan} \left (e^{x}\right ) a^{2} b^{2}-2 e^{2 x} \mathit {atan} \left (e^{x}\right ) b^{4}+2 \mathit {atan} \left (e^{x}\right ) a^{4}-\mathit {atan} \left (e^{x}\right ) a^{2} b^{2}-\mathit {atan} \left (e^{x}\right ) b^{4}-2 e^{4 x} \sqrt {a^{2}-b^{2}}\, \mathit {atan} \left (\frac {e^{x} a +b}{\sqrt {a^{2}-b^{2}}}\right ) a^{3}-4 e^{2 x} \sqrt {a^{2}-b^{2}}\, \mathit {atan} \left (\frac {e^{x} a +b}{\sqrt {a^{2}-b^{2}}}\right ) a^{3}-2 \sqrt {a^{2}-b^{2}}\, \mathit {atan} \left (\frac {e^{x} a +b}{\sqrt {a^{2}-b^{2}}}\right ) a^{3}-e^{4 x} a^{3} b +e^{4 x} a \,b^{3}+e^{3 x} a^{2} b^{2}-e^{3 x} b^{4}-e^{x} a^{2} b^{2}+e^{x} b^{4}+a^{3} b -a \,b^{3}}{b^{3} \left (e^{4 x} a^{2}-e^{4 x} b^{2}+2 e^{2 x} a^{2}-2 e^{2 x} b^{2}+a^{2}-b^{2}\right )} \] Input:

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

Output:

(2*e**(4*x)*atan(e**x)*a**4 - e**(4*x)*atan(e**x)*a**2*b**2 - e**(4*x)*ata 
n(e**x)*b**4 + 4*e**(2*x)*atan(e**x)*a**4 - 2*e**(2*x)*atan(e**x)*a**2*b** 
2 - 2*e**(2*x)*atan(e**x)*b**4 + 2*atan(e**x)*a**4 - atan(e**x)*a**2*b**2 
- atan(e**x)*b**4 - 2*e**(4*x)*sqrt(a**2 - b**2)*atan((e**x*a + b)/sqrt(a* 
*2 - b**2))*a**3 - 4*e**(2*x)*sqrt(a**2 - b**2)*atan((e**x*a + b)/sqrt(a** 
2 - b**2))*a**3 - 2*sqrt(a**2 - b**2)*atan((e**x*a + b)/sqrt(a**2 - b**2)) 
*a**3 - e**(4*x)*a**3*b + e**(4*x)*a*b**3 + e**(3*x)*a**2*b**2 - e**(3*x)* 
b**4 - e**x*a**2*b**2 + e**x*b**4 + a**3*b - a*b**3)/(b**3*(e**(4*x)*a**2 
- e**(4*x)*b**2 + 2*e**(2*x)*a**2 - 2*e**(2*x)*b**2 + a**2 - b**2))