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

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (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 = 66 \[ \int \frac {\tanh ^3(x)}{(i+\sinh (x))^2} \, dx=-\frac {1}{8} i \arctan (\sinh (x))-\frac {i}{16 (i-\sinh (x))}+\frac {i}{12 (i+\sinh (x))^3}-\frac {1}{4 (i+\sinh (x))^2}-\frac {3 i}{16 (i+\sinh (x))} \]

[Out]

-1/8*I*arctan(sinh(x))-1/16*I/(I-sinh(x))+1/12*I/(I+sinh(x))^3-1/4/(I+sinh(x))^2-3/16*I/(I+sinh(x))

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {2786, 90, 209} \[ \int \frac {\tanh ^3(x)}{(i+\sinh (x))^2} \, dx=-\frac {1}{8} i \arctan (\sinh (x))-\frac {i}{16 (-\sinh (x)+i)}-\frac {3 i}{16 (\sinh (x)+i)}-\frac {1}{4 (\sinh (x)+i)^2}+\frac {i}{12 (\sinh (x)+i)^3} \]

[In]

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

[Out]

(-1/8*I)*ArcTan[Sinh[x]] - (I/16)/(I - Sinh[x]) + (I/12)/(I + Sinh[x])^3 - 1/(4*(I + Sinh[x])^2) - ((3*I)/16)/
(I + Sinh[x])

Rule 90

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 2786

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[x^p*((a + x)^(m - (p + 1)/2)/(a - x)^((p + 1)/2)), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& EqQ[a^2 - b^2, 0] && IntegerQ[(p + 1)/2]

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

Mathematica [A] (verified)

Time = 0.11 (sec) , antiderivative size = 52, normalized size of antiderivative = 0.79 \[ \int \frac {\tanh ^3(x)}{(i+\sinh (x))^2} \, dx=\frac {1}{48} i \left (-6 \arctan (\sinh (x))-\frac {2 \left (2 i+7 \sinh (x)-6 i \sinh ^2(x)+3 \sinh ^3(x)\right )}{(-i+\sinh (x)) (i+\sinh (x))^3}\right ) \]

[In]

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

[Out]

(I/48)*(-6*ArcTan[Sinh[x]] - (2*(2*I + 7*Sinh[x] - (6*I)*Sinh[x]^2 + 3*Sinh[x]^3))/((-I + Sinh[x])*(I + Sinh[x
])^3))

Maple [A] (verified)

Time = 20.25 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.15

method result size
risch \(-\frac {i {\mathrm e}^{x} \left (-12 i {\mathrm e}^{5 x}+3 \,{\mathrm e}^{6 x}+40 i {\mathrm e}^{3 x}+19 \,{\mathrm e}^{4 x}-12 i {\mathrm e}^{x}-19 \,{\mathrm e}^{2 x}-3\right )}{12 \left ({\mathrm e}^{x}-i\right )^{2} \left ({\mathrm e}^{x}+i\right )^{6}}+\frac {\ln \left ({\mathrm e}^{x}+i\right )}{8}-\frac {\ln \left ({\mathrm e}^{x}-i\right )}{8}\) \(76\)
default \(-\frac {i}{8 \left (-i+\tanh \left (\frac {x}{2}\right )\right )}+\frac {1}{8 \left (-i+\tanh \left (\frac {x}{2}\right )\right )^{2}}-\frac {\ln \left (-i+\tanh \left (\frac {x}{2}\right )\right )}{8}+\frac {2 i}{\left (\tanh \left (\frac {x}{2}\right )+i\right )^{5}}-\frac {2 i}{3 \left (\tanh \left (\frac {x}{2}\right )+i\right )^{3}}-\frac {i}{8 \left (\tanh \left (\frac {x}{2}\right )+i\right )}+\frac {2}{3 \left (\tanh \left (\frac {x}{2}\right )+i\right )^{6}}-\frac {2}{\left (\tanh \left (\frac {x}{2}\right )+i\right )^{4}}-\frac {1}{8 \left (\tanh \left (\frac {x}{2}\right )+i\right )^{2}}+\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+i\right )}{8}\) \(114\)

[In]

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

[Out]

-1/12*I*exp(x)*(-12*I*exp(x)^5+3*exp(x)^6+40*I*exp(x)^3+19*exp(x)^4-12*I*exp(x)-19*exp(x)^2-3)/(exp(x)-I)^2/(e
xp(x)+I)^6+1/8*ln(exp(x)+I)-1/8*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. 197 vs. \(2 (38) = 76\).

Time = 0.28 (sec) , antiderivative size = 197, normalized size of antiderivative = 2.98 \[ \int \frac {\tanh ^3(x)}{(i+\sinh (x))^2} \, dx=\frac {3 \, {\left (e^{\left (8 \, x\right )} + 4 i \, e^{\left (7 \, x\right )} - 4 \, e^{\left (6 \, x\right )} + 4 i \, e^{\left (5 \, x\right )} - 10 \, e^{\left (4 \, x\right )} - 4 i \, e^{\left (3 \, x\right )} - 4 \, e^{\left (2 \, x\right )} - 4 i \, e^{x} + 1\right )} \log \left (e^{x} + i\right ) - 3 \, {\left (e^{\left (8 \, x\right )} + 4 i \, e^{\left (7 \, x\right )} - 4 \, e^{\left (6 \, x\right )} + 4 i \, e^{\left (5 \, x\right )} - 10 \, e^{\left (4 \, x\right )} - 4 i \, e^{\left (3 \, x\right )} - 4 \, e^{\left (2 \, x\right )} - 4 i \, e^{x} + 1\right )} \log \left (e^{x} - i\right ) - 6 i \, e^{\left (7 \, x\right )} - 24 \, e^{\left (6 \, x\right )} - 38 i \, e^{\left (5 \, x\right )} + 80 \, e^{\left (4 \, x\right )} + 38 i \, e^{\left (3 \, x\right )} - 24 \, e^{\left (2 \, x\right )} + 6 i \, e^{x}}{24 \, {\left (e^{\left (8 \, x\right )} + 4 i \, e^{\left (7 \, x\right )} - 4 \, e^{\left (6 \, x\right )} + 4 i \, e^{\left (5 \, x\right )} - 10 \, e^{\left (4 \, x\right )} - 4 i \, e^{\left (3 \, x\right )} - 4 \, e^{\left (2 \, x\right )} - 4 i \, e^{x} + 1\right )}} \]

[In]

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

[Out]

1/24*(3*(e^(8*x) + 4*I*e^(7*x) - 4*e^(6*x) + 4*I*e^(5*x) - 10*e^(4*x) - 4*I*e^(3*x) - 4*e^(2*x) - 4*I*e^x + 1)
*log(e^x + I) - 3*(e^(8*x) + 4*I*e^(7*x) - 4*e^(6*x) + 4*I*e^(5*x) - 10*e^(4*x) - 4*I*e^(3*x) - 4*e^(2*x) - 4*
I*e^x + 1)*log(e^x - I) - 6*I*e^(7*x) - 24*e^(6*x) - 38*I*e^(5*x) + 80*e^(4*x) + 38*I*e^(3*x) - 24*e^(2*x) + 6
*I*e^x)/(e^(8*x) + 4*I*e^(7*x) - 4*e^(6*x) + 4*I*e^(5*x) - 10*e^(4*x) - 4*I*e^(3*x) - 4*e^(2*x) - 4*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. 129 vs. \(2 (49) = 98\).

Time = 0.13 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.95 \[ \int \frac {\tanh ^3(x)}{(i+\sinh (x))^2} \, dx=\frac {- 3 i e^{7 x} - 12 e^{6 x} - 19 i e^{5 x} + 40 e^{4 x} + 19 i e^{3 x} - 12 e^{2 x} + 3 i e^{x}}{12 e^{8 x} + 48 i e^{7 x} - 48 e^{6 x} + 48 i e^{5 x} - 120 e^{4 x} - 48 i e^{3 x} - 48 e^{2 x} - 48 i e^{x} + 12} - \frac {\log {\left (e^{x} - i \right )}}{8} + \frac {\log {\left (e^{x} + i \right )}}{8} \]

[In]

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

[Out]

(-3*I*exp(7*x) - 12*exp(6*x) - 19*I*exp(5*x) + 40*exp(4*x) + 19*I*exp(3*x) - 12*exp(2*x) + 3*I*exp(x))/(12*exp
(8*x) + 48*I*exp(7*x) - 48*exp(6*x) + 48*I*exp(5*x) - 120*exp(4*x) - 48*I*exp(3*x) - 48*exp(2*x) - 48*I*exp(x)
 + 12) - log(exp(x) - I)/8 + log(exp(x) + I)/8

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. 115 vs. \(2 (38) = 76\).

Time = 0.20 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.74 \[ \int \frac {\tanh ^3(x)}{(i+\sinh (x))^2} \, dx=\frac {-3 i \, e^{\left (-x\right )} - 12 \, e^{\left (-2 \, x\right )} - 19 i \, e^{\left (-3 \, x\right )} + 40 \, e^{\left (-4 \, x\right )} + 19 i \, e^{\left (-5 \, x\right )} - 12 \, e^{\left (-6 \, x\right )} + 3 i \, e^{\left (-7 \, x\right )}}{48 i \, e^{\left (-x\right )} - 48 \, e^{\left (-2 \, x\right )} + 48 i \, e^{\left (-3 \, x\right )} - 120 \, e^{\left (-4 \, x\right )} - 48 i \, e^{\left (-5 \, x\right )} - 48 \, e^{\left (-6 \, x\right )} - 48 i \, e^{\left (-7 \, x\right )} + 12 \, e^{\left (-8 \, x\right )} + 12} - \frac {1}{8} \, \log \left (e^{\left (-x\right )} + i\right ) + \frac {1}{8} \, \log \left (e^{\left (-x\right )} - i\right ) \]

[In]

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

[Out]

(-3*I*e^(-x) - 12*e^(-2*x) - 19*I*e^(-3*x) + 40*e^(-4*x) + 19*I*e^(-5*x) - 12*e^(-6*x) + 3*I*e^(-7*x))/(48*I*e
^(-x) - 48*e^(-2*x) + 48*I*e^(-3*x) - 120*e^(-4*x) - 48*I*e^(-5*x) - 48*e^(-6*x) - 48*I*e^(-7*x) + 12*e^(-8*x)
 + 12) - 1/8*log(e^(-x) + I) + 1/8*log(e^(-x) - I)

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. 102 vs. \(2 (38) = 76\).

Time = 0.26 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.55 \[ \int \frac {\tanh ^3(x)}{(i+\sinh (x))^2} \, dx=\frac {e^{\left (-x\right )} - e^{x}}{16 \, {\left (e^{\left (-x\right )} - e^{x} + 2 i\right )}} - \frac {11 \, {\left (e^{\left (-x\right )} - e^{x}\right )}^{3} - 102 i \, {\left (e^{\left (-x\right )} - e^{x}\right )}^{2} - 180 \, e^{\left (-x\right )} + 180 \, e^{x} + 104 i}{96 \, {\left (e^{\left (-x\right )} - e^{x} - 2 i\right )}^{3}} + \frac {1}{16} \, \log \left (-e^{\left (-x\right )} + e^{x} + 2 i\right ) - \frac {1}{16} \, \log \left (-e^{\left (-x\right )} + e^{x} - 2 i\right ) \]

[In]

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

[Out]

1/16*(e^(-x) - e^x)/(e^(-x) - e^x + 2*I) - 1/96*(11*(e^(-x) - e^x)^3 - 102*I*(e^(-x) - e^x)^2 - 180*e^(-x) + 1
80*e^x + 104*I)/(e^(-x) - e^x - 2*I)^3 + 1/16*log(-e^(-x) + e^x + 2*I) - 1/16*log(-e^(-x) + e^x - 2*I)

Mupad [B] (verification not implemented)

Time = 2.28 (sec) , antiderivative size = 209, normalized size of antiderivative = 3.17 \[ \int \frac {\tanh ^3(x)}{(i+\sinh (x))^2} \, dx=\frac {\ln \left (-\frac {1}{4}+\frac {{\mathrm {e}}^x\,1{}\mathrm {i}}{4}\right )}{8}-\frac {\ln \left (\frac {1}{4}+\frac {{\mathrm {e}}^x\,1{}\mathrm {i}}{4}\right )}{8}-\frac {2{}\mathrm {i}}{{\mathrm {e}}^{5\,x}-10\,{\mathrm {e}}^{3\,x}+{\mathrm {e}}^{4\,x}\,5{}\mathrm {i}-{\mathrm {e}}^{2\,x}\,10{}\mathrm {i}+5\,{\mathrm {e}}^x+1{}\mathrm {i}}-\frac {11}{8\,\left ({\mathrm {e}}^{2\,x}-1+{\mathrm {e}}^x\,2{}\mathrm {i}\right )}+\frac {3}{{\mathrm {e}}^{4\,x}-6\,{\mathrm {e}}^{2\,x}+1+{\mathrm {e}}^{3\,x}\,4{}\mathrm {i}-{\mathrm {e}}^x\,4{}\mathrm {i}}+\frac {1}{8\,\left (1-{\mathrm {e}}^{2\,x}+{\mathrm {e}}^x\,2{}\mathrm {i}\right )}+\frac {1{}\mathrm {i}}{8\,\left ({\mathrm {e}}^x-\mathrm {i}\right )}-\frac {3{}\mathrm {i}}{8\,\left ({\mathrm {e}}^x+1{}\mathrm {i}\right )}-\frac {2}{3\,\left (15\,{\mathrm {e}}^{2\,x}-15\,{\mathrm {e}}^{4\,x}+{\mathrm {e}}^{6\,x}-1-{\mathrm {e}}^{3\,x}\,20{}\mathrm {i}+{\mathrm {e}}^{5\,x}\,6{}\mathrm {i}+{\mathrm {e}}^x\,6{}\mathrm {i}\right )}+\frac {8{}\mathrm {i}}{3\,\left ({\mathrm {e}}^{2\,x}\,3{}\mathrm {i}+{\mathrm {e}}^{3\,x}-3\,{\mathrm {e}}^x-\mathrm {i}\right )} \]

[In]

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

[Out]

log((exp(x)*1i)/4 - 1/4)/8 - log((exp(x)*1i)/4 + 1/4)/8 - 2i/(exp(4*x)*5i - 10*exp(3*x) - exp(2*x)*10i + exp(5
*x) + 5*exp(x) + 1i) - 11/(8*(exp(2*x) + exp(x)*2i - 1)) + 3/(exp(3*x)*4i - 6*exp(2*x) + exp(4*x) - exp(x)*4i
+ 1) + 1/(8*(exp(x)*2i - exp(2*x) + 1)) + 1i/(8*(exp(x) - 1i)) - 3i/(8*(exp(x) + 1i)) - 2/(3*(15*exp(2*x) - ex
p(3*x)*20i - 15*exp(4*x) + exp(5*x)*6i + exp(6*x) + exp(x)*6i - 1)) + 8i/(3*(exp(2*x)*3i + exp(3*x) - 3*exp(x)
 - 1i))