3.7.29 \(\int \frac {1}{\text {sech}(x)+i \tanh (x)} \, dx\) [629]

Optimal. Leaf size=13 \[ -i \log (i-\sinh (x)) \]

[Out]

-I*ln(I-sinh(x))

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 13, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {3238, 2746, 31} \begin {gather*} -i \log (-\sinh (x)+i) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(-I)*Log[I - Sinh[x]]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

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 3238

Int[((a_.) + (b_.)*sec[(d_.) + (e_.)*(x_)] + (c_.)*tan[(d_.) + (e_.)*(x_)])^(-1), x_Symbol] :> Int[Cos[d + e*x
]/(b + a*Cos[d + e*x] + c*Sin[d + e*x]), x] /; FreeQ[{a, b, c, d, e}, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 17, normalized size = 1.31 \begin {gather*} 2 \text {ArcTan}\left (\tanh \left (\frac {x}{2}\right )\right )-i \log (\cosh (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

2*ArcTan[Tanh[x/2]] - I*Log[Cosh[x]]

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 32 vs. \(2 (11 ) = 22\).
time = 1.47, size = 33, normalized size = 2.54

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sech(x)+I*tanh(x)),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 15, normalized size = 1.15 \begin {gather*} -i \, x - 2 i \, \log \left (i \, e^{\left (-x\right )} - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.40, size = 11, normalized size = 0.85 \begin {gather*} i \, x - 2 i \, \log \left (e^{x} - i\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

I*x - 2*I*log(e^x - I)

________________________________________________________________________________________

Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 22 vs. \(2 (8) = 16\).
time = 0.10, size = 22, normalized size = 1.69 \begin {gather*} - i x + i \log {\left (\tanh {\left (x \right )} + 1 \right )} - i \log {\left (\tanh {\left (x \right )} - i \operatorname {sech}{\left (x \right )} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-I*x + I*log(tanh(x) + 1) - I*log(tanh(x) - I*sech(x))

________________________________________________________________________________________

Giac [A]
time = 0.42, size = 13, normalized size = 1.00 \begin {gather*} i \, x - 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)),x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 1.56, size = 14, normalized size = 1.08 \begin {gather*} x\,1{}\mathrm {i}-\ln \left ({\mathrm {e}}^x-\mathrm {i}\right )\,2{}\mathrm {i} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(tanh(x)*1i + 1/cosh(x)),x)

[Out]

x*1i - log(exp(x) - 1i)*2i

________________________________________________________________________________________