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

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

Optimal result

Integrand size = 11, antiderivative size = 26 \[ \int \frac {\tanh (x)}{i+\sinh (x)} \, dx=\frac {1}{2} \arctan (\sinh (x))+\frac {1}{2} i \text {sech}^2(x)-\frac {1}{2} \text {sech}(x) \tanh (x) \]

[Out]

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

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.455, Rules used = {2785, 2686, 30, 2691, 3855} \[ \int \frac {\tanh (x)}{i+\sinh (x)} \, dx=\frac {1}{2} \arctan (\sinh (x))+\frac {1}{2} i \text {sech}^2(x)-\frac {1}{2} \tanh (x) \text {sech}(x) \]

[In]

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

[Out]

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

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 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 (x) \, dx\right )+\int \text {sech}(x) \tanh ^2(x) \, dx \\ & = -\frac {1}{2} \text {sech}(x) \tanh (x)+i \text {Subst}(\int x \, dx,x,\text {sech}(x))+\frac {1}{2} \int \text {sech}(x) \, dx \\ & = \frac {1}{2} \arctan (\sinh (x))+\frac {1}{2} i \text {sech}^2(x)-\frac {1}{2} \text {sech}(x) \tanh (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.77 \[ \int \frac {\tanh (x)}{i+\sinh (x)} \, dx=\frac {1}{2} \arctan (\sinh (x))-\frac {1}{2 (i+\sinh (x))} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 4.03 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.19

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

[In]

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

[Out]

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

Time = 0.29 (sec) , antiderivative size = 55, normalized size of antiderivative = 2.12 \[ \int \frac {\tanh (x)}{i+\sinh (x)} \, dx=\frac {{\left (i \, e^{\left (2 \, x\right )} - 2 \, e^{x} - i\right )} \log \left (e^{x} + i\right ) + {\left (-i \, e^{\left (2 \, x\right )} + 2 \, e^{x} + i\right )} \log \left (e^{x} - i\right ) - 2 \, e^{x}}{2 \, {\left (e^{\left (2 \, x\right )} + 2 i \, e^{x} - 1\right )}} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.23 \[ \int \frac {\tanh (x)}{i+\sinh (x)} \, dx=\operatorname {RootSum} {\left (4 z^{2} + 1, \left ( i \mapsto i \log {\left (2 i + e^{x} \right )} \right )\right )} - \frac {e^{x}}{e^{2 x} + 2 i e^{x} - 1} \]

[In]

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

[Out]

RootSum(4*_z**2 + 1, Lambda(_i, _i*log(2*_i + exp(x)))) - exp(x)/(exp(2*x) + 2*I*exp(x) - 1)

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. 42 vs. \(2 (18) = 36\).

Time = 0.23 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.62 \[ \int \frac {\tanh (x)}{i+\sinh (x)} \, dx=\frac {e^{\left (-x\right )}}{-2 i \, e^{\left (-x\right )} + e^{\left (-2 \, x\right )} - 1} + \frac {1}{2} i \, \log \left (i \, e^{\left (-x\right )} + 1\right ) - \frac {1}{2} i \, \log \left (i \, e^{\left (-x\right )} - 1\right ) \]

[In]

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

[Out]

e^(-x)/(-2*I*e^(-x) + e^(-2*x) - 1) + 1/2*I*log(I*e^(-x) + 1) - 1/2*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. 53 vs. \(2 (18) = 36\).

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.12 \[ \int \frac {\tanh (x)}{i+\sinh (x)} \, dx=\mathrm {atan}\left ({\mathrm {e}}^x\right )+\frac {1{}\mathrm {i}}{{\mathrm {e}}^{2\,x}-1+{\mathrm {e}}^x\,2{}\mathrm {i}}-\frac {1}{{\mathrm {e}}^x+1{}\mathrm {i}} \]

[In]

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

[Out]

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