3.7.19 \(\int \frac {1}{a \text {sech}(x)+b \tanh (x)} \, dx\) [619]

Optimal. Leaf size=11 \[ \frac {\log (a+b \sinh (x))}{b} \]

[Out]

ln(a+b*sinh(x))/b

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 11, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {3238, 2747, 31} \begin {gather*} \frac {\log (a+b \sinh (x))}{b} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a*Sech[x] + b*Tanh[x])^(-1),x]

[Out]

Log[a + b*Sinh[x]]/b

Rule 31

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

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]

Rule 3238

Int[((a_.) + (b_.)*sec[(d_.) + (e_.)*(x_)] + (c_.)*tan[(d_.) + (e_.)*(x_)])^(-1), x_Symbol] :> Int[Cos[d + e*x
]/(b + a*Cos[d + e*x] + c*Sin[d + e*x]), x] /; FreeQ[{a, b, c, d, e}, x]

Rubi steps

\begin {align*} \int \frac {1}{a \text {sech}(x)+b \tanh (x)} \, dx &=\int \frac {\cosh (x)}{a+b \sinh (x)} \, dx\\ &=\frac {\text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \sinh (x)\right )}{b}\\ &=\frac {\log (a+b \sinh (x))}{b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 11, normalized size = 1.00 \begin {gather*} \frac {\log (a+b \sinh (x))}{b} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a*Sech[x] + b*Tanh[x])^(-1),x]

[Out]

Log[a + b*Sinh[x]]/b

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(49\) vs. \(2(11)=22\).
time = 0.99, size = 50, normalized size = 4.55

method result size
risch \(-\frac {x}{b}+\frac {\ln \left ({\mathrm e}^{2 x}+\frac {2 a \,{\mathrm e}^{x}}{b}-1\right )}{b}\) \(27\)
default \(-\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{b}+\frac {\ln \left (a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-2 b \tanh \left (\frac {x}{2}\right )-a \right )}{b}-\frac {\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{b}\) \(50\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a*sech(x)+b*tanh(x)),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 28 vs. \(2 (11) = 22\).
time = 0.26, size = 28, normalized size = 2.55 \begin {gather*} \frac {x}{b} + \frac {\log \left (-2 \, a e^{\left (-x\right )} + b e^{\left (-2 \, x\right )} - b\right )}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a*sech(x)+b*tanh(x)),x, algorithm="maxima")

[Out]

x/b + log(-2*a*e^(-x) + b*e^(-2*x) - b)/b

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 27 vs. \(2 (11) = 22\).
time = 0.36, size = 27, normalized size = 2.45 \begin {gather*} -\frac {x - \log \left (\frac {2 \, {\left (b \sinh \left (x\right ) + a\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right )}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a*sech(x)+b*tanh(x)),x, algorithm="fricas")

[Out]

-(x - log(2*(b*sinh(x) + a)/(cosh(x) - sinh(x))))/b

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 32 vs. \(2 (8) = 16\).
time = 0.24, size = 32, normalized size = 2.91 \begin {gather*} \begin {cases} \frac {x}{b} + \frac {\log {\left (\frac {a \operatorname {sech}{\left (x \right )}}{b} + \tanh {\left (x \right )} \right )}}{b} - \frac {\log {\left (\tanh {\left (x \right )} + 1 \right )}}{b} & \text {for}\: b \neq 0 \\\frac {\tanh {\left (x \right )}}{a \operatorname {sech}{\left (x \right )}} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a*sech(x)+b*tanh(x)),x)

[Out]

Piecewise((x/b + log(a*sech(x)/b + tanh(x))/b - log(tanh(x) + 1)/b, Ne(b, 0)), (tanh(x)/(a*sech(x)), True))

________________________________________________________________________________________

Giac [A]
time = 0.40, size = 22, normalized size = 2.00 \begin {gather*} \frac {\log \left ({\left | -b {\left (e^{\left (-x\right )} - e^{x}\right )} + 2 \, a \right |}\right )}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a*sech(x)+b*tanh(x)),x, algorithm="giac")

[Out]

log(abs(-b*(e^(-x) - e^x) + 2*a))/b

________________________________________________________________________________________

Mupad [B]
time = 0.08, size = 25, normalized size = 2.27 \begin {gather*} -\frac {x-\ln \left (2\,a\,{\mathrm {e}}^x-b+b\,{\mathrm {e}}^{2\,x}\right )}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-(x - log(2*a*exp(x) - b + b*exp(2*x)))/b

________________________________________________________________________________________