\(\int \frac {\cosh ^2(x)}{i+\sinh (x)} \, dx\) [164]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 8 \[ \int \frac {\cosh ^2(x)}{i+\sinh (x)} \, dx=-i x+\cosh (x) \]

[Out]

-I*x+cosh(x)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 8, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {2761, 8} \[ \int \frac {\cosh ^2(x)}{i+\sinh (x)} \, dx=\cosh (x)-i x \]

[In]

Int[Cosh[x]^2/(I + Sinh[x]),x]

[Out]

(-I)*x + Cosh[x]

Rule 8

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

Rule 2761

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

Rubi steps \begin{align*} \text {integral}& = \cosh (x)-i \int 1 \, dx \\ & = -i x+\cosh (x) \\ \end{align*}

Mathematica [B] (verified)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(34\) vs. \(2(8)=16\).

Time = 0.04 (sec) , antiderivative size = 34, normalized size of antiderivative = 4.25 \[ \int \frac {\cosh ^2(x)}{i+\sinh (x)} \, dx=\cosh (x)+2 \arcsin \left (\frac {\sqrt {1-i \sinh (x)}}{\sqrt {2}}\right ) \sqrt {\cosh ^2(x)} \text {sech}(x) \]

[In]

Integrate[Cosh[x]^2/(I + Sinh[x]),x]

[Out]

Cosh[x] + 2*ArcSin[Sqrt[1 - I*Sinh[x]]/Sqrt[2]]*Sqrt[Cosh[x]^2]*Sech[x]

Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 15 vs. \(2 (7 ) = 14\).

Time = 7.89 (sec) , antiderivative size = 16, normalized size of antiderivative = 2.00

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

[In]

int(cosh(x)^2/(I+sinh(x)),x,method=_RETURNVERBOSE)

[Out]

-I*x+1/2*exp(x)+1/2*exp(-x)

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 17 vs. \(2 (6) = 12\).

Time = 0.27 (sec) , antiderivative size = 17, normalized size of antiderivative = 2.12 \[ \int \frac {\cosh ^2(x)}{i+\sinh (x)} \, dx=\frac {1}{2} \, {\left (-2 i \, x e^{x} + e^{\left (2 \, x\right )} + 1\right )} e^{\left (-x\right )} \]

[In]

integrate(cosh(x)^2/(I+sinh(x)),x, algorithm="fricas")

[Out]

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

Sympy [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 14 vs. \(2 (5) = 10\).

Time = 0.05 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.75 \[ \int \frac {\cosh ^2(x)}{i+\sinh (x)} \, dx=- i x + \frac {e^{x}}{2} + \frac {e^{- x}}{2} \]

[In]

integrate(cosh(x)**2/(I+sinh(x)),x)

[Out]

-I*x + exp(x)/2 + exp(-x)/2

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 14 vs. \(2 (6) = 12\).

Time = 0.19 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.75 \[ \int \frac {\cosh ^2(x)}{i+\sinh (x)} \, dx=-i \, x + \frac {1}{2} \, e^{\left (-x\right )} + \frac {1}{2} \, e^{x} \]

[In]

integrate(cosh(x)^2/(I+sinh(x)),x, algorithm="maxima")

[Out]

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

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 14 vs. \(2 (6) = 12\).

Time = 0.28 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.75 \[ \int \frac {\cosh ^2(x)}{i+\sinh (x)} \, dx=-i \, x + \frac {1}{2} \, e^{\left (-x\right )} + \frac {1}{2} \, e^{x} \]

[In]

integrate(cosh(x)^2/(I+sinh(x)),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 1.18 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.88 \[ \int \frac {\cosh ^2(x)}{i+\sinh (x)} \, dx=\mathrm {cosh}\left (x\right )-x\,1{}\mathrm {i} \]

[In]

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

[Out]

cosh(x) - x*1i