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

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (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 = 11, antiderivative size = 24 \[ \int \frac {\text {sech}(x)}{i+\sinh (x)} \, dx=-\frac {1}{2} i \arctan (\sinh (x))-\frac {i}{2 (i+\sinh (x))} \]

[Out]

-1/2*I*arctan(sinh(x))-1/2*I/(I+sinh(x))

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 24, 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.273, Rules used = {2746, 46, 209} \[ \int \frac {\text {sech}(x)}{i+\sinh (x)} \, dx=-\frac {1}{2} i \arctan (\sinh (x))-\frac {i}{2 (\sinh (x)+i)} \]

[In]

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

[Out]

(-1/2*I)*ArcTan[Sinh[x]] - (I/2)/(I + Sinh[x])

Rule 46

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}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

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 2746

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(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]
&& IntegerQ[(p - 1)/2] && EqQ[a^2 - b^2, 0] && (GeQ[p, -1] ||  !IntegerQ[m + 1/2])

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

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.75 \[ \int \frac {\text {sech}(x)}{i+\sinh (x)} \, dx=-\frac {1}{2} i \left (\arctan (\sinh (x))+\frac {1}{i+\sinh (x)}\right ) \]

[In]

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

[Out]

(-1/2*I)*(ArcTan[Sinh[x]] + (I + Sinh[x])^(-1))

Maple [A] (verified)

Time = 8.52 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.25

method result size
risch \(-\frac {i {\mathrm e}^{x}}{\left ({\mathrm e}^{x}+i\right )^{2}}-\frac {\ln \left ({\mathrm e}^{x}-i\right )}{2}+\frac {\ln \left ({\mathrm e}^{x}+i\right )}{2}\) \(30\)
default \(\frac {i}{\tanh \left (\frac {x}{2}\right )+i}+\frac {1}{\left (\tanh \left (\frac {x}{2}\right )+i\right )^{2}}+\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+i\right )}{2}-\frac {\ln \left (-i+\tanh \left (\frac {x}{2}\right )\right )}{2}\) \(43\)

[In]

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

[Out]

-I*exp(x)/(exp(x)+I)^2-1/2*ln(exp(x)-I)+1/2*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. 52 vs. \(2 (14) = 28\).

Time = 0.32 (sec) , antiderivative size = 52, normalized size of antiderivative = 2.17 \[ \int \frac {\text {sech}(x)}{i+\sinh (x)} \, dx=\frac {{\left (e^{\left (2 \, x\right )} + 2 i \, e^{x} - 1\right )} \log \left (e^{x} + i\right ) - {\left (e^{\left (2 \, x\right )} + 2 i \, e^{x} - 1\right )} \log \left (e^{x} - i\right ) - 2 i \, e^{x}}{2 \, {\left (e^{\left (2 \, x\right )} + 2 i \, e^{x} - 1\right )}} \]

[In]

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

[Out]

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

Sympy [F]

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

[In]

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

[Out]

Integral(sech(x)/(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. 41 vs. \(2 (14) = 28\).

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

[In]

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

[Out]

2*I*e^(-x)/(-4*I*e^(-x) + 2*e^(-2*x) - 2) - 1/2*log(e^(-x) + I) + 1/2*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. 51 vs. \(2 (14) = 28\).

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.92 \[ \int \frac {\text {sech}(x)}{i+\sinh (x)} \, dx=\frac {\ln \left (-1+{\mathrm {e}}^x\,1{}\mathrm {i}\right )}{2}-\frac {\ln \left (1+{\mathrm {e}}^x\,1{}\mathrm {i}\right )}{2}-\frac {1}{{\mathrm {e}}^{2\,x}-1+{\mathrm {e}}^x\,2{}\mathrm {i}}-\frac {1{}\mathrm {i}}{{\mathrm {e}}^x+1{}\mathrm {i}} \]

[In]

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

[Out]

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