3.6 \(\int \tanh (a+b x) \, dx\)

Optimal. Leaf size=11 \[ \frac{\log (\cosh (a+b x))}{b} \]

[Out]

Log[Cosh[a + b*x]]/b

________________________________________________________________________________________

Rubi [A]  time = 0.0057195, antiderivative size = 11, normalized size of antiderivative = 1., number of steps used = 1, number of rules used = 1, integrand size = 6, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {3475} \[ \frac{\log (\cosh (a+b x))}{b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

Log[Cosh[a + b*x]]/b

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 (a+b x) \, dx &=\frac{\log (\cosh (a+b x))}{b}\\ \end{align*}

Mathematica [A]  time = 0.0052227, size = 11, normalized size = 1. \[ \frac{\log (\cosh (a+b x))}{b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

Log[Cosh[a + b*x]]/b

________________________________________________________________________________________

Maple [B]  time = 0.003, size = 30, normalized size = 2.7 \begin{align*} -{\frac{\ln \left ( -1+\tanh \left ( bx+a \right ) \right ) }{2\,b}}-{\frac{\ln \left ( 1+\tanh \left ( bx+a \right ) \right ) }{2\,b}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2/b*ln(-1+tanh(b*x+a))-1/2*ln(1+tanh(b*x+a))/b

________________________________________________________________________________________

Maxima [A]  time = 1.0177, size = 15, normalized size = 1.36 \begin{align*} \frac{\log \left (\cosh \left (b x + a\right )\right )}{b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(cosh(b*x + a))/b

________________________________________________________________________________________

Fricas [B]  time = 2.19036, size = 88, normalized size = 8. \begin{align*} -\frac{b x - \log \left (\frac{2 \, \cosh \left (b x + a\right )}{\cosh \left (b x + a\right ) - \sinh \left (b x + a\right )}\right )}{b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.151378, size = 17, normalized size = 1.55 \begin{align*} \begin{cases} x - \frac{\log{\left (\tanh{\left (a + b x \right )} + 1 \right )}}{b} & \text{for}\: b \neq 0 \\x \tanh{\left (a \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Piecewise((x - log(tanh(a + b*x) + 1)/b, Ne(b, 0)), (x*tanh(a), True))

________________________________________________________________________________________

Giac [B]  time = 1.22161, size = 36, normalized size = 3.27 \begin{align*} -\frac{b x + a}{b} + \frac{\log \left (e^{\left (2 \, b x + 2 \, a\right )} + 1\right )}{b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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