3.119 \(\int \frac {\tanh (x)}{1+\tanh (x)} \, dx\)

Optimal. Leaf size=16 \[ \frac {x}{2}+\frac {1}{2 (\tanh (x)+1)} \]

[Out]

1/2*x+1/2/(1+tanh(x))

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {3526, 8} \[ \frac {x}{2}+\frac {1}{2 (\tanh (x)+1)} \]

Antiderivative was successfully verified.

[In]

Int[Tanh[x]/(1 + Tanh[x]),x]

[Out]

x/2 + 1/(2*(1 + Tanh[x]))

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3526

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[((
b*c - a*d)*(a + b*Tan[e + f*x])^m)/(2*a*f*m), x] + Dist[(b*c + a*d)/(2*a*b), Int[(a + b*Tan[e + f*x])^(m + 1),
 x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && LtQ[m, 0]

Rubi steps

\begin {align*} \int \frac {\tanh (x)}{1+\tanh (x)} \, dx &=\frac {1}{2 (1+\tanh (x))}+\frac {\int 1 \, dx}{2}\\ &=\frac {x}{2}+\frac {1}{2 (1+\tanh (x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 18, normalized size = 1.12 \[ \frac {1}{4} (2 x-\sinh (2 x)+\cosh (2 x)) \]

Antiderivative was successfully verified.

[In]

Integrate[Tanh[x]/(1 + Tanh[x]),x]

[Out]

(2*x + Cosh[2*x] - Sinh[2*x])/4

________________________________________________________________________________________

fricas [B]  time = 0.65, size = 26, normalized size = 1.62 \[ \frac {{\left (2 \, x + 1\right )} \cosh \relax (x) + {\left (2 \, x - 1\right )} \sinh \relax (x)}{4 \, {\left (\cosh \relax (x) + \sinh \relax (x)\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(x)/(1+tanh(x)),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.11, size = 10, normalized size = 0.62 \[ \frac {1}{2} \, x + \frac {1}{4} \, e^{\left (-2 \, x\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(x)/(1+tanh(x)),x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.05, size = 24, normalized size = 1.50 \[ -\frac {\ln \left (\tanh \relax (x )-1\right )}{4}+\frac {1}{2+2 \tanh \relax (x )}+\frac {\ln \left (1+\tanh \relax (x )\right )}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(x)/(1+tanh(x)),x)

[Out]

-1/4*ln(tanh(x)-1)+1/2/(1+tanh(x))+1/4*ln(1+tanh(x))

________________________________________________________________________________________

maxima [A]  time = 0.30, size = 10, normalized size = 0.62 \[ \frac {1}{2} \, x + \frac {1}{4} \, e^{\left (-2 \, x\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(x)/(1+tanh(x)),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.07, size = 10, normalized size = 0.62 \[ \frac {x}{2}+\frac {{\mathrm {e}}^{-2\,x}}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(x)/(tanh(x) + 1),x)

[Out]

x/2 + exp(-2*x)/4

________________________________________________________________________________________

sympy [B]  time = 0.29, size = 27, normalized size = 1.69 \[ \frac {x \tanh {\relax (x )}}{2 \tanh {\relax (x )} + 2} + \frac {x}{2 \tanh {\relax (x )} + 2} + \frac {1}{2 \tanh {\relax (x )} + 2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(x)/(1+tanh(x)),x)

[Out]

x*tanh(x)/(2*tanh(x) + 2) + x/(2*tanh(x) + 2) + 1/(2*tanh(x) + 2)

________________________________________________________________________________________