3.211 \(\int \frac{\tanh (x)}{i+\sinh (x)} \, dx\)

Optimal. Leaf size=26 \[ \frac{1}{2} i \text{sech}^2(x)+\frac{1}{2} \tan ^{-1}(\sinh (x))-\frac{1}{2} \tanh (x) \text{sech}(x) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0551926, antiderivative size = 26, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.454, Rules used = {2706, 2606, 30, 2611, 3770} \[ \frac{1}{2} i \text{sech}^2(x)+\frac{1}{2} \tan ^{-1}(\sinh (x))-\frac{1}{2} \tanh (x) \text{sech}(x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2706

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 2606

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 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2611

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 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

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

Mathematica [A]  time = 0.0204506, size = 20, normalized size = 0.77 \[ \frac{1}{2} \tan ^{-1}(\sinh (x))-\frac{1}{2 (\sinh (x)+i)} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B]  time = 0.032, size = 45, normalized size = 1.7 \begin{align*} -{\frac{i}{2}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -i \right ) -{i \left ( \tanh \left ({\frac{x}{2}} \right ) +i \right ) ^{-2}}+{\frac{i}{2}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +i \right ) + \left ( \tanh \left ({\frac{x}{2}} \right ) +i \right ) ^{-1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*I*ln(tanh(1/2*x)-I)-I/(tanh(1/2*x)+I)^2+1/2*I*ln(tanh(1/2*x)+I)+1/(tanh(1/2*x)+I)

________________________________________________________________________________________

Maxima [B]  time = 1.16807, size = 57, normalized size = 2.19 \begin{align*} \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 ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________

Fricas [B]  time = 2.13283, size = 157, normalized size = 6.04 \begin{align*} \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 )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[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]  time = 0.269696, size = 32, normalized size = 1.23 \begin{align*} \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} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________

Giac [B]  time = 1.08919, size = 72, normalized size = 2.77 \begin{align*} \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 ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[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)