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

Optimal. Leaf size=32 \[ x+\frac {i \cosh (x)}{3 (i+\sinh (x))^2}-\frac {5 \cosh (x)}{3 (i+\sinh (x))} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 32, normalized size of antiderivative = 1.00, 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 = {2837, 2814, 2727} \begin {gather*} x-\frac {5 \cosh (x)}{3 (\sinh (x)+i)}+\frac {i \cosh (x)}{3 (\sinh (x)+i)^2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2727

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]

Rule 2814

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 2837

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(74\) vs. \(2(32)=64\).
time = 0.06, size = 74, normalized size = 2.31 \begin {gather*} \frac {3 (-4 i+3 x) \cosh \left (\frac {x}{2}\right )+(10 i-3 x) \cosh \left (\frac {3 x}{2}\right )-6 i (-3 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[Sinh[x]^2/(I + Sinh[x])^2,x]

[Out]

(3*(-4*I + 3*x)*Cosh[x/2] + (10*I - 3*x)*Cosh[(3*x)/2] - (6*I)*(-3*I + 2*x + x*Cosh[x])*Sinh[x/2])/(6*(Cosh[x/
2] - I*Sinh[x/2])^3)

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 51 vs. \(2 (25 ) = 50\).
time = 0.59, size = 52, normalized size = 1.62

method result size
risch \(x +\frac {2 i \left (9 i {\mathrm e}^{x}+6 \,{\mathrm e}^{2 x}-5\right )}{3 \left ({\mathrm e}^{x}+i\right )^{3}}\) \(26\)
default \(-\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )-\frac {2 i}{\left (\tanh \left (\frac {x}{2}\right )+i\right )^{2}}-\frac {4}{3 \left (\tanh \left (\frac {x}{2}\right )+i\right )^{3}}-\frac {2}{\tanh \left (\frac {x}{2}\right )+i}+\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )\) \(52\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.30, size = 40, normalized size = 1.25 \begin {gather*} x - \frac {2 \, {\left (9 \, e^{\left (-x\right )} + 6 i \, e^{\left (-2 \, x\right )} - 5 i\right )}}{3 \, {\left (3 \, e^{\left (-x\right )} + 3 i \, e^{\left (-2 \, x\right )} - e^{\left (-3 \, x\right )} - i\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 50 vs. \(2 (22) = 44\).
time = 0.39, size = 50, normalized size = 1.56 \begin {gather*} \frac {3 \, x e^{\left (3 \, x\right )} - 3 \, {\left (-3 i \, x - 4 i\right )} e^{\left (2 \, x\right )} - 9 \, {\left (x + 2\right )} e^{x} - 3 i \, x - 10 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(sinh(x)^2/(I+sinh(x))^2,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.06, size = 41, normalized size = 1.28 \begin {gather*} x + \frac {12 i e^{2 x} - 18 e^{x} - 10 i}{3 e^{3 x} + 9 i e^{2 x} - 9 e^{x} - 3 i} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + (12*I*exp(2*x) - 18*exp(x) - 10*I)/(3*exp(3*x) + 9*I*exp(2*x) - 9*exp(x) - 3*I)

________________________________________________________________________________________

Giac [A]
time = 0.48, size = 22, normalized size = 0.69 \begin {gather*} x - \frac {2 \, {\left (-6 i \, e^{\left (2 \, x\right )} + 9 \, e^{x} + 5 i\right )}}{3 \, {\left (e^{x} + i\right )}^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.57, size = 71, normalized size = 2.22 \begin {gather*} x+\frac {-\frac {2}{3}+\frac {{\mathrm {e}}^x\,4{}\mathrm {i}}{3}}{{\mathrm {e}}^{2\,x}-1+{\mathrm {e}}^x\,2{}\mathrm {i}}-\frac {\frac {4\,{\mathrm {e}}^x}{3}-\frac {{\mathrm {e}}^{2\,x}\,4{}\mathrm {i}}{3}+\frac {4}{3}{}\mathrm {i}}{{\mathrm {e}}^{2\,x}\,3{}\mathrm {i}+{\mathrm {e}}^{3\,x}-3\,{\mathrm {e}}^x-\mathrm {i}}+\frac {4{}\mathrm {i}}{3\,\left ({\mathrm {e}}^x+1{}\mathrm {i}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________