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

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

Optimal result

Integrand size = 13, antiderivative size = 32 \[ \int \frac {\sinh ^2(x)}{(i+\sinh (x))^2} \, dx=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] (verified)

Time = 0.04 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {2837, 2814, 2727} \[ \int \frac {\sinh ^2(x)}{(i+\sinh (x))^2} \, dx=x-\frac {5 \cosh (x)}{3 (\sinh (x)+i)}+\frac {i \cosh (x)}{3 (\sinh (x)+i)^2} \]

[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*} \text {integral}& = \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 [A] (verified)

Time = 0.11 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.72 \[ \int \frac {\sinh ^2(x)}{(i+\sinh (x))^2} \, dx=-\frac {1}{3} i \cosh (x) \left (-\frac {6 \arcsin \left (\frac {\sqrt {1-i \sinh (x)}}{\sqrt {2}}\right )}{\sqrt {\cosh ^2(x)}}+\frac {4-5 i \sinh (x)}{(i+\sinh (x))^2}\right ) \]

[In]

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

[Out]

(-1/3*I)*Cosh[x]*((-6*ArcSin[Sqrt[1 - I*Sinh[x]]/Sqrt[2]])/Sqrt[Cosh[x]^2] + (4 - (5*I)*Sinh[x])/(I + Sinh[x])
^2)

Maple [A] (verified)

Time = 1.66 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.81

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 \(-\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 )+\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )\) \(52\)
parallelrisch \(\frac {\left (-3 \tanh \left (\frac {x}{2}\right )^{3}-9 i \tanh \left (\frac {x}{2}\right )^{2}+9 \tanh \left (\frac {x}{2}\right )+3 i\right ) \ln \left (1-\tanh \left (\frac {x}{2}\right )\right )+\left (3 \tanh \left (\frac {x}{2}\right )^{3}+9 i \tanh \left (\frac {x}{2}\right )^{2}-9 \tanh \left (\frac {x}{2}\right )-3 i\right ) \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )-2 i \tanh \left (\frac {x}{2}\right )^{3}-12 i \tanh \left (\frac {x}{2}\right )+6}{3 \tanh \left (\frac {x}{2}\right )^{3}+9 i \tanh \left (\frac {x}{2}\right )^{2}-9 \tanh \left (\frac {x}{2}\right )-3 i}\) \(118\)

[In]

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

[Out]

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

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. 50 vs. \(2 (22) = 44\).

Time = 0.24 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.56 \[ \int \frac {\sinh ^2(x)}{(i+\sinh (x))^2} \, dx=\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 )}} \]

[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] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.28 \[ \int \frac {\sinh ^2(x)}{(i+\sinh (x))^2} \, dx=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} \]

[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)

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 40, normalized size of antiderivative = 1.25 \[ \int \frac {\sinh ^2(x)}{(i+\sinh (x))^2} \, dx=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 )}} \]

[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)

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.69 \[ \int \frac {\sinh ^2(x)}{(i+\sinh (x))^2} \, dx=x - \frac {2 \, {\left (-6 i \, e^{\left (2 \, x\right )} + 9 \, e^{x} + 5 i\right )}}{3 \, {\left (e^{x} + i\right )}^{3}} \]

[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] (verification not implemented)

Time = 1.30 (sec) , antiderivative size = 71, normalized size of antiderivative = 2.22 \[ \int \frac {\sinh ^2(x)}{(i+\sinh (x))^2} \, dx=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 )} \]

[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))