\(\int \frac {\text {sech}^4(x)}{i+\text {csch}(x)} \, dx\) [91]

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

Optimal result

Integrand size = 13, antiderivative size = 29 \[ \int \frac {\text {sech}^4(x)}{i+\text {csch}(x)} \, dx=-\frac {1}{5} \text {sech}^5(x)-\frac {1}{3} i \tanh ^3(x)+\frac {1}{5} i \tanh ^5(x) \]

[Out]

-1/5*sech(x)^5-1/3*I*tanh(x)^3+1/5*I*tanh(x)^5

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.462, Rules used = {3957, 2918, 2686, 30, 2687, 14} \[ \int \frac {\text {sech}^4(x)}{i+\text {csch}(x)} \, dx=\frac {1}{5} i \tanh ^5(x)-\frac {1}{3} i \tanh ^3(x)-\frac {1}{5} \text {sech}^5(x) \]

[In]

Int[Sech[x]^4/(I + Csch[x]),x]

[Out]

-1/5*Sech[x]^5 - (I/3)*Tanh[x]^3 + (I/5)*Tanh[x]^5

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

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 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 2918

Int[((cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.))/((a_) + (b_.)*sin[(e_.) + (f_
.)*(x_)]), x_Symbol] :> Dist[g^2/a, Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^n, x], x] - Dist[g^2/(b*d),
Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2
 - b^2, 0]

Rule 3957

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Int[(g*Co
s[e + f*x])^p*((b + a*Sin[e + f*x])^m/Sin[e + f*x]^m), x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]

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

Mathematica [B] (verified)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(96\) vs. \(2(29)=58\).

Time = 0.10 (sec) , antiderivative size = 96, normalized size of antiderivative = 3.31 \[ \int \frac {\text {sech}^4(x)}{i+\text {csch}(x)} \, dx=\frac {-240+54 \cosh (x)+32 \cosh (2 x)+18 \cosh (3 x)+16 \cosh (4 x)-96 i \sinh (x)+18 i \sinh (2 x)-32 i \sinh (3 x)+9 i \sinh (4 x)}{960 \left (\cosh \left (\frac {x}{2}\right )-i \sinh \left (\frac {x}{2}\right )\right )^3 \left (\cosh \left (\frac {x}{2}\right )+i \sinh \left (\frac {x}{2}\right )\right )^5} \]

[In]

Integrate[Sech[x]^4/(I + Csch[x]),x]

[Out]

(-240 + 54*Cosh[x] + 32*Cosh[2*x] + 18*Cosh[3*x] + 16*Cosh[4*x] - (96*I)*Sinh[x] + (18*I)*Sinh[2*x] - (32*I)*S
inh[3*x] + (9*I)*Sinh[4*x])/(960*(Cosh[x/2] - I*Sinh[x/2])^3*(Cosh[x/2] + I*Sinh[x/2])^5)

Maple [B] (verified)

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

Time = 0.23 (sec) , antiderivative size = 93, normalized size of antiderivative = 3.21

\[-\frac {4 i}{3 \left (\tanh \left (\frac {x}{2}\right )-i\right )^{3}}+\frac {3 i}{8 \left (\tanh \left (\frac {x}{2}\right )-i\right )}+\frac {2 i}{5 \left (\tanh \left (\frac {x}{2}\right )-i\right )^{5}}+\frac {1}{\left (\tanh \left (\frac {x}{2}\right )-i\right )^{4}}-\frac {1}{\left (\tanh \left (\frac {x}{2}\right )-i\right )^{2}}+\frac {i}{6 \left (\tanh \left (\frac {x}{2}\right )+i\right )^{3}}-\frac {3 i}{8 \left (\tanh \left (\frac {x}{2}\right )+i\right )}-\frac {1}{4 \left (\tanh \left (\frac {x}{2}\right )+i\right )^{2}}\]

[In]

int(sech(x)^4/(I+csch(x)),x)

[Out]

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

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

Time = 0.25 (sec) , antiderivative size = 68, normalized size of antiderivative = 2.34 \[ \int \frac {\text {sech}^4(x)}{i+\text {csch}(x)} \, dx=-\frac {4 \, {\left (-15 i \, e^{\left (4 \, x\right )} - 6 \, e^{\left (3 \, x\right )} + 2 i \, e^{\left (2 \, x\right )} - 2 \, e^{x} + i\right )}}{15 \, {\left (e^{\left (8 \, x\right )} - 2 i \, e^{\left (7 \, x\right )} + 2 \, e^{\left (6 \, x\right )} - 6 i \, e^{\left (5 \, x\right )} - 6 i \, e^{\left (3 \, x\right )} - 2 \, e^{\left (2 \, x\right )} - 2 i \, e^{x} - 1\right )}} \]

[In]

integrate(sech(x)^4/(I+csch(x)),x, algorithm="fricas")

[Out]

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

Sympy [F]

\[ \int \frac {\text {sech}^4(x)}{i+\text {csch}(x)} \, dx=\int \frac {\operatorname {sech}^{4}{\left (x \right )}}{\operatorname {csch}{\left (x \right )} + i}\, dx \]

[In]

integrate(sech(x)**4/(I+csch(x)),x)

[Out]

Integral(sech(x)**4/(csch(x) + I), x)

Maxima [F(-2)]

Exception generated. \[ \int \frac {\text {sech}^4(x)}{i+\text {csch}(x)} \, dx=\text {Exception raised: RuntimeError} \]

[In]

integrate(sech(x)^4/(I+csch(x)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: THROW: The catch RAT-ERR is undefined.

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

Time = 0.27 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.90 \[ \int \frac {\text {sech}^4(x)}{i+\text {csch}(x)} \, dx=-\frac {-3 i \, e^{\left (2 \, x\right )} + 12 \, e^{x} + 5 i}{24 \, {\left (i \, e^{x} - 1\right )}^{3}} + \frac {15 \, e^{\left (4 \, x\right )} - 60 i \, e^{\left (3 \, x\right )} - 10 \, e^{\left (2 \, x\right )} + 20 i \, e^{x} + 7}{120 \, {\left (e^{x} - i\right )}^{5}} \]

[In]

integrate(sech(x)^4/(I+csch(x)),x, algorithm="giac")

[Out]

-1/24*(-3*I*e^(2*x) + 12*e^x + 5*I)/(I*e^x - 1)^3 + 1/120*(15*e^(4*x) - 60*I*e^(3*x) - 10*e^(2*x) + 20*I*e^x +
 7)/(e^x - I)^5

Mupad [B] (verification not implemented)

Time = 2.66 (sec) , antiderivative size = 207, normalized size of antiderivative = 7.14 \[ \int \frac {\text {sech}^4(x)}{i+\text {csch}(x)} \, dx=-\frac {1{}\mathrm {i}}{4\,\left ({\mathrm {e}}^{2\,x}-1+{\mathrm {e}}^x\,2{}\mathrm {i}\right )}+\frac {1}{20\,\left ({\mathrm {e}}^x-\mathrm {i}\right )}-\frac {1}{8\,\left ({\mathrm {e}}^x+1{}\mathrm {i}\right )}+\frac {\frac {{\mathrm {e}}^{3\,x}}{40}-\frac {{\mathrm {e}}^{2\,x}\,3{}\mathrm {i}}{40}+\frac {{\mathrm {e}}^x}{8}+\frac {1}{40}{}\mathrm {i}}{{\mathrm {e}}^{4\,x}-6\,{\mathrm {e}}^{2\,x}+1-{\mathrm {e}}^{3\,x}\,4{}\mathrm {i}+{\mathrm {e}}^x\,4{}\mathrm {i}}-\frac {\frac {{\mathrm {e}}^{2\,x}}{40}+\frac {1}{24}-\frac {{\mathrm {e}}^x\,1{}\mathrm {i}}{20}}{{\mathrm {e}}^{2\,x}\,3{}\mathrm {i}-{\mathrm {e}}^{3\,x}+3\,{\mathrm {e}}^x-\mathrm {i}}-\frac {1}{6\,\left ({\mathrm {e}}^{2\,x}\,3{}\mathrm {i}+{\mathrm {e}}^{3\,x}-3\,{\mathrm {e}}^x-\mathrm {i}\right )}+\frac {\frac {{\mathrm {e}}^{2\,x}}{4}+\frac {{\mathrm {e}}^{4\,x}}{40}+\frac {1}{40}-\frac {{\mathrm {e}}^{3\,x}\,1{}\mathrm {i}}{10}+\frac {{\mathrm {e}}^x\,1{}\mathrm {i}}{10}}{{\mathrm {e}}^{2\,x}\,10{}\mathrm {i}-10\,{\mathrm {e}}^{3\,x}-{\mathrm {e}}^{4\,x}\,5{}\mathrm {i}+{\mathrm {e}}^{5\,x}+5\,{\mathrm {e}}^x-\mathrm {i}} \]

[In]

int(1/(cosh(x)^4*(1/sinh(x) + 1i)),x)

[Out]

1/(20*(exp(x) - 1i)) - 1i/(4*(exp(2*x) + exp(x)*2i - 1)) - 1/(8*(exp(x) + 1i)) + (exp(3*x)/40 - (exp(2*x)*3i)/
40 + exp(x)/8 + 1i/40)/(exp(4*x) - exp(3*x)*4i - 6*exp(2*x) + exp(x)*4i + 1) - (exp(2*x)/40 - (exp(x)*1i)/20 +
 1/24)/(exp(2*x)*3i - exp(3*x) + 3*exp(x) - 1i) - 1/(6*(exp(2*x)*3i + exp(3*x) - 3*exp(x) - 1i)) + (exp(2*x)/4
 - (exp(3*x)*1i)/10 + exp(4*x)/40 + (exp(x)*1i)/10 + 1/40)/(exp(2*x)*10i - 10*exp(3*x) - exp(4*x)*5i + exp(5*x
) + 5*exp(x) - 1i)