3.6.72 \(\int \tanh (x) \, dx\) [572]

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

[Out]

ln(cosh(x))

________________________________________________________________________________________

Rubi [A]
time = 0.00, antiderivative size = 3, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3556} \begin {gather*} \log (\cosh (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tanh[x],x]

[Out]

Log[Cosh[x]]

Rule 3556

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.00, size = 3, normalized size = 1.00 \begin {gather*} \log (\cosh (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tanh[x],x]

[Out]

Log[Cosh[x]]

________________________________________________________________________________________

Maple [A]
time = 0.01, size = 4, normalized size = 1.33

method result size
lookup \(\ln \left (\cosh \left (x \right )\right )\) \(4\)
default \(\ln \left (\cosh \left (x \right )\right )\) \(4\)
risch \(-x +\ln \left (1+{\mathrm e}^{2 x}\right )\) \(12\)
derivativedivides \(-\frac {\ln \left (\tanh \left (x \right )-1\right )}{2}-\frac {\ln \left (\tanh \left (x \right )+1\right )}{2}\) \(16\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(x),x,method=_RETURNVERBOSE)

[Out]

ln(cosh(x))

________________________________________________________________________________________

Maxima [A]
time = 1.56, size = 3, normalized size = 1.00 \begin {gather*} \log \left (\cosh \left (x\right )\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(cosh(x))

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 18 vs. \(2 (3) = 6\).
time = 0.59, size = 18, normalized size = 6.00 \begin {gather*} -x + \log \left (\frac {2 \, \cosh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) \end {gather*}

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] Leaf count of result is larger than twice the leaf count of optimal. 7 vs. \(2 (3) = 6\).
time = 0.04, size = 7, normalized size = 2.33 \begin {gather*} x - \log {\left (\tanh {\left (x \right )} + 1 \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(x),x)

[Out]

x - log(tanh(x) + 1)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 11 vs. \(2 (3) = 6\).
time = 1.54, size = 11, normalized size = 3.67 \begin {gather*} -x + \log \left (e^{\left (2 \, x\right )} + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.02, size = 3, normalized size = 1.00 \begin {gather*} \ln \left (\mathrm {cosh}\left (x\right )\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(x),x)

[Out]

log(cosh(x))

________________________________________________________________________________________