3.618 \(\int (a \text {sech}(x)+b \tanh (x)) \, dx\)

Optimal. Leaf size=11 \[ a \tan ^{-1}(\sinh (x))+b \log (\cosh (x)) \]

[Out]

a*arctan(sinh(x))+b*ln(cosh(x))

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 11, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {3770, 3475} \[ a \tan ^{-1}(\sinh (x))+b \log (\cosh (x)) \]

Antiderivative was successfully verified.

[In]

Int[a*Sech[x] + b*Tanh[x],x]

[Out]

a*ArcTan[Sinh[x]] + b*Log[Cosh[x]]

Rule 3475

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

Rule 3770

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

Rubi steps

\begin {align*} \int (a \text {sech}(x)+b \tanh (x)) \, dx &=a \int \text {sech}(x) \, dx+b \int \tanh (x) \, dx\\ &=a \tan ^{-1}(\sinh (x))+b \log (\cosh (x))\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.00, size = 16, normalized size = 1.45 \[ 2 a \tan ^{-1}\left (\tanh \left (\frac {x}{2}\right )\right )+b \log (\cosh (x)) \]

Antiderivative was successfully verified.

[In]

Integrate[a*Sech[x] + b*Tanh[x],x]

[Out]

2*a*ArcTan[Tanh[x/2]] + b*Log[Cosh[x]]

________________________________________________________________________________________

fricas [B]  time = 0.44, size = 30, normalized size = 2.73 \[ -b x + 2 \, a \arctan \left (\cosh \relax (x) + \sinh \relax (x)\right ) + b \log \left (\frac {2 \, \cosh \relax (x)}{\cosh \relax (x) - \sinh \relax (x)}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.11, size = 21, normalized size = 1.91 \[ -b {\left (x - \log \left (e^{\left (2 \, x\right )} + 1\right )\right )} + 2 \, a \arctan \left (e^{x}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.02, size = 12, normalized size = 1.09 \[ a \arctan \left (\sinh \relax (x )\right )+b \ln \left (\cosh \relax (x )\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a*sech(x)+b*tanh(x),x)

[Out]

a*arctan(sinh(x))+b*ln(cosh(x))

________________________________________________________________________________________

maxima [A]  time = 0.32, size = 11, normalized size = 1.00 \[ a \arctan \left (\sinh \relax (x)\right ) + b \log \left (\cosh \relax (x)\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

a*arctan(sinh(x)) + b*log(cosh(x))

________________________________________________________________________________________

mupad [B]  time = 0.07, size = 40, normalized size = 3.64 \[ b\,\ln \left (4\,a^2\,{\mathrm {e}}^{2\,x}+4\,a^2\right )-b\,x+2\,\mathrm {atan}\left (\frac {a\,{\mathrm {e}}^x}{\sqrt {a^2}}\right )\,\sqrt {a^2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

b*log(4*a^2*exp(2*x) + 4*a^2) - b*x + 2*atan((a*exp(x))/(a^2)^(1/2))*(a^2)^(1/2)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a \operatorname {sech}{\relax (x )} + b \tanh {\relax (x )}\right )\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Integral(a*sech(x) + b*tanh(x), x)

________________________________________________________________________________________