3.7.41 \(\int \frac {1}{(\text {sech}(x)-i \tanh (x))^3} \, dx\) [641]

Optimal. Leaf size=26 \[ -i \log (i+\sinh (x))-\frac {2 i}{1-i \sinh (x)} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {4476, 2746, 45} \begin {gather*} -\frac {2 i}{1-i \sinh (x)}-i \log (\sinh (x)+i) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(Sech[x] - I*Tanh[x])^(-3),x]

[Out]

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

Rule 45

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, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 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])

Rule 4476

Int[(u_.)*((b_.)*sec[(c_.) + (d_.)*(x_)]^(n_.) + (a_.)*tan[(c_.) + (d_.)*(x_)]^(n_.))^(p_), x_Symbol] :> Int[A
ctivateTrig[u]*Sec[c + d*x]^(n*p)*(b + a*Sin[c + d*x]^n)^p, x] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p]

Rubi steps

\begin {align*} \int \frac {1}{(\text {sech}(x)-i \tanh (x))^3} \, dx &=\int \frac {\cosh ^3(x)}{(1-i \sinh (x))^3} \, dx\\ &=i \text {Subst}\left (\int \frac {1-x}{(1+x)^2} \, dx,x,-i \sinh (x)\right )\\ &=i \text {Subst}\left (\int \left (\frac {1}{-1-x}+\frac {2}{(1+x)^2}\right ) \, dx,x,-i \sinh (x)\right )\\ &=-i \log (i+\sinh (x))-\frac {2 i}{1-i \sinh (x)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 27, normalized size = 1.04 \begin {gather*} -2 \text {ArcTan}\left (\tanh \left (\frac {x}{2}\right )\right )-i \log (\cosh (x))+\frac {2}{i+\sinh (x)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(Sech[x] - I*Tanh[x])^(-3),x]

[Out]

-2*ArcTan[Tanh[x/2]] - I*Log[Cosh[x]] + 2/(I + Sinh[x])

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 55 vs. \(2 (22 ) = 44\).
time = 2.25, size = 56, normalized size = 2.15

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sech(x)-I*tanh(x))^3,x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 33, normalized size = 1.27 \begin {gather*} -i \, x - \frac {4 \, e^{\left (-x\right )}}{-2 i \, e^{\left (-x\right )} + e^{\left (-2 \, x\right )} - 1} - 2 i \, \log \left (e^{\left (-x\right )} - i\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sech(x)-I*tanh(x))^3,x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 50 vs. \(2 (18) = 36\).
time = 0.41, size = 50, normalized size = 1.92 \begin {gather*} \frac {i \, x e^{\left (2 \, x\right )} - 2 \, {\left (x - 2\right )} e^{x} - 2 \, {\left (i \, e^{\left (2 \, x\right )} - 2 \, e^{x} - i\right )} \log \left (e^{x} + i\right ) - i \, x}{e^{\left (2 \, x\right )} + 2 i \, e^{x} - 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sech(x)-I*tanh(x))^3,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 432 vs. \(2 (19) = 38\).
time = 0.82, size = 432, normalized size = 16.62 \begin {gather*} \frac {2 i x \tanh ^{2}{\left (x \right )}}{- 2 \tanh ^{2}{\left (x \right )} - 4 i \tanh {\left (x \right )} \operatorname {sech}{\left (x \right )} + 2 \operatorname {sech}^{2}{\left (x \right )}} - \frac {4 x \tanh {\left (x \right )} \operatorname {sech}{\left (x \right )}}{- 2 \tanh ^{2}{\left (x \right )} - 4 i \tanh {\left (x \right )} \operatorname {sech}{\left (x \right )} + 2 \operatorname {sech}^{2}{\left (x \right )}} - \frac {2 i x \operatorname {sech}^{2}{\left (x \right )}}{- 2 \tanh ^{2}{\left (x \right )} - 4 i \tanh {\left (x \right )} \operatorname {sech}{\left (x \right )} + 2 \operatorname {sech}^{2}{\left (x \right )}} - \frac {2 i \log {\left (\tanh {\left (x \right )} + 1 \right )} \tanh ^{2}{\left (x \right )}}{- 2 \tanh ^{2}{\left (x \right )} - 4 i \tanh {\left (x \right )} \operatorname {sech}{\left (x \right )} + 2 \operatorname {sech}^{2}{\left (x \right )}} + \frac {4 \log {\left (\tanh {\left (x \right )} + 1 \right )} \tanh {\left (x \right )} \operatorname {sech}{\left (x \right )}}{- 2 \tanh ^{2}{\left (x \right )} - 4 i \tanh {\left (x \right )} \operatorname {sech}{\left (x \right )} + 2 \operatorname {sech}^{2}{\left (x \right )}} + \frac {2 i \log {\left (\tanh {\left (x \right )} + 1 \right )} \operatorname {sech}^{2}{\left (x \right )}}{- 2 \tanh ^{2}{\left (x \right )} - 4 i \tanh {\left (x \right )} \operatorname {sech}{\left (x \right )} + 2 \operatorname {sech}^{2}{\left (x \right )}} + \frac {2 i \log {\left (\tanh {\left (x \right )} + i \operatorname {sech}{\left (x \right )} \right )} \tanh ^{2}{\left (x \right )}}{- 2 \tanh ^{2}{\left (x \right )} - 4 i \tanh {\left (x \right )} \operatorname {sech}{\left (x \right )} + 2 \operatorname {sech}^{2}{\left (x \right )}} - \frac {4 \log {\left (\tanh {\left (x \right )} + i \operatorname {sech}{\left (x \right )} \right )} \tanh {\left (x \right )} \operatorname {sech}{\left (x \right )}}{- 2 \tanh ^{2}{\left (x \right )} - 4 i \tanh {\left (x \right )} \operatorname {sech}{\left (x \right )} + 2 \operatorname {sech}^{2}{\left (x \right )}} - \frac {2 i \log {\left (\tanh {\left (x \right )} + i \operatorname {sech}{\left (x \right )} \right )} \operatorname {sech}^{2}{\left (x \right )}}{- 2 \tanh ^{2}{\left (x \right )} - 4 i \tanh {\left (x \right )} \operatorname {sech}{\left (x \right )} + 2 \operatorname {sech}^{2}{\left (x \right )}} - \frac {i \tanh ^{2}{\left (x \right )}}{- 2 \tanh ^{2}{\left (x \right )} - 4 i \tanh {\left (x \right )} \operatorname {sech}{\left (x \right )} + 2 \operatorname {sech}^{2}{\left (x \right )}} - \frac {i \operatorname {sech}^{2}{\left (x \right )}}{- 2 \tanh ^{2}{\left (x \right )} - 4 i \tanh {\left (x \right )} \operatorname {sech}{\left (x \right )} + 2 \operatorname {sech}^{2}{\left (x \right )}} - \frac {i}{- 2 \tanh ^{2}{\left (x \right )} - 4 i \tanh {\left (x \right )} \operatorname {sech}{\left (x \right )} + 2 \operatorname {sech}^{2}{\left (x \right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sech(x)-I*tanh(x))**3,x)

[Out]

2*I*x*tanh(x)**2/(-2*tanh(x)**2 - 4*I*tanh(x)*sech(x) + 2*sech(x)**2) - 4*x*tanh(x)*sech(x)/(-2*tanh(x)**2 - 4
*I*tanh(x)*sech(x) + 2*sech(x)**2) - 2*I*x*sech(x)**2/(-2*tanh(x)**2 - 4*I*tanh(x)*sech(x) + 2*sech(x)**2) - 2
*I*log(tanh(x) + 1)*tanh(x)**2/(-2*tanh(x)**2 - 4*I*tanh(x)*sech(x) + 2*sech(x)**2) + 4*log(tanh(x) + 1)*tanh(
x)*sech(x)/(-2*tanh(x)**2 - 4*I*tanh(x)*sech(x) + 2*sech(x)**2) + 2*I*log(tanh(x) + 1)*sech(x)**2/(-2*tanh(x)*
*2 - 4*I*tanh(x)*sech(x) + 2*sech(x)**2) + 2*I*log(tanh(x) + I*sech(x))*tanh(x)**2/(-2*tanh(x)**2 - 4*I*tanh(x
)*sech(x) + 2*sech(x)**2) - 4*log(tanh(x) + I*sech(x))*tanh(x)*sech(x)/(-2*tanh(x)**2 - 4*I*tanh(x)*sech(x) +
2*sech(x)**2) - 2*I*log(tanh(x) + I*sech(x))*sech(x)**2/(-2*tanh(x)**2 - 4*I*tanh(x)*sech(x) + 2*sech(x)**2) -
 I*tanh(x)**2/(-2*tanh(x)**2 - 4*I*tanh(x)*sech(x) + 2*sech(x)**2) - I*sech(x)**2/(-2*tanh(x)**2 - 4*I*tanh(x)
*sech(x) + 2*sech(x)**2) - I/(-2*tanh(x)**2 - 4*I*tanh(x)*sech(x) + 2*sech(x)**2)

________________________________________________________________________________________

Giac [A]
time = 0.42, size = 27, normalized size = 1.04 \begin {gather*} \frac {4 \, e^{x}}{{\left (e^{x} + i\right )}^{2}} + i \, \log \left (-i \, e^{x}\right ) - 2 i \, \log \left (i \, e^{x} - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sech(x)-I*tanh(x))^3,x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.17, size = 39, normalized size = 1.50 \begin {gather*} x\,1{}\mathrm {i}-\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )\,2{}\mathrm {i}-\frac {4{}\mathrm {i}}{{\mathrm {e}}^{2\,x}-1+{\mathrm {e}}^x\,2{}\mathrm {i}}+\frac {4}{{\mathrm {e}}^x+1{}\mathrm {i}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-1/(tanh(x)*1i - 1/cosh(x))^3,x)

[Out]

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

________________________________________________________________________________________