3.42 \(\int \frac{\sinh ^2(x)}{i+\sinh (x)} \, dx\)

Optimal. Leaf size=22 \[ -i x+\cosh (x)+\frac{i \cosh (x)}{\sinh (x)+i} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0589099, antiderivative size = 22, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.231, Rules used = {2746, 2735, 2648} \[ -i x+\cosh (x)+\frac{i \cosh (x)}{\sinh (x)+i} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2746

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^2/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[(b^2
*Cos[e + f*x])/(d*f), x] + Dist[1/d, Int[Simp[a^2*d - b*(b*c - 2*a*d)*Sin[e + f*x], x]/(c + d*Sin[e + f*x]), x
], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]

Rule 2735

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*x)/d
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 2648

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> -Simp[Cos[c + d*x]/(d*(b + a*Sin[c + d*x])), x]
/; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rubi steps

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

Mathematica [B]  time = 0.105787, size = 79, normalized size = 3.59 \[ \frac{\cosh (x) \left (\sinh (x)+\frac{2 \sinh (x) \sin ^{-1}\left (\frac{\sqrt{1-i \sinh (x)}}{\sqrt{2}}\right )}{\sqrt{\cosh ^2(x)}}+\frac{2 i \sin ^{-1}\left (\frac{\sqrt{1-i \sinh (x)}}{\sqrt{2}}\right )}{\sqrt{\cosh ^2(x)}}+2 i\right )}{\sinh (x)+i} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(Cosh[x]*(2*I + ((2*I)*ArcSin[Sqrt[1 - I*Sinh[x]]/Sqrt[2]])/Sqrt[Cosh[x]^2] + Sinh[x] + (2*ArcSin[Sqrt[1 - I*S
inh[x]]/Sqrt[2]]*Sinh[x])/Sqrt[Cosh[x]^2]))/(I + Sinh[x])

________________________________________________________________________________________

Maple [B]  time = 0.031, size = 52, normalized size = 2.4 \begin{align*} -i\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) + \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) ^{-1}+i\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) - \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) ^{-1}+{2\,i \left ( \tanh \left ({\frac{x}{2}} \right ) +i \right ) ^{-1}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sinh(x)^2/(I+sinh(x)),x)

[Out]

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

________________________________________________________________________________________

Maxima [B]  time = 1.10202, size = 45, normalized size = 2.05 \begin{align*} -i \, x + \frac{10 \, e^{\left (-x\right )} - 2 i}{4 \,{\left (-i \, e^{\left (-x\right )} + e^{\left (-2 \, x\right )}\right )}} + \frac{1}{2} \, e^{\left (-x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B]  time = 2.01473, size = 103, normalized size = 4.68 \begin{align*} \frac{{\left (-2 i \, x + i\right )} e^{\left (2 \, x\right )} +{\left (2 \, x + 5\right )} e^{x} + e^{\left (3 \, x\right )} + i}{2 \,{\left (e^{\left (2 \, x\right )} + i \, e^{x}\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.212152, size = 20, normalized size = 0.91 \begin{align*} - i x + \frac{e^{x}}{2} + \frac{e^{- x}}{2} + \frac{2}{e^{x} + i} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.31539, size = 35, normalized size = 1.59 \begin{align*} -i \, x + \frac{{\left (5 \, e^{x} + i\right )} e^{\left (-x\right )}}{2 \,{\left (e^{x} + i\right )}} + \frac{1}{2} \, e^{x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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