\(\int \frac {\text {sech}^2(x)}{i+\sinh (x)} \, dx\) [167]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (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 = 25 \[ \int \frac {\text {sech}^2(x)}{i+\sinh (x)} \, dx=-\frac {i \text {sech}(x)}{3 (i+\sinh (x))}-\frac {2}{3} i \tanh (x) \]

[Out]

-1/3*I*sech(x)/(I+sinh(x))-2/3*I*tanh(x)

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {2751, 3852, 8} \[ \int \frac {\text {sech}^2(x)}{i+\sinh (x)} \, dx=-\frac {2}{3} i \tanh (x)-\frac {i \text {sech}(x)}{3 (\sinh (x)+i)} \]

[In]

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

[Out]

((-1/3*I)*Sech[x])/(I + Sinh[x]) - ((2*I)/3)*Tanh[x]

Rule 8

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

Rule 2751

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Simp[b*(g*C
os[e + f*x])^(p + 1)*((a + b*Sin[e + f*x])^m/(a*f*g*Simplify[2*m + p + 1])), x] + Dist[Simplify[m + p + 1]/(a*
Simplify[2*m + p + 1]), Int[(g*Cos[e + f*x])^p*(a + b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{a, b, e, f, g, m
, p}, x] && EqQ[a^2 - b^2, 0] && ILtQ[Simplify[m + p + 1], 0] && NeQ[2*m + p + 1, 0] &&  !IGtQ[m, 0]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

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

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.88 \[ \int \frac {\text {sech}^2(x)}{i+\sinh (x)} \, dx=-\frac {1}{3} i \left (\frac {\text {sech}(x)}{i+\sinh (x)}+2 \tanh (x)\right ) \]

[In]

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

[Out]

(-1/3*I)*(Sech[x]/(I + Sinh[x]) + 2*Tanh[x])

Maple [A] (verified)

Time = 27.19 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.96

method result size
risch \(-\frac {4 \left (2 \,{\mathrm e}^{x}+i\right )}{3 \left ({\mathrm e}^{x}+i\right )^{3} \left ({\mathrm e}^{x}-i\right )}\) \(24\)
default \(-\frac {i}{2 \left (-i+\tanh \left (\frac {x}{2}\right )\right )}-\frac {1}{\left (\tanh \left (\frac {x}{2}\right )+i\right )^{2}}+\frac {2 i}{3 \left (\tanh \left (\frac {x}{2}\right )+i\right )^{3}}-\frac {3 i}{2 \left (\tanh \left (\frac {x}{2}\right )+i\right )}\) \(49\)

[In]

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

[Out]

-4/3*(2*exp(x)+I)/(exp(x)+I)^3/(exp(x)-I)

Fricas [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.04 \[ \int \frac {\text {sech}^2(x)}{i+\sinh (x)} \, dx=-\frac {4 \, {\left (2 \, e^{x} + i\right )}}{3 \, {\left (e^{\left (4 \, x\right )} + 2 i \, e^{\left (3 \, x\right )} + 2 i \, e^{x} - 1\right )}} \]

[In]

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

[Out]

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

Sympy [F]

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

[In]

integrate(sech(x)**2/(I+sinh(x)),x)

[Out]

Integral(sech(x)**2/(sinh(x) + I), 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. 53 vs. \(2 (15) = 30\).

Time = 0.20 (sec) , antiderivative size = 53, normalized size of antiderivative = 2.12 \[ \int \frac {\text {sech}^2(x)}{i+\sinh (x)} \, dx=-\frac {8 \, e^{\left (-x\right )}}{-6 i \, e^{\left (-x\right )} - 6 i \, e^{\left (-3 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} - 3} + \frac {4 i}{-6 i \, e^{\left (-x\right )} - 6 i \, e^{\left (-3 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} - 3} \]

[In]

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

[Out]

-8*e^(-x)/(-6*I*e^(-x) - 6*I*e^(-3*x) + 3*e^(-4*x) - 3) + 4*I/(-6*I*e^(-x) - 6*I*e^(-3*x) + 3*e^(-4*x) - 3)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.16 \[ \int \frac {\text {sech}^2(x)}{i+\sinh (x)} \, dx=\frac {1}{2 \, {\left (e^{x} - i\right )}} - \frac {3 \, e^{\left (2 \, x\right )} + 12 i \, e^{x} - 5}{6 \, {\left (e^{x} + i\right )}^{3}} \]

[In]

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

[Out]

1/2/(e^x - I) - 1/6*(3*e^(2*x) + 12*I*e^x - 5)/(e^x + I)^3

Mupad [B] (verification not implemented)

Time = 1.28 (sec) , antiderivative size = 63, normalized size of antiderivative = 2.52 \[ \int \frac {\text {sech}^2(x)}{i+\sinh (x)} \, dx=-\frac {8\,{\mathrm {e}}^x}{3\,{\left ({\mathrm {e}}^{2\,x}+1\right )}^3}-\frac {8\,{\mathrm {e}}^x\,\left ({\mathrm {e}}^{2\,x}-1\right )}{3\,{\left ({\mathrm {e}}^{2\,x}+1\right )}^3}+\frac {{\mathrm {e}}^{2\,x}\,16{}\mathrm {i}}{3\,{\left ({\mathrm {e}}^{2\,x}+1\right )}^3}-\frac {\left ({\mathrm {e}}^{2\,x}-1\right )\,4{}\mathrm {i}}{3\,{\left ({\mathrm {e}}^{2\,x}+1\right )}^3} \]

[In]

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

[Out]

(exp(2*x)*16i)/(3*(exp(2*x) + 1)^3) - (8*exp(x))/(3*(exp(2*x) + 1)^3) - ((exp(2*x) - 1)*4i)/(3*(exp(2*x) + 1)^
3) - (8*exp(x)*(exp(2*x) - 1))/(3*(exp(2*x) + 1)^3)