\(\int \frac {\cosh ^2(x)}{i+\text {csch}(x)} \, dx\) [86]

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

Optimal result

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

[Out]

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

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {3957, 2918, 2718, 2715, 8} \[ \int \frac {\cosh ^2(x)}{i+\text {csch}(x)} \, dx=\frac {i x}{2}+\cosh (x)-\frac {1}{2} i \sinh (x) \cosh (x) \]

[In]

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

[Out]

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

Rule 8

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

Rule 2715

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Sin[c + d*x])^(n - 1)/(d*n))
, x] + Dist[b^2*((n - 1)/n), Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integ
erQ[2*n]

Rule 2718

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 2918

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

Rule 3957

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Int[(g*Co
s[e + f*x])^p*((b + a*Sin[e + f*x])^m/Sin[e + f*x]^m), x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]

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

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00 \[ \int \frac {\cosh ^2(x)}{i+\text {csch}(x)} \, dx=\frac {i x}{2}+\cosh (x)-\frac {1}{4} i \sinh (2 x) \]

[In]

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

[Out]

(I/2)*x + Cosh[x] - (I/4)*Sinh[2*x]

Maple [B] (verified)

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

Time = 9.22 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.50

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

[In]

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

[Out]

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

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. 31 vs. \(2 (12) = 24\).

Time = 0.25 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.55 \[ \int \frac {\cosh ^2(x)}{i+\text {csch}(x)} \, dx=\frac {1}{8} \, {\left (4 i \, x e^{\left (2 \, x\right )} - i \, e^{\left (4 \, x\right )} + 4 \, e^{\left (3 \, x\right )} + 4 \, e^{x} + i\right )} e^{\left (-2 \, x\right )} \]

[In]

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

[Out]

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

Sympy [F]

\[ \int \frac {\cosh ^2(x)}{i+\text {csch}(x)} \, dx=\int \frac {\cosh ^{2}{\left (x \right )}}{\operatorname {csch}{\left (x \right )} + i}\, dx \]

[In]

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

[Out]

Integral(cosh(x)**2/(csch(x) + I), x)

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. 30 vs. \(2 (12) = 24\).

Time = 0.17 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.50 \[ \int \frac {\cosh ^2(x)}{i+\text {csch}(x)} \, dx=\frac {1}{8} \, {\left (4 \, e^{\left (-x\right )} - i\right )} e^{\left (2 \, x\right )} + \frac {1}{2} i \, x + \frac {1}{2} \, e^{\left (-x\right )} + \frac {1}{8} i \, e^{\left (-2 \, x\right )} \]

[In]

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

[Out]

1/8*(4*e^(-x) - I)*e^(2*x) + 1/2*I*x + 1/2*e^(-x) + 1/8*I*e^(-2*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. 26 vs. \(2 (12) = 24\).

Time = 0.28 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.30 \[ \int \frac {\cosh ^2(x)}{i+\text {csch}(x)} \, dx=\frac {1}{8} \, {\left (4 \, e^{x} + i\right )} e^{\left (-2 \, x\right )} + \frac {1}{2} i \, x - \frac {1}{8} i \, e^{\left (2 \, x\right )} + \frac {1}{2} \, e^{x} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 2.21 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.45 \[ \int \frac {\cosh ^2(x)}{i+\text {csch}(x)} \, dx=\frac {{\mathrm {e}}^{-x}}{2}+\frac {{\mathrm {e}}^x}{2}+\frac {x\,1{}\mathrm {i}}{2}+\frac {{\mathrm {e}}^{-2\,x}\,1{}\mathrm {i}}{8}-\frac {{\mathrm {e}}^{2\,x}\,1{}\mathrm {i}}{8} \]

[In]

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

[Out]

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