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+1/3*(3*I-2*csch(x))*tanh(x)+1/3*(I-csch(x))*tanh(x)^3

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 36, normalized size of antiderivative = 1.00, 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 8

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

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 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]

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.09, 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)

________________________________________________________________________________________

fricas [B]  time = 1.46, size = 51, normalized size = 1.42 \[ \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} \]

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)

________________________________________________________________________________________

giac [A]  time = 0.13, size = 38, normalized size = 1.06 \[ \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 ) \]

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)

________________________________________________________________________________________

maple [B]  time = 0.21, size = 67, normalized size = 1.86 \[ i \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )-i \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )+\frac {i}{2 \tanh \left (\frac {x}{2}\right )+2 i}+\frac {3 i}{2 \left (\tanh \left (\frac {x}{2}\right )-i\right )}+\frac {2 i}{3 \left (\tanh \left (\frac {x}{2}\right )-i\right )^{3}}+\frac {1}{\left (\tanh \left (\frac {x}{2}\right )-i\right )^{2}} \]

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)-I*ln(tanh(1/2*x)+1)+1/2*I/(tanh(1/2*x)+I)+3/2*I/(tanh(1/2*x)-I)+2/3*I/(tanh(1/2*x)-I)^3+1/
(tanh(1/2*x)-I)^2

________________________________________________________________________________________

maxima [A]  time = 0.31, size = 42, normalized size = 1.17 \[ -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} \]

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)

________________________________________________________________________________________

mupad [B]  time = 1.63, size = 85, normalized size = 2.36 \[ -x\,1{}\mathrm {i}+\frac {\frac {5\,{\mathrm {e}}^x}{6}-\frac {1}{2}{}\mathrm {i}}{1-{\mathrm {e}}^{2\,x}+{\mathrm {e}}^x\,2{}\mathrm {i}}-\frac {5}{6\,\left ({\mathrm {e}}^x-\mathrm {i}\right )}+\frac {1}{2\,\left ({\mathrm {e}}^x+1{}\mathrm {i}\right )}-\frac {\frac {5}{6}-\frac {5\,{\mathrm {e}}^{2\,x}}{6}+{\mathrm {e}}^x\,1{}\mathrm {i}}{{\mathrm {e}}^{2\,x}\,3{}\mathrm {i}-{\mathrm {e}}^{3\,x}+3\,{\mathrm {e}}^x-\mathrm {i}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

((5*exp(x))/6 - 1i/2)/(exp(x)*2i - exp(2*x) + 1) - x*1i - 5/(6*(exp(x) - 1i)) + 1/(2*(exp(x) + 1i)) - (exp(x)*
1i - (5*exp(2*x))/6 + 5/6)/(exp(2*x)*3i - exp(3*x) + 3*exp(x) - 1i)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\tanh ^{2}{\relax (x )}}{\operatorname {csch}{\relax (x )} + i}\, dx \]

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)

________________________________________________________________________________________