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

Optimal. Leaf size=79 \[ \frac {\left (a^2-b^2\right ) \text {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))} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 79, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.546, Rules used = {2747, 724, 815, 649, 209, 266} \begin {gather*} \frac {\left (a^2-b^2\right ) \text {ArcTan}(\sinh (x))}{\left (a^2+b^2\right )^2}-\frac {b}{\left (a^2+b^2\right ) (a+b \sinh (x))}+\frac {2 a b \log (a+b \sinh (x))}{\left (a^2+b^2\right )^2}-\frac {2 a b \log (\cosh (x))}{\left (a^2+b^2\right )^2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 209

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

Rule 266

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 649

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[(-a)*c]

Rule 724

Int[((d_) + (e_.)*(x_))^(m_)/((a_) + (c_.)*(x_)^2), x_Symbol] :> Simp[e*((d + e*x)^(m + 1)/((m + 1)*(c*d^2 + a
*e^2))), x] + Dist[c/(c*d^2 + a*e^2), Int[(d + e*x)^(m + 1)*((d - e*x)/(a + c*x^2)), x], x] /; FreeQ[{a, c, d,
 e, m}, x] && NeQ[c*d^2 + a*e^2, 0] && LtQ[m, -1]

Rule 815

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

Rule 2747

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[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] && Integer
Q[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps

\begin {align*} \int \frac {\text {sech}(x)}{(a+b \sinh (x))^2} \, dx &=-\left (b \text {Subst}\left (\int \frac {1}{(a+x)^2 \left (-b^2-x^2\right )} \, dx,x,b \sinh (x)\right )\right )\\ &=-\frac {b}{\left (a^2+b^2\right ) (a+b \sinh (x))}-\frac {b \text {Subst}\left (\int \frac {a-x}{(a+x) \left (-b^2-x^2\right )} \, dx,x,b \sinh (x)\right )}{a^2+b^2}\\ &=-\frac {b}{\left (a^2+b^2\right ) (a+b \sinh (x))}-\frac {b \text {Subst}\left (\int \left (-\frac {2 a}{\left (a^2+b^2\right ) (a+x)}+\frac {-a^2+b^2+2 a x}{\left (a^2+b^2\right ) \left (b^2+x^2\right )}\right ) \, dx,x,b \sinh (x)\right )}{a^2+b^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))}-\frac {b \text {Subst}\left (\int \frac {-a^2+b^2+2 a x}{b^2+x^2} \, dx,x,b \sinh (x)\right )}{\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))}-\frac {(2 a b) \text {Subst}\left (\int \frac {x}{b^2+x^2} \, dx,x,b \sinh (x)\right )}{\left (a^2+b^2\right )^2}+\frac {\left (b \left (a^2-b^2\right )\right ) \text {Subst}\left (\int \frac {1}{b^2+x^2} \, dx,x,b \sinh (x)\right )}{\left (a^2+b^2\right )^2}\\ &=\frac {\left (a^2-b^2\right ) \tan ^{-1}(\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))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.32, size = 121, normalized size = 1.53 \begin {gather*} -\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} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-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*Sinh[x]] + (2*(a^2 + b^2))/(a + b*Sinh[x])))/(a^2 + b^2)^2

________________________________________________________________________________________

Maple [A]
time = 0.64, size = 123, normalized size = 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 (a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-2 b \tanh \left (\frac {x}{2}\right )-a \right )}+a \ln \left (a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-2 b \tanh \left (\frac {x}{2}\right )-a \right )\right )}{\left (a^{2}+b^{2}\right )^{2}}+\frac {-2 a b \ln \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\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 a \,{\mathrm e}^{x}-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\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.49, size = 149, normalized size = 1.89 \begin {gather*} \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 )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 383 vs. \(2 (79) = 158\).
time = 0.39, size = 383, normalized size = 4.85 \begin {gather*} \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 )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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))*arctan(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))*log(2*(b*sinh(x) + a)/(cosh(x) - si
nh(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))*lo
g(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)*sinh(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]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\operatorname {sech}{\left (x \right )}}{\left (a + b \sinh {\left (x \right )}\right )^{2}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 186 vs. \(2 (79) = 158\).
time = 0.41, size = 186, normalized size = 2.35 \begin {gather*} \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 )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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]
time = 1.79, size = 186, normalized size = 2.35 \begin {gather*} \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} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________