### 3.632 $$\int \frac{1}{(\text{sech}(x)+i \tanh (x))^4} \, dx$$

Optimal. Leaf size=38 $x+\frac{2 i \cosh ^3(x)}{3 (1+i \sinh (x))^3}-\frac{2 i \cosh (x)}{1+i \sinh (x)}$

[Out]

x + (((2*I)/3)*Cosh[x]^3)/(1 + I*Sinh[x])^3 - ((2*I)*Cosh[x])/(1 + I*Sinh[x])

________________________________________________________________________________________

Rubi [A]  time = 0.0774291, antiderivative size = 38, normalized size of antiderivative = 1., 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 = {4391, 2680, 8} $x+\frac{2 i \cosh ^3(x)}{3 (1+i \sinh (x))^3}-\frac{2 i \cosh (x)}{1+i \sinh (x)}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

x + (((2*I)/3)*Cosh[x]^3)/(1 + I*Sinh[x])^3 - ((2*I)*Cosh[x])/(1 + I*Sinh[x])

Rule 4391

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]

Rule 2680

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Simp[(2*g*(
g*Cos[e + f*x])^(p - 1)*(a + b*Sin[e + f*x])^(m + 1))/(b*f*(2*m + p + 1)), x] + Dist[(g^2*(p - 1))/(b^2*(2*m +
p + 1)), Int[(g*Cos[e + f*x])^(p - 2)*(a + b*Sin[e + f*x])^(m + 2), x], x] /; FreeQ[{a, b, e, f, g}, x] && Eq
Q[a^2 - b^2, 0] && LeQ[m, -2] && GtQ[p, 1] && NeQ[2*m + p + 1, 0] &&  !ILtQ[m + p + 1, 0] && IntegersQ[2*m, 2*
p]

Rule 8

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

Rubi steps

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

Mathematica [A]  time = 0.0745308, size = 75, normalized size = 1.97 $\frac{3 (3 x+8 i) \cosh \left (\frac{x}{2}\right )-(3 x+16 i) \cosh \left (\frac{3 x}{2}\right )+6 i \sinh \left (\frac{x}{2}\right ) (2 x+x \cosh (x)+4 i)}{6 \left (\cosh \left (\frac{x}{2}\right )+i \sinh \left (\frac{x}{2}\right )\right )^3}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.116, size = 41, normalized size = 1.1 \begin{align*} \ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) +{8\,i \left ( \tanh \left ({\frac{x}{2}} \right ) -i \right ) ^{-2}}-{\frac{16}{3} \left ( \tanh \left ({\frac{x}{2}} \right ) -i \right ) ^{-3}}-\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sech(x)+I*tanh(x))^4,x)

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.0918, size = 54, normalized size = 1.42 \begin{align*} x - \frac{24 \, e^{\left (-x\right )} - 24 i \, e^{\left (-2 \, x\right )} + 16 i}{9 \, e^{\left (-x\right )} - 9 i \, e^{\left (-2 \, x\right )} - 3 \, e^{\left (-3 \, x\right )} + 3 i} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x - (24*e^(-x) - 24*I*e^(-2*x) + 16*I)/(9*e^(-x) - 9*I*e^(-2*x) - 3*e^(-3*x) + 3*I)

________________________________________________________________________________________

Fricas [A]  time = 2.05434, size = 154, normalized size = 4.05 \begin{align*} \frac{3 \, x e^{\left (3 \, x\right )} +{\left (-9 i \, x - 24 i\right )} e^{\left (2 \, x\right )} - 3 \,{\left (3 \, x + 8\right )} e^{x} + 3 i \, x + 16 i}{3 \, e^{\left (3 \, x\right )} - 9 i \, e^{\left (2 \, x\right )} - 9 \, e^{x} + 3 i} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(3*x*e^(3*x) + (-9*I*x - 24*I)*e^(2*x) - 3*(3*x + 8)*e^x + 3*I*x + 16*I)/(3*e^(3*x) - 9*I*e^(2*x) - 9*e^x + 3*
I)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sech(x)+I*tanh(x))**4,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.13871, size = 30, normalized size = 0.79 \begin{align*} x - \frac{24 i \, e^{\left (2 \, x\right )} + 24 \, e^{x} - 16 i}{3 \,{\left (e^{x} - i\right )}^{3}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x - 1/3*(24*I*e^(2*x) + 24*e^x - 16*I)/(e^x - I)^3