3.105 \(\int \frac{\tanh ^2(x)}{i+\text{csch}(x)} \, dx\)

Optimal. Leaf size=36 \[ -i x+\frac{1}{3} \tanh ^3(x) (-\text{csch}(x)+i)+\frac{1}{3} \tanh (x) (-2 \text{csch}(x)+3 i) \]

[Out]

(-I)*x + ((3*I - 2*Csch[x])*Tanh[x])/3 + ((I - Csch[x])*Tanh[x]^3)/3

________________________________________________________________________________________

Rubi [A]  time = 0.0732533, antiderivative size = 36, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.231, Rules used = {3888, 3882, 8} \[ -i x+\frac{1}{3} \tanh ^3(x) (-\text{csch}(x)+i)+\frac{1}{3} \tanh (x) (-2 \text{csch}(x)+3 i) \]

Antiderivative was successfully verified.

[In]

Int[Tanh[x]^2/(I + Csch[x]),x]

[Out]

(-I)*x + ((3*I - 2*Csch[x])*Tanh[x])/3 + ((I - Csch[x])*Tanh[x]^3)/3

Rule 3888

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Dist[a^(2*n
)/e^(2*n), Int[(e*Cot[c + d*x])^(m + 2*n)/(-a + b*Csc[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && E
qQ[a^2 - b^2, 0] && ILtQ[n, 0]

Rule 3882

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> -Simp[((e*Cot[c
+ d*x])^(m + 1)*(a + b*Csc[c + d*x]))/(d*e*(m + 1)), x] - Dist[1/(e^2*(m + 1)), Int[(e*Cot[c + d*x])^(m + 2)*(
a*(m + 1) + b*(m + 2)*Csc[c + d*x]), x], x] /; FreeQ[{a, b, c, d, e}, x] && LtQ[m, -1]

Rule 8

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

Rubi steps

\begin{align*} \int \frac{\tanh ^2(x)}{i+\text{csch}(x)} \, dx &=\int (-i+\text{csch}(x)) \tanh ^4(x) \, dx\\ &=\frac{1}{3} (i-\text{csch}(x)) \tanh ^3(x)-\frac{1}{3} \int (3 i-2 \text{csch}(x)) \tanh ^2(x) \, dx\\ &=\frac{1}{3} (3 i-2 \text{csch}(x)) \tanh (x)+\frac{1}{3} (i-\text{csch}(x)) \tanh ^3(x)+\frac{1}{3} \int -3 i \, dx\\ &=-i x+\frac{1}{3} (3 i-2 \text{csch}(x)) \tanh (x)+\frac{1}{3} (i-\text{csch}(x)) \tanh ^3(x)\\ \end{align*}

Mathematica [A]  time = 0.0836784, size = 71, normalized size = 1.97 \[ \frac{2 i \sinh (x)-4 \cosh (2 x)+(6 x+5 i) (\sinh (x)-i) \cosh (x)}{6 \left (\cosh \left (\frac{x}{2}\right )-i \sinh \left (\frac{x}{2}\right )\right ) \left (\cosh \left (\frac{x}{2}\right )+i \sinh \left (\frac{x}{2}\right )\right )^3} \]

Antiderivative was successfully verified.

[In]

Integrate[Tanh[x]^2/(I + Csch[x]),x]

[Out]

(-4*Cosh[2*x] + (2*I)*Sinh[x] + (5*I + 6*x)*Cosh[x]*(-I + Sinh[x]))/(6*(Cosh[x/2] - I*Sinh[x/2])*(Cosh[x/2] +
I*Sinh[x/2])^3)

________________________________________________________________________________________

Maple [B]  time = 0.047, size = 67, normalized size = 1.9 \begin{align*} -i\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) +{{\frac{3\,i}{2}} \left ( \tanh \left ({\frac{x}{2}} \right ) -i \right ) ^{-1}}+{{\frac{2\,i}{3}} \left ( \tanh \left ({\frac{x}{2}} \right ) -i \right ) ^{-3}}+ \left ( \tanh \left ({\frac{x}{2}} \right ) -i \right ) ^{-2}+i\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) +{{\frac{i}{2}} \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)^2/(I+csch(x)),x)

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.00852, size = 57, normalized size = 1.58 \begin{align*} -i \, x - \frac{10 \, e^{\left (-x\right )} + 6 \, e^{\left (-3 \, x\right )} + 8 i}{6 i \, e^{\left (-x\right )} + 6 i \, e^{\left (-3 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} - 3} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(x)^2/(I+csch(x)),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [B]  time = 1.6519, size = 149, normalized size = 4.14 \begin{align*} \frac{-3 i \, x e^{\left (4 \, x\right )} - 6 \,{\left (x + 1\right )} e^{\left (3 \, x\right )} - 2 \,{\left (3 \, x + 5\right )} e^{x} + 3 i \, x + 8 i}{3 \, e^{\left (4 \, x\right )} - 6 i \, e^{\left (3 \, x\right )} - 6 i \, e^{x} - 3} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(x)^2/(I+csch(x)),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\tanh ^{2}{\left (x \right )}}{\operatorname{csch}{\left (x \right )} + i}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(x)**2/(I+csch(x)),x)

[Out]

Integral(tanh(x)**2/(csch(x) + I), x)

________________________________________________________________________________________

Giac [A]  time = 1.17459, size = 51, normalized size = 1.42 \begin{align*} \frac{i}{2 \,{\left (i \, e^{x} - 1\right )}} - \frac{15 \, e^{\left (2 \, x\right )} - 24 i \, e^{x} - 13}{6 \,{\left (e^{x} - i\right )}^{3}} - i \, \log \left (i \, e^{x}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(x)^2/(I+csch(x)),x, algorithm="giac")

[Out]

1/2*I/(I*e^x - 1) - 1/6*(15*e^(2*x) - 24*I*e^x - 13)/(e^x - I)^3 - I*log(I*e^x)