\(\int \tanh (2 x) \, dx\) [227]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 4, antiderivative size = 9 \[ \int \tanh (2 x) \, dx=\frac {1}{2} \log (\cosh (2 x)) \]

[Out]

1/2*ln(cosh(2*x))

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 9, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3556} \[ \int \tanh (2 x) \, dx=\frac {1}{2} \log (\cosh (2 x)) \]

[In]

Int[Tanh[2*x],x]

[Out]

Log[Cosh[2*x]]/2

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*} \text {integral}& = \frac {1}{2} \log (\cosh (2 x)) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 9, normalized size of antiderivative = 1.00 \[ \int \tanh (2 x) \, dx=\frac {1}{2} \log (\cosh (2 x)) \]

[In]

Integrate[Tanh[2*x],x]

[Out]

Log[Cosh[2*x]]/2

Maple [A] (verified)

Time = 0.06 (sec) , antiderivative size = 8, normalized size of antiderivative = 0.89

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

[In]

int(sinh(2*x)/cosh(2*x),x,method=_RETURNVERBOSE)

[Out]

1/2*ln(cosh(2*x))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 26 vs. \(2 (7) = 14\).

Time = 0.23 (sec) , antiderivative size = 26, normalized size of antiderivative = 2.89 \[ \int \tanh (2 x) \, dx=-x + \frac {1}{2} \, \log \left (\frac {2 \, \cosh \left (2 \, x\right )}{\cosh \left (2 \, x\right ) - \sinh \left (2 \, x\right )}\right ) \]

[In]

integrate(sinh(2*x)/cosh(2*x),x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.78 \[ \int \tanh (2 x) \, dx=\frac {\log {\left (\cosh {\left (2 x \right )} \right )}}{2} \]

[In]

integrate(sinh(2*x)/cosh(2*x),x)

[Out]

log(cosh(2*x))/2

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.78 \[ \int \tanh (2 x) \, dx=\frac {1}{2} \, \log \left (\cosh \left (2 \, x\right )\right ) \]

[In]

integrate(sinh(2*x)/cosh(2*x),x, algorithm="maxima")

[Out]

1/2*log(cosh(2*x))

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.44 \[ \int \tanh (2 x) \, dx=-x + \frac {1}{2} \, \log \left (e^{\left (4 \, x\right )} + 1\right ) \]

[In]

integrate(sinh(2*x)/cosh(2*x),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.78 \[ \int \tanh (2 x) \, dx=\frac {\ln \left (\mathrm {cosh}\left (2\,x\right )\right )}{2} \]

[In]

int(sinh(2*x)/cosh(2*x),x)

[Out]

log(cosh(2*x))/2