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*Log[Cosh[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.0099126, antiderivative size = 11, normalized size of antiderivative = 1., 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 3770

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

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], 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.0040934, 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]]

________________________________________________________________________________________

Maple [A]  time = 0.003, size = 12, normalized size = 1.1 \begin{align*} a\arctan \left ( \sinh \left ( x \right ) \right ) +b\ln \left ( \cosh \left ( x \right ) \right ) \end{align*}

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 = 1.0436, size = 15, normalized size = 1.36 \begin{align*} a \arctan \left (\sinh \left (x\right )\right ) + b \log \left (\cosh \left (x\right )\right ) \end{align*}

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

________________________________________________________________________________________

Fricas [B]  time = 2.41303, size = 104, normalized size = 9.45 \begin{align*} -b x + 2 \, a \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) + b \log \left (\frac{2 \, \cosh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) \end{align*}

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

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a \operatorname{sech}{\left (x \right )} + b \tanh{\left (x \right )}\right )\, dx \end{align*}

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)

________________________________________________________________________________________

Giac [A]  time = 1.1132, size = 28, normalized size = 2.55 \begin{align*} -b{\left (x - \log \left (e^{\left (2 \, x\right )} + 1\right )\right )} + 2 \, a \arctan \left (e^{x}\right ) \end{align*}

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)