3.7.35 \(\int (\text {sech}(x)-i \tanh (x))^4 \, dx\) [635]

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

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {4476, 2749, 2759, 8} \begin {gather*} x+\frac {2 i \cosh ^3(x)}{3 (1+i \sinh (x))^3}-\frac {2 i \cosh (x)}{1+i \sinh (x)} \end {gather*}

Antiderivative was successfully verified.

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

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

Rule 2749

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Dist[(a/g)^
(2*m), Int[(g*Cos[e + f*x])^(2*m + p)/(a - b*Sin[e + f*x])^m, x], x] /; FreeQ[{a, b, e, f, g}, x] && EqQ[a^2 -
 b^2, 0] && IntegerQ[m] && LtQ[p, -1] && GeQ[2*m + p, 0]

Rule 2759

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 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 (\text {sech}(x)-i \tanh (x))^4 \, dx &=\int \text {sech}^4(x) (1-i \sinh (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.04, size = 75, normalized size = 1.97 \begin {gather*} \frac {3 (8 i+3 x) \cosh \left (\frac {x}{2}\right )-(16 i+3 x) \cosh \left (\frac {3 x}{2}\right )+6 i (4 i+2 x+x \cosh (x)) \sinh \left (\frac {x}{2}\right )}{6 \left (\cosh \left (\frac {x}{2}\right )+i \sinh \left (\frac {x}{2}\right )\right )^3} \end {gather*}

Antiderivative was successfully verified.

[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 = 1.45, size = 26, normalized size = 0.68

method result size
risch \(x -\frac {8 i \left (-3 i {\mathrm e}^{x}+3 \,{\mathrm e}^{2 x}-2\right )}{3 \left ({\mathrm e}^{x}-i\right )^{3}}\) \(26\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((sech(x)-I*tanh(x))^4,x,method=_RETURNVERBOSE)

[Out]

x-8/3*I*(-3*I*exp(x)+3*exp(2*x)-2)/(exp(x)-I)^3

________________________________________________________________________________________

Maxima [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 181 vs. \(2 (28) = 56\).
time = 0.26, size = 181, normalized size = 4.76 \begin {gather*} -2 \, \tanh \left (x\right )^{3} + x - \frac {4 \, {\left (3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + 2\right )}}{3 \, {\left (3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1\right )}} - \frac {8 i \, e^{\left (-x\right )}}{3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1} + \frac {4 \, e^{\left (-2 \, x\right )}}{3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1} - \frac {16 i \, e^{\left (-3 \, x\right )}}{3 \, {\left (3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1\right )}} - \frac {8 i \, e^{\left (-5 \, x\right )}}{3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1} + \frac {4}{3 \, {\left (3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1\right )}} + \frac {32 i}{3 \, {\left (e^{\left (-x\right )} + e^{x}\right )}^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((sech(x)-I*tanh(x))^4,x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.41, size = 52, normalized size = 1.37 \begin {gather*} \frac {3 \, x e^{\left (3 \, x\right )} - 3 \, {\left (3 i \, x + 8 i\right )} e^{\left (2 \, x\right )} - 3 \, {\left (3 \, x + 8\right )} e^{x} + 3 i \, x + 16 i}{3 \, {\left (e^{\left (3 \, x\right )} - 3 i \, e^{\left (2 \, x\right )} - 3 \, e^{x} + i\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((sech(x)-I*tanh(x))^4,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (- i \tanh {\left (x \right )} + \operatorname {sech}{\left (x \right )}\right )^{4}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((sech(x)-I*tanh(x))**4,x)

[Out]

Integral((-I*tanh(x) + sech(x))**4, x)

________________________________________________________________________________________

Giac [A]
time = 0.42, size = 22, normalized size = 0.58 \begin {gather*} x - \frac {8 \, {\left (3 i \, e^{\left (2 \, x\right )} + 3 \, e^{x} - 2 i\right )}}{3 \, {\left (e^{x} - i\right )}^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((sech(x)-I*tanh(x))^4,x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.13, size = 67, normalized size = 1.76 \begin {gather*} x+\frac {\frac {{\mathrm {e}}^{2\,x}\,8{}\mathrm {i}}{3}-\frac {8}{3}{}\mathrm {i}}{{\mathrm {e}}^{2\,x}\,3{}\mathrm {i}-{\mathrm {e}}^{3\,x}+3\,{\mathrm {e}}^x-\mathrm {i}}-\frac {8{}\mathrm {i}}{3\,\left ({\mathrm {e}}^x-\mathrm {i}\right )}+\frac {{\mathrm {e}}^x\,8{}\mathrm {i}}{3\,\left (1-{\mathrm {e}}^{2\,x}+{\mathrm {e}}^x\,2{}\mathrm {i}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________