3.2.19 \(\int \frac {A+B \sinh (x)}{i-\sinh (x)} \, dx\) [119]

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

[Out]

-B*x+(I*A-B)*cosh(x)/(I-sinh(x))

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {2814, 2727} \begin {gather*} -B x+\frac {(-B+i A) \cosh (x)}{-\sinh (x)+i} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(A + B*Sinh[x])/(I - Sinh[x]),x]

[Out]

-(B*x) + ((I*A - B)*Cosh[x])/(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]

Rubi steps

\begin {align*} \int \frac {A+B \sinh (x)}{i-\sinh (x)} \, dx &=-B x+(A+i B) \int \frac {1}{i-\sinh (x)} \, dx\\ &=-B x+\frac {(i A-B) \cosh (x)}{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. \(59\) vs. \(2(27)=54\).
time = 0.06, size = 59, normalized size = 2.19 \begin {gather*} \frac {\left (i \cosh \left (\frac {x}{2}\right )-\sinh \left (\frac {x}{2}\right )\right ) \left (B x \cosh \left (\frac {x}{2}\right )+i (2 A+B (2 i+x)) \sinh \left (\frac {x}{2}\right )\right )}{-i+\sinh (x)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(A + B*Sinh[x])/(I - Sinh[x]),x]

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.44, size = 39, normalized size = 1.44

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*sinh(x))/(I-sinh(x)),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 27, normalized size = 1.00 \begin {gather*} -B {\left (x - \frac {2 i}{e^{\left (-x\right )} + i}\right )} + \frac {2 \, A}{e^{\left (-x\right )} + i} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sinh(x))/(I-sinh(x)),x, algorithm="maxima")

[Out]

-B*(x - 2*I/(e^(-x) + I)) + 2*A/(e^(-x) + I)

________________________________________________________________________________________

Fricas [A]
time = 0.42, size = 24, normalized size = 0.89 \begin {gather*} -\frac {B x e^{x} - i \, B x - 2 \, A - 2 i \, B}{e^{x} - i} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sinh(x))/(I-sinh(x)),x, algorithm="fricas")

[Out]

-(B*x*e^x - I*B*x - 2*A - 2*I*B)/(e^x - I)

________________________________________________________________________________________

Sympy [A]
time = 0.06, size = 15, normalized size = 0.56 \begin {gather*} - B x + \frac {2 A + 2 i B}{e^{x} - i} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sinh(x))/(I-sinh(x)),x)

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.41, size = 18, normalized size = 0.67 \begin {gather*} -B x + \frac {2 \, {\left (A + i \, B\right )}}{e^{x} - i} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sinh(x))/(I-sinh(x)),x, algorithm="giac")

[Out]

-B*x + 2*(A + I*B)/(e^x - I)

________________________________________________________________________________________

Mupad [B]
time = 0.11, size = 21, normalized size = 0.78 \begin {gather*} -B\,x+\frac {2\,A+B\,2{}\mathrm {i}}{{\mathrm {e}}^x-\mathrm {i}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(A + B*sinh(x))/(sinh(x) - 1i),x)

[Out]

(2*A + B*2i)/(exp(x) - 1i) - B*x

________________________________________________________________________________________