\(\int \frac {\tanh ^3(x)}{a+a \cosh (x)} \, dx\) [190]

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

Optimal result

Integrand size = 13, antiderivative size = 19 \[ \int \frac {\tanh ^3(x)}{a+a \cosh (x)} \, dx=-\frac {\text {sech}(x)}{a}+\frac {\text {sech}^2(x)}{2 a} \]

[Out]

-sech(x)/a+1/2*sech(x)^2/a

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {2785, 2686, 30, 8} \[ \int \frac {\tanh ^3(x)}{a+a \cosh (x)} \, dx=\frac {\text {sech}^2(x)}{2 a}-\frac {\text {sech}(x)}{a} \]

[In]

Int[Tanh[x]^3/(a + a*Cosh[x]),x]

[Out]

-(Sech[x]/a) + Sech[x]^2/(2*a)

Rule 8

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

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2686

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 2785

Int[((g_.)*tan[(e_.) + (f_.)*(x_)])^(p_.)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[1/a, Int[S
ec[e + f*x]^2*(g*Tan[e + f*x])^p, x], x] - Dist[1/(b*g), Int[Sec[e + f*x]*(g*Tan[e + f*x])^(p + 1), x], x] /;
FreeQ[{a, b, e, f, g, p}, x] && EqQ[a^2 - b^2, 0] && NeQ[p, -1]

Rubi steps \begin{align*} \text {integral}& = \frac {\int \text {sech}(x) \tanh (x) \, dx}{a}-\frac {\int \text {sech}^2(x) \tanh (x) \, dx}{a} \\ & = -\frac {\text {Subst}(\int 1 \, dx,x,\text {sech}(x))}{a}+\frac {\text {Subst}(\int x \, dx,x,\text {sech}(x))}{a} \\ & = -\frac {\text {sech}(x)}{a}+\frac {\text {sech}^2(x)}{2 a} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.89 \[ \int \frac {\tanh ^3(x)}{a+a \cosh (x)} \, dx=\frac {2 \text {sech}^2(x) \sinh ^4\left (\frac {x}{2}\right )}{a} \]

[In]

Integrate[Tanh[x]^3/(a + a*Cosh[x]),x]

[Out]

(2*Sech[x]^2*Sinh[x/2]^4)/a

Maple [A] (verified)

Time = 0.18 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.37

method result size
risch \(-\frac {2 \,{\mathrm e}^{x} \left ({\mathrm e}^{2 x}-{\mathrm e}^{x}+1\right )}{\left (1+{\mathrm e}^{2 x}\right )^{2} a}\) \(26\)
default \(\frac {\frac {2}{\left (1+\tanh \left (\frac {x}{2}\right )^{2}\right )^{2}}-\frac {4}{1+\tanh \left (\frac {x}{2}\right )^{2}}}{a}\) \(31\)

[In]

int(tanh(x)^3/(a+a*cosh(x)),x,method=_RETURNVERBOSE)

[Out]

-2*exp(x)*(exp(2*x)-exp(x)+1)/(1+exp(2*x))^2/a

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 66 vs. \(2 (17) = 34\).

Time = 0.24 (sec) , antiderivative size = 66, normalized size of antiderivative = 3.47 \[ \int \frac {\tanh ^3(x)}{a+a \cosh (x)} \, dx=-\frac {2 \, {\left (\cosh \left (x\right )^{2} + {\left (2 \, \cosh \left (x\right ) - 1\right )} \sinh \left (x\right ) + \sinh \left (x\right )^{2} - \cosh \left (x\right ) + 1\right )}}{a \cosh \left (x\right )^{3} + 3 \, a \cosh \left (x\right ) \sinh \left (x\right )^{2} + a \sinh \left (x\right )^{3} + 3 \, a \cosh \left (x\right ) + {\left (3 \, a \cosh \left (x\right )^{2} + a\right )} \sinh \left (x\right )} \]

[In]

integrate(tanh(x)^3/(a+a*cosh(x)),x, algorithm="fricas")

[Out]

-2*(cosh(x)^2 + (2*cosh(x) - 1)*sinh(x) + sinh(x)^2 - cosh(x) + 1)/(a*cosh(x)^3 + 3*a*cosh(x)*sinh(x)^2 + a*si
nh(x)^3 + 3*a*cosh(x) + (3*a*cosh(x)^2 + a)*sinh(x))

Sympy [F]

\[ \int \frac {\tanh ^3(x)}{a+a \cosh (x)} \, dx=\frac {\int \frac {\tanh ^{3}{\left (x \right )}}{\cosh {\left (x \right )} + 1}\, dx}{a} \]

[In]

integrate(tanh(x)**3/(a+a*cosh(x)),x)

[Out]

Integral(tanh(x)**3/(cosh(x) + 1), x)/a

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 70 vs. \(2 (17) = 34\).

Time = 0.19 (sec) , antiderivative size = 70, normalized size of antiderivative = 3.68 \[ \int \frac {\tanh ^3(x)}{a+a \cosh (x)} \, dx=-\frac {2 \, e^{\left (-x\right )}}{2 \, a e^{\left (-2 \, x\right )} + a e^{\left (-4 \, x\right )} + a} + \frac {2 \, e^{\left (-2 \, x\right )}}{2 \, a e^{\left (-2 \, x\right )} + a e^{\left (-4 \, x\right )} + a} - \frac {2 \, e^{\left (-3 \, x\right )}}{2 \, a e^{\left (-2 \, x\right )} + a e^{\left (-4 \, x\right )} + a} \]

[In]

integrate(tanh(x)^3/(a+a*cosh(x)),x, algorithm="maxima")

[Out]

-2*e^(-x)/(2*a*e^(-2*x) + a*e^(-4*x) + a) + 2*e^(-2*x)/(2*a*e^(-2*x) + a*e^(-4*x) + a) - 2*e^(-3*x)/(2*a*e^(-2
*x) + a*e^(-4*x) + a)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.16 \[ \int \frac {\tanh ^3(x)}{a+a \cosh (x)} \, dx=-\frac {2 \, {\left (e^{\left (-x\right )} + e^{x} - 1\right )}}{a {\left (e^{\left (-x\right )} + e^{x}\right )}^{2}} \]

[In]

integrate(tanh(x)^3/(a+a*cosh(x)),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 1.66 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.32 \[ \int \frac {\tanh ^3(x)}{a+a \cosh (x)} \, dx=-\frac {2\,{\mathrm {e}}^x\,\left ({\mathrm {e}}^{2\,x}-{\mathrm {e}}^x+1\right )}{a\,{\left ({\mathrm {e}}^{2\,x}+1\right )}^2} \]

[In]

int(tanh(x)^3/(a + a*cosh(x)),x)

[Out]

-(2*exp(x)*(exp(2*x) - exp(x) + 1))/(a*(exp(2*x) + 1)^2)