\(\int \frac {\tanh ^3(x)}{i+\sinh (x)} \, dx\) [209]

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

Optimal result

Integrand size = 13, antiderivative size = 36 \[ \int \frac {\tanh ^3(x)}{i+\sinh (x)} \, dx=\frac {3}{8} \arctan (\sinh (x))-\frac {3}{8} \text {sech}(x) \tanh (x)-\frac {1}{4} \text {sech}(x) \tanh ^3(x)-\frac {1}{4} i \tanh ^4(x) \]

[Out]

3/8*arctan(sinh(x))-3/8*sech(x)*tanh(x)-1/4*sech(x)*tanh(x)^3-1/4*I*tanh(x)^4

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {2785, 2687, 30, 2691, 3855} \[ \int \frac {\tanh ^3(x)}{i+\sinh (x)} \, dx=\frac {3}{8} \arctan (\sinh (x))-\frac {1}{4} i \tanh ^4(x)-\frac {1}{4} \tanh ^3(x) \text {sech}(x)-\frac {3}{8} \tanh (x) \text {sech}(x) \]

[In]

Int[Tanh[x]^3/(I + Sinh[x]),x]

[Out]

(3*ArcTan[Sinh[x]])/8 - (3*Sech[x]*Tanh[x])/8 - (Sech[x]*Tanh[x]^3)/4 - (I/4)*Tanh[x]^4

Rule 30

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

Rule 2687

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

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

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]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = -\left (i \int \text {sech}^2(x) \tanh ^3(x) \, dx\right )+\int \text {sech}(x) \tanh ^4(x) \, dx \\ & = -\frac {1}{4} \text {sech}(x) \tanh ^3(x)-i \text {Subst}\left (\int x^3 \, dx,x,i \tanh (x)\right )+\frac {3}{4} \int \text {sech}(x) \tanh ^2(x) \, dx \\ & = -\frac {3}{8} \text {sech}(x) \tanh (x)-\frac {1}{4} \text {sech}(x) \tanh ^3(x)-\frac {1}{4} i \tanh ^4(x)+\frac {3}{8} \int \text {sech}(x) \, dx \\ & = \frac {3}{8} \arctan (\sinh (x))-\frac {3}{8} \text {sech}(x) \tanh (x)-\frac {1}{4} \text {sech}(x) \tanh ^3(x)-\frac {1}{4} i \tanh ^4(x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.17 \[ \int \frac {\tanh ^3(x)}{i+\sinh (x)} \, dx=\frac {1}{8} \left (3 \arctan (\sinh (x))-\frac {2+i \sinh (x)+5 \sinh ^2(x)}{(-i+\sinh (x)) (i+\sinh (x))^2}\right ) \]

[In]

Integrate[Tanh[x]^3/(I + Sinh[x]),x]

[Out]

(3*ArcTan[Sinh[x]] - (2 + I*Sinh[x] + 5*Sinh[x]^2)/((-I + Sinh[x])*(I + Sinh[x])^2))/8

Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 66 vs. \(2 (27 ) = 54\).

Time = 9.07 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.86

method result size
risch \(-\frac {2 i {\mathrm e}^{4 x}-2 \,{\mathrm e}^{3 x}-2 i {\mathrm e}^{2 x}+5 \,{\mathrm e}^{5 x}+5 \,{\mathrm e}^{x}}{4 \left ({\mathrm e}^{x}+i\right )^{4} \left ({\mathrm e}^{x}-i\right )^{2}}-\frac {3 i \ln \left ({\mathrm e}^{x}-i\right )}{8}+\frac {3 i \ln \left ({\mathrm e}^{x}+i\right )}{8}\) \(67\)
default \(-\frac {3 i \ln \left (-i+\tanh \left (\frac {x}{2}\right )\right )}{8}+\frac {i}{4 \left (-i+\tanh \left (\frac {x}{2}\right )\right )^{2}}+\frac {1}{-4 i+4 \tanh \left (\frac {x}{2}\right )}-\frac {i}{2 \left (\tanh \left (\frac {x}{2}\right )+i\right )^{4}}+\frac {3 i \ln \left (\tanh \left (\frac {x}{2}\right )+i\right )}{8}+\frac {1}{\left (\tanh \left (\frac {x}{2}\right )+i\right )^{3}}+\frac {1}{2 \tanh \left (\frac {x}{2}\right )+2 i}\) \(79\)

[In]

int(tanh(x)^3/(I+sinh(x)),x,method=_RETURNVERBOSE)

[Out]

-1/4*(2*I*exp(x)^4-2*exp(x)^3-2*I*exp(x)^2+5*exp(x)^5+5*exp(x))/(exp(x)+I)^4/(exp(x)-I)^2-3/8*I*ln(exp(x)-I)+3
/8*I*ln(exp(x)+I)

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 151 vs. \(2 (26) = 52\).

Time = 0.29 (sec) , antiderivative size = 151, normalized size of antiderivative = 4.19 \[ \int \frac {\tanh ^3(x)}{i+\sinh (x)} \, dx=-\frac {3 \, {\left (-i \, e^{\left (6 \, x\right )} + 2 \, e^{\left (5 \, x\right )} - i \, e^{\left (4 \, x\right )} + 4 \, e^{\left (3 \, x\right )} + i \, e^{\left (2 \, x\right )} + 2 \, e^{x} + i\right )} \log \left (e^{x} + i\right ) + 3 \, {\left (i \, e^{\left (6 \, x\right )} - 2 \, e^{\left (5 \, x\right )} + i \, e^{\left (4 \, x\right )} - 4 \, e^{\left (3 \, x\right )} - i \, e^{\left (2 \, x\right )} - 2 \, e^{x} - i\right )} \log \left (e^{x} - i\right ) + 10 \, e^{\left (5 \, x\right )} + 4 i \, e^{\left (4 \, x\right )} - 4 \, e^{\left (3 \, x\right )} - 4 i \, e^{\left (2 \, x\right )} + 10 \, e^{x}}{8 \, {\left (e^{\left (6 \, x\right )} + 2 i \, e^{\left (5 \, x\right )} + e^{\left (4 \, x\right )} + 4 i \, e^{\left (3 \, x\right )} - e^{\left (2 \, x\right )} + 2 i \, e^{x} - 1\right )}} \]

[In]

integrate(tanh(x)^3/(I+sinh(x)),x, algorithm="fricas")

[Out]

-1/8*(3*(-I*e^(6*x) + 2*e^(5*x) - I*e^(4*x) + 4*e^(3*x) + I*e^(2*x) + 2*e^x + I)*log(e^x + I) + 3*(I*e^(6*x) -
 2*e^(5*x) + I*e^(4*x) - 4*e^(3*x) - I*e^(2*x) - 2*e^x - I)*log(e^x - I) + 10*e^(5*x) + 4*I*e^(4*x) - 4*e^(3*x
) - 4*I*e^(2*x) + 10*e^x)/(e^(6*x) + 2*I*e^(5*x) + e^(4*x) + 4*I*e^(3*x) - e^(2*x) + 2*I*e^x - 1)

Sympy [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 99 vs. \(2 (36) = 72\).

Time = 0.11 (sec) , antiderivative size = 99, normalized size of antiderivative = 2.75 \[ \int \frac {\tanh ^3(x)}{i+\sinh (x)} \, dx=\frac {- 5 e^{5 x} - 2 i e^{4 x} + 2 e^{3 x} + 2 i e^{2 x} - 5 e^{x}}{4 e^{6 x} + 8 i e^{5 x} + 4 e^{4 x} + 16 i e^{3 x} - 4 e^{2 x} + 8 i e^{x} - 4} + \operatorname {RootSum} {\left (64 z^{2} + 9, \left ( i \mapsto i \log {\left (\frac {8 i}{3} + e^{x} \right )} \right )\right )} \]

[In]

integrate(tanh(x)**3/(I+sinh(x)),x)

[Out]

(-5*exp(5*x) - 2*I*exp(4*x) + 2*exp(3*x) + 2*I*exp(2*x) - 5*exp(x))/(4*exp(6*x) + 8*I*exp(5*x) + 4*exp(4*x) +
16*I*exp(3*x) - 4*exp(2*x) + 8*I*exp(x) - 4) + RootSum(64*_z**2 + 9, Lambda(_i, _i*log(8*_i/3 + exp(x))))

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 95 vs. \(2 (26) = 52\).

Time = 0.22 (sec) , antiderivative size = 95, normalized size of antiderivative = 2.64 \[ \int \frac {\tanh ^3(x)}{i+\sinh (x)} \, dx=\frac {5 \, e^{\left (-x\right )} + 2 i \, e^{\left (-2 \, x\right )} - 2 \, e^{\left (-3 \, x\right )} - 2 i \, e^{\left (-4 \, x\right )} + 5 \, e^{\left (-5 \, x\right )}}{-8 i \, e^{\left (-x\right )} - 4 \, e^{\left (-2 \, x\right )} - 16 i \, e^{\left (-3 \, x\right )} + 4 \, e^{\left (-4 \, x\right )} - 8 i \, e^{\left (-5 \, x\right )} + 4 \, e^{\left (-6 \, x\right )} - 4} + \frac {3}{8} i \, \log \left (i \, e^{\left (-x\right )} + 1\right ) - \frac {3}{8} i \, \log \left (i \, e^{\left (-x\right )} - 1\right ) \]

[In]

integrate(tanh(x)^3/(I+sinh(x)),x, algorithm="maxima")

[Out]

(5*e^(-x) + 2*I*e^(-2*x) - 2*e^(-3*x) - 2*I*e^(-4*x) + 5*e^(-5*x))/(-8*I*e^(-x) - 4*e^(-2*x) - 16*I*e^(-3*x) +
 4*e^(-4*x) - 8*I*e^(-5*x) + 4*e^(-6*x) - 4) + 3/8*I*log(I*e^(-x) + 1) - 3/8*I*log(I*e^(-x) - 1)

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 92 vs. \(2 (26) = 52\).

Time = 0.26 (sec) , antiderivative size = 92, normalized size of antiderivative = 2.56 \[ \int \frac {\tanh ^3(x)}{i+\sinh (x)} \, dx=\frac {3 i \, e^{\left (-x\right )} - 3 i \, e^{x} - 2}{16 \, {\left (e^{\left (-x\right )} - e^{x} + 2 i\right )}} - \frac {9 i \, {\left (e^{\left (-x\right )} - e^{x}\right )}^{2} + 4 \, e^{\left (-x\right )} - 4 \, e^{x} + 12 i}{32 \, {\left (e^{\left (-x\right )} - e^{x} - 2 i\right )}^{2}} + \frac {3}{16} i \, \log \left (-e^{\left (-x\right )} + e^{x} + 2 i\right ) - \frac {3}{16} i \, \log \left (-e^{\left (-x\right )} + e^{x} - 2 i\right ) \]

[In]

integrate(tanh(x)^3/(I+sinh(x)),x, algorithm="giac")

[Out]

1/16*(3*I*e^(-x) - 3*I*e^x - 2)/(e^(-x) - e^x + 2*I) - 1/32*(9*I*(e^(-x) - e^x)^2 + 4*e^(-x) - 4*e^x + 12*I)/(
e^(-x) - e^x - 2*I)^2 + 3/16*I*log(-e^(-x) + e^x + 2*I) - 3/16*I*log(-e^(-x) + e^x - 2*I)

Mupad [B] (verification not implemented)

Time = 1.62 (sec) , antiderivative size = 113, normalized size of antiderivative = 3.14 \[ \int \frac {\tanh ^3(x)}{i+\sinh (x)} \, dx=\frac {3\,\mathrm {atan}\left ({\mathrm {e}}^x\right )}{4}+\frac {3{}\mathrm {i}}{2\,\left ({\mathrm {e}}^{2\,x}-1+{\mathrm {e}}^x\,2{}\mathrm {i}\right )}-\frac {1{}\mathrm {i}}{2\,\left ({\mathrm {e}}^{4\,x}-6\,{\mathrm {e}}^{2\,x}+1+{\mathrm {e}}^{3\,x}\,4{}\mathrm {i}-{\mathrm {e}}^x\,4{}\mathrm {i}\right )}+\frac {1{}\mathrm {i}}{4\,\left (1-{\mathrm {e}}^{2\,x}+{\mathrm {e}}^x\,2{}\mathrm {i}\right )}-\frac {1}{4\,\left ({\mathrm {e}}^x-\mathrm {i}\right )}-\frac {1}{{\mathrm {e}}^x+1{}\mathrm {i}}+\frac {1}{{\mathrm {e}}^{2\,x}\,3{}\mathrm {i}+{\mathrm {e}}^{3\,x}-3\,{\mathrm {e}}^x-\mathrm {i}} \]

[In]

int(tanh(x)^3/(sinh(x) + 1i),x)

[Out]

(3*atan(exp(x)))/4 + 3i/(2*(exp(2*x) + exp(x)*2i - 1)) - 1i/(2*(exp(3*x)*4i - 6*exp(2*x) + exp(4*x) - exp(x)*4
i + 1)) + 1i/(4*(exp(x)*2i - exp(2*x) + 1)) - 1/(4*(exp(x) - 1i)) - 1/(exp(x) + 1i) + 1/(exp(2*x)*3i + exp(3*x
) - 3*exp(x) - 1i)