\(\int \frac {\tanh ^3(x)}{a+a \text {sech}(x)} \, dx\) [106]

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

Optimal result

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

[Out]

ln(cosh(x))/a+sech(x)/a

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3964, 45} \[ \int \frac {\tanh ^3(x)}{a+a \text {sech}(x)} \, dx=\frac {\text {sech}(x)}{a}+\frac {\log (\cosh (x))}{a} \]

[In]

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

[Out]

Log[Cosh[x]]/a + Sech[x]/a

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3964

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_.), x_Symbol] :> Dist[1/(a^(m - n
- 1)*b^n*d), Subst[Int[(a - b*x)^((m - 1)/2)*((a + b*x)^((m - 1)/2 + n)/x^(m + n)), x], x, Sin[c + d*x]], x] /
; FreeQ[{a, b, c, d}, x] && IntegerQ[(m - 1)/2] && EqQ[a^2 - b^2, 0] && IntegerQ[n]

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

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.71 \[ \int \frac {\tanh ^3(x)}{a+a \text {sech}(x)} \, dx=\frac {\log (\cosh (x))+\text {sech}(x)}{a} \]

[In]

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

[Out]

(Log[Cosh[x]] + Sech[x])/a

Maple [B] (verified)

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

Time = 0.23 (sec) , antiderivative size = 34, normalized size of antiderivative = 2.43

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

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

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

Time = 0.25 (sec) , antiderivative size = 85, normalized size of antiderivative = 6.07 \[ \int \frac {\tanh ^3(x)}{a+a \text {sech}(x)} \, dx=-\frac {x \cosh \left (x\right )^{2} + x \sinh \left (x\right )^{2} - {\left (\cosh \left (x\right )^{2} + 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2} + 1\right )} \log \left (\frac {2 \, \cosh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) + 2 \, {\left (x \cosh \left (x\right ) - 1\right )} \sinh \left (x\right ) + x - 2 \, \cosh \left (x\right )}{a \cosh \left (x\right )^{2} + 2 \, a \cosh \left (x\right ) \sinh \left (x\right ) + a \sinh \left (x\right )^{2} + a} \]

[In]

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

[Out]

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

Sympy [F]

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

[In]

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

[Out]

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

Maxima [B] (verification not implemented)

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

Time = 0.27 (sec) , antiderivative size = 33, normalized size of antiderivative = 2.36 \[ \int \frac {\tanh ^3(x)}{a+a \text {sech}(x)} \, dx=\frac {x}{a} + \frac {2 \, e^{\left (-x\right )}}{a e^{\left (-2 \, x\right )} + a} + \frac {\log \left (e^{\left (-2 \, x\right )} + 1\right )}{a} \]

[In]

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

[Out]

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

Giac [B] (verification not implemented)

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

Time = 0.29 (sec) , antiderivative size = 35, normalized size of antiderivative = 2.50 \[ \int \frac {\tanh ^3(x)}{a+a \text {sech}(x)} \, dx=\frac {\log \left (e^{\left (-x\right )} + e^{x}\right )}{a} - \frac {e^{\left (-x\right )} + e^{x} - 2}{a {\left (e^{\left (-x\right )} + e^{x}\right )}} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 2.10 (sec) , antiderivative size = 33, normalized size of antiderivative = 2.36 \[ \int \frac {\tanh ^3(x)}{a+a \text {sech}(x)} \, dx=\frac {\ln \left ({\mathrm {e}}^{2\,x}+1\right )}{a}-\frac {x}{a}+\frac {2\,{\mathrm {e}}^x}{a\,\left ({\mathrm {e}}^{2\,x}+1\right )} \]

[In]

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

[Out]

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