3.572 \(\int \tanh (x) \, dx\)

Optimal. Leaf size=3 \[ \log (\cosh (x)) \]

[Out]

Log[Cosh[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.0034148, antiderivative size = 3, normalized size of antiderivative = 1., number of steps used = 1, number of rules used = 1, integrand size = 2, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.5, Rules used = {3475} \[ \log (\cosh (x)) \]

Antiderivative was successfully verified.

[In]

Int[Tanh[x],x]

[Out]

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]

Rubi steps

\begin{align*} \int \tanh (x) \, dx &=\log (\cosh (x))\\ \end{align*}

Mathematica [A]  time = 0.0019616, size = 3, normalized size = 1. \[ \log (\cosh (x)) \]

Antiderivative was successfully verified.

[In]

Integrate[Tanh[x],x]

[Out]

Log[Cosh[x]]

________________________________________________________________________________________

Maple [A]  time = 0.001, size = 4, normalized size = 1.3 \begin{align*} \ln \left ( \cosh \left ( x \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(x),x)

[Out]

ln(cosh(x))

________________________________________________________________________________________

Maxima [A]  time = 0.924554, size = 4, normalized size = 1.33 \begin{align*} \log \left (\cosh \left (x\right )\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(x),x, algorithm="maxima")

[Out]

log(cosh(x))

________________________________________________________________________________________

Fricas [B]  time = 2.0849, size = 55, normalized size = 18.33 \begin{align*} -x + \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(tanh(x),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [B]  time = 0.118635, size = 7, normalized size = 2.33 \begin{align*} x - \log{\left (\tanh{\left (x \right )} + 1 \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(x),x)

[Out]

x - log(tanh(x) + 1)

________________________________________________________________________________________

Giac [B]  time = 1.13741, size = 15, normalized size = 5. \begin{align*} -x + \log \left (e^{\left (2 \, x\right )} + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(x),x, algorithm="giac")

[Out]

-x + log(e^(2*x) + 1)