\(\int \frac {\text {sech}(x)}{(a+b \sinh (x))^2} \, dx\) [204]

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

Optimal result

Integrand size = 11, antiderivative size = 79 \[ \int \frac {\text {sech}(x)}{(a+b \sinh (x))^2} \, dx=\frac {\left (a^2-b^2\right ) \arctan (\sinh (x))}{\left (a^2+b^2\right )^2}-\frac {2 a b \log (\cosh (x))}{\left (a^2+b^2\right )^2}+\frac {2 a b \log (a+b \sinh (x))}{\left (a^2+b^2\right )^2}-\frac {b}{\left (a^2+b^2\right ) (a+b \sinh (x))} \] Output:

(a^2-b^2)*arctan(sinh(x))/(a^2+b^2)^2-2*a*b*ln(cosh(x))/(a^2+b^2)^2+2*a*b* 
ln(a+b*sinh(x))/(a^2+b^2)^2-b/(a^2+b^2)/(a+b*sinh(x))
 

Mathematica [A] (verified)

Time = 0.29 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.53 \[ \int \frac {\text {sech}(x)}{(a+b \sinh (x))^2} \, dx=-\frac {b \left (\left (2 a+\frac {-a^2+b^2}{\sqrt {-b^2}}\right ) \log \left (\sqrt {-b^2}-b \sinh (x)\right )-4 a \log (a+b \sinh (x))+\left (2 a+\frac {a^2-b^2}{\sqrt {-b^2}}\right ) \log \left (\sqrt {-b^2}+b \sinh (x)\right )+\frac {2 \left (a^2+b^2\right )}{a+b \sinh (x)}\right )}{2 \left (a^2+b^2\right )^2} \] Input:

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

Output:

-1/2*(b*((2*a + (-a^2 + b^2)/Sqrt[-b^2])*Log[Sqrt[-b^2] - b*Sinh[x]] - 4*a 
*Log[a + b*Sinh[x]] + (2*a + (a^2 - b^2)/Sqrt[-b^2])*Log[Sqrt[-b^2] + b*Si 
nh[x]] + (2*(a^2 + b^2))/(a + b*Sinh[x])))/(a^2 + b^2)^2
 

Rubi [A] (verified)

Time = 0.32 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.30, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.545, Rules used = {3042, 3147, 25, 480, 657, 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 \frac {\text {sech}(x)}{(a+b \sinh (x))^2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\cos (i x) (a-i b \sin (i x))^2}dx\)

\(\Big \downarrow \) 3147

\(\displaystyle -b \int -\frac {1}{(a+b \sinh (x))^2 \left (\sinh ^2(x) b^2+b^2\right )}d(b \sinh (x))\)

\(\Big \downarrow \) 25

\(\displaystyle b \int \frac {1}{(a+b \sinh (x))^2 \left (\sinh ^2(x) b^2+b^2\right )}d(b \sinh (x))\)

\(\Big \downarrow \) 480

\(\displaystyle -b \left (\frac {1}{\left (a^2+b^2\right ) (a+b \sinh (x))}-\frac {\int \frac {a-b \sinh (x)}{(a+b \sinh (x)) \left (\sinh ^2(x) b^2+b^2\right )}d(b \sinh (x))}{a^2+b^2}\right )\)

\(\Big \downarrow \) 657

\(\displaystyle -b \left (\frac {1}{\left (a^2+b^2\right ) (a+b \sinh (x))}-\frac {\int \left (\frac {2 a}{\left (a^2+b^2\right ) (a+b \sinh (x))}+\frac {a^2-2 b \sinh (x) a-b^2}{\left (a^2+b^2\right ) \left (\sinh ^2(x) b^2+b^2\right )}\right )d(b \sinh (x))}{a^2+b^2}\right )\)

\(\Big \downarrow \) 2009

\(\displaystyle -b \left (\frac {1}{\left (a^2+b^2\right ) (a+b \sinh (x))}-\frac {\frac {\left (a^2-b^2\right ) \arctan (\sinh (x))}{b \left (a^2+b^2\right )}-\frac {a \log \left (b^2 \sinh ^2(x)+b^2\right )}{a^2+b^2}+\frac {2 a \log (a+b \sinh (x))}{a^2+b^2}}{a^2+b^2}\right )\)

Input:

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

Output:

-(b*(-((((a^2 - b^2)*ArcTan[Sinh[x]])/(b*(a^2 + b^2)) + (2*a*Log[a + b*Sin 
h[x]])/(a^2 + b^2) - (a*Log[b^2 + b^2*Sinh[x]^2])/(a^2 + b^2))/(a^2 + b^2) 
) + 1/((a^2 + b^2)*(a + b*Sinh[x]))))
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 480
Int[((c_) + (d_.)*(x_))^(n_)/((a_) + (b_.)*(x_)^2), x_Symbol] :> Simp[d*((c 
 + d*x)^(n + 1)/((n + 1)*(b*c^2 + a*d^2))), x] + Simp[b/(b*c^2 + a*d^2)   I 
nt[(c + d*x)^(n + 1)*((c - d*x)/(a + b*x^2)), x], x] /; FreeQ[{a, b, c, d}, 
 x] && ILtQ[n, -1]
 

rule 657
Int[(((d_.) + (e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))^(n_.))/((a_) + (c_.)*( 
x_)^2), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*((f + g*x)^n/(a + c*x^ 
2)), x], x] /; FreeQ[{a, c, d, e, f, g, m}, x] && IntegersQ[n]
 

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 3147
Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m 
_.), x_Symbol] :> Simp[1/(b^p*f)   Subst[Int[(a + x)^m*(b^2 - x^2)^((p - 1) 
/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && IntegerQ[(p 
 - 1)/2] && NeQ[a^2 - b^2, 0]
 
Maple [A] (verified)

Time = 15.28 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.56

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

Input:

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

Output:

2*b/(a^2+b^2)^2*(-b*(a^2+b^2)/a*tanh(1/2*x)/(tanh(1/2*x)^2*a-2*b*tanh(1/2* 
x)-a)+a*ln(tanh(1/2*x)^2*a-2*b*tanh(1/2*x)-a))+2/(a^4+2*a^2*b^2+b^4)*(-a*b 
*ln(1+tanh(1/2*x)^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. 383 vs. \(2 (79) = 158\).

Time = 0.11 (sec) , antiderivative size = 383, normalized size of antiderivative = 4.85 \[ \int \frac {\text {sech}(x)}{(a+b \sinh (x))^2} \, dx=\frac {2 \, {\left ({\left (a^{2} b - b^{3} - {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{2} - {\left (a^{2} b - b^{3}\right )} \sinh \left (x\right )^{2} - 2 \, {\left (a^{3} - a b^{2}\right )} \cosh \left (x\right ) - 2 \, {\left (a^{3} - a b^{2} + {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) + {\left (a^{2} b + b^{3}\right )} \cosh \left (x\right ) - {\left (a b^{2} \cosh \left (x\right )^{2} + a b^{2} \sinh \left (x\right )^{2} + 2 \, a^{2} b \cosh \left (x\right ) - a b^{2} + 2 \, {\left (a b^{2} \cosh \left (x\right ) + a^{2} b\right )} \sinh \left (x\right )\right )} \log \left (\frac {2 \, {\left (b \sinh \left (x\right ) + a\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) + {\left (a b^{2} \cosh \left (x\right )^{2} + a b^{2} \sinh \left (x\right )^{2} + 2 \, a^{2} b \cosh \left (x\right ) - a b^{2} + 2 \, {\left (a b^{2} \cosh \left (x\right ) + a^{2} b\right )} \sinh \left (x\right )\right )} \log \left (\frac {2 \, \cosh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) + {\left (a^{2} b + b^{3}\right )} \sinh \left (x\right )\right )}}{a^{4} b + 2 \, a^{2} b^{3} + b^{5} - {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \cosh \left (x\right )^{2} - {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \sinh \left (x\right )^{2} - 2 \, {\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} \cosh \left (x\right ) - 2 \, {\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4} + {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )} \] Input:

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

Output:

2*((a^2*b - b^3 - (a^2*b - b^3)*cosh(x)^2 - (a^2*b - b^3)*sinh(x)^2 - 2*(a 
^3 - a*b^2)*cosh(x) - 2*(a^3 - a*b^2 + (a^2*b - b^3)*cosh(x))*sinh(x))*arc 
tan(cosh(x) + sinh(x)) + (a^2*b + b^3)*cosh(x) - (a*b^2*cosh(x)^2 + a*b^2* 
sinh(x)^2 + 2*a^2*b*cosh(x) - a*b^2 + 2*(a*b^2*cosh(x) + a^2*b)*sinh(x))*l 
og(2*(b*sinh(x) + a)/(cosh(x) - sinh(x))) + (a*b^2*cosh(x)^2 + a*b^2*sinh( 
x)^2 + 2*a^2*b*cosh(x) - a*b^2 + 2*(a*b^2*cosh(x) + a^2*b)*sinh(x))*log(2* 
cosh(x)/(cosh(x) - sinh(x))) + (a^2*b + b^3)*sinh(x))/(a^4*b + 2*a^2*b^3 + 
 b^5 - (a^4*b + 2*a^2*b^3 + b^5)*cosh(x)^2 - (a^4*b + 2*a^2*b^3 + b^5)*sin 
h(x)^2 - 2*(a^5 + 2*a^3*b^2 + a*b^4)*cosh(x) - 2*(a^5 + 2*a^3*b^2 + a*b^4 
+ (a^4*b + 2*a^2*b^3 + b^5)*cosh(x))*sinh(x))
 

Sympy [F]

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

integrate(sech(x)/(a+b*sinh(x))**2,x)
 

Output:

Integral(sech(x)/(a + b*sinh(x))**2, x)
 

Maxima [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.89 \[ \int \frac {\text {sech}(x)}{(a+b \sinh (x))^2} \, dx=\frac {2 \, a b \log \left (-2 \, a e^{\left (-x\right )} + b e^{\left (-2 \, x\right )} - b\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {2 \, a b \log \left (e^{\left (-2 \, x\right )} + 1\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {2 \, {\left (a^{2} - b^{2}\right )} \arctan \left (e^{\left (-x\right )}\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {2 \, b e^{\left (-x\right )}}{a^{2} b + b^{3} + 2 \, {\left (a^{3} + a b^{2}\right )} e^{\left (-x\right )} - {\left (a^{2} b + b^{3}\right )} e^{\left (-2 \, x\right )}} \] Input:

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

Output:

2*a*b*log(-2*a*e^(-x) + b*e^(-2*x) - b)/(a^4 + 2*a^2*b^2 + b^4) - 2*a*b*lo 
g(e^(-2*x) + 1)/(a^4 + 2*a^2*b^2 + b^4) - 2*(a^2 - b^2)*arctan(e^(-x))/(a^ 
4 + 2*a^2*b^2 + b^4) - 2*b*e^(-x)/(a^2*b + b^3 + 2*(a^3 + a*b^2)*e^(-x) - 
(a^2*b + b^3)*e^(-2*x))
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 186 vs. \(2 (79) = 158\).

Time = 0.13 (sec) , antiderivative size = 186, normalized size of antiderivative = 2.35 \[ \int \frac {\text {sech}(x)}{(a+b \sinh (x))^2} \, dx=\frac {2 \, a b^{2} \log \left ({\left | -b {\left (e^{\left (-x\right )} - e^{x}\right )} + 2 \, a \right |}\right )}{a^{4} b + 2 \, a^{2} b^{3} + b^{5}} - \frac {a b \log \left ({\left (e^{\left (-x\right )} - e^{x}\right )}^{2} + 4\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} + \frac {{\left (\pi + 2 \, \arctan \left (\frac {1}{2} \, {\left (e^{\left (2 \, x\right )} - 1\right )} e^{\left (-x\right )}\right )\right )} {\left (a^{2} - b^{2}\right )}}{2 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )}} - \frac {2 \, {\left (a b^{2} {\left (e^{\left (-x\right )} - e^{x}\right )} - 3 \, a^{2} b - b^{3}\right )}}{{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} {\left (b {\left (e^{\left (-x\right )} - e^{x}\right )} - 2 \, a\right )}} \] Input:

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

Output:

2*a*b^2*log(abs(-b*(e^(-x) - e^x) + 2*a))/(a^4*b + 2*a^2*b^3 + b^5) - a*b* 
log((e^(-x) - e^x)^2 + 4)/(a^4 + 2*a^2*b^2 + b^4) + 1/2*(pi + 2*arctan(1/2 
*(e^(2*x) - 1)*e^(-x)))*(a^2 - b^2)/(a^4 + 2*a^2*b^2 + b^4) - 2*(a*b^2*(e^ 
(-x) - e^x) - 3*a^2*b - b^3)/((a^4 + 2*a^2*b^2 + b^4)*(b*(e^(-x) - e^x) - 
2*a))
 

Mupad [B] (verification not implemented)

Time = 2.64 (sec) , antiderivative size = 186, normalized size of antiderivative = 2.35 \[ \int \frac {\text {sech}(x)}{(a+b \sinh (x))^2} \, dx=\frac {2\,a\,b\,\ln \left (b^5\,{\mathrm {e}}^{2\,x}-a^4\,b-b^5-14\,a^2\,b^3+2\,a^5\,{\mathrm {e}}^x+14\,a^2\,b^3\,{\mathrm {e}}^{2\,x}+2\,a\,b^4\,{\mathrm {e}}^x+a^4\,b\,{\mathrm {e}}^{2\,x}+28\,a^3\,b^2\,{\mathrm {e}}^x\right )}{a^4+2\,a^2\,b^2+b^4}-\frac {2\,b^2\,{\mathrm {e}}^x}{\left (a^2\,b+b^3\right )\,\left (2\,a\,{\mathrm {e}}^x-b+b\,{\mathrm {e}}^{2\,x}\right )}-\frac {\ln \left (1+{\mathrm {e}}^x\,1{}\mathrm {i}\right )}{-a^2\,1{}\mathrm {i}+2\,a\,b+b^2\,1{}\mathrm {i}}-\frac {\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{-a^2+a\,b\,2{}\mathrm {i}+b^2} \] Input:

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

Output:

(2*a*b*log(b^5*exp(2*x) - a^4*b - b^5 - 14*a^2*b^3 + 2*a^5*exp(x) + 14*a^2 
*b^3*exp(2*x) + 2*a*b^4*exp(x) + a^4*b*exp(2*x) + 28*a^3*b^2*exp(x)))/(a^4 
 + b^4 + 2*a^2*b^2) - (log(exp(x) + 1i)*1i)/(a*b*2i - a^2 + b^2) - (2*b^2* 
exp(x))/((a^2*b + b^3)*(2*a*exp(x) - b + b*exp(2*x))) - log(exp(x)*1i + 1) 
/(2*a*b - a^2*1i + b^2*1i)
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 336, normalized size of antiderivative = 4.25 \[ \int \frac {\text {sech}(x)}{(a+b \sinh (x))^2} \, dx=\frac {2 e^{2 x} \mathit {atan} \left (e^{x}\right ) a^{3} b -2 e^{2 x} \mathit {atan} \left (e^{x}\right ) a \,b^{3}+4 e^{x} \mathit {atan} \left (e^{x}\right ) a^{4}-4 e^{x} \mathit {atan} \left (e^{x}\right ) a^{2} b^{2}-2 \mathit {atan} \left (e^{x}\right ) a^{3} b +2 \mathit {atan} \left (e^{x}\right ) a \,b^{3}-2 e^{2 x} \mathrm {log}\left (e^{2 x}+1\right ) a^{2} b^{2}+2 e^{2 x} \mathrm {log}\left (e^{2 x} b +2 e^{x} a -b \right ) a^{2} b^{2}+e^{2 x} a^{2} b^{2}+e^{2 x} b^{4}-4 e^{x} \mathrm {log}\left (e^{2 x}+1\right ) a^{3} b +4 e^{x} \mathrm {log}\left (e^{2 x} b +2 e^{x} a -b \right ) a^{3} b +2 \,\mathrm {log}\left (e^{2 x}+1\right ) a^{2} b^{2}-2 \,\mathrm {log}\left (e^{2 x} b +2 e^{x} a -b \right ) a^{2} b^{2}-a^{2} b^{2}-b^{4}}{a \left (e^{2 x} a^{4} b +2 e^{2 x} a^{2} b^{3}+e^{2 x} b^{5}+2 e^{x} a^{5}+4 e^{x} a^{3} b^{2}+2 e^{x} a \,b^{4}-a^{4} b -2 a^{2} b^{3}-b^{5}\right )} \] Input:

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

Output:

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