3.3.48 \(\int \frac {A+B \cosh (x)}{i-\sinh (x)} \, dx\) [248]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {4486, 2727, 2746, 31} \begin {gather*} \frac {A \cosh (x)}{1+i \sinh (x)}-B \log (-\sinh (x)+i) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, 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 2746

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^(m + (p - 1)/2)*(a - x)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& IntegerQ[(p - 1)/2] && EqQ[a^2 - b^2, 0] && (GeQ[p, -1] ||  !IntegerQ[m + 1/2])

Rule 4486

Int[u_, x_Symbol] :> With[{v = ExpandTrig[u, x]}, Int[v, x] /; SumQ[v]] /;  !InertTrigFreeQ[u]

Rubi steps

\begin {align*} \int \frac {A+B \cosh (x)}{i-\sinh (x)} \, dx &=\int \left (-\frac {i A}{1+i \sinh (x)}-\frac {i B \cosh (x)}{1+i \sinh (x)}\right ) \, dx\\ &=-\left ((i A) \int \frac {1}{1+i \sinh (x)} \, dx\right )-(i B) \int \frac {\cosh (x)}{1+i \sinh (x)} \, dx\\ &=\frac {A \cosh (x)}{1+i \sinh (x)}-B \text {Subst}\left (\int \frac {1}{1+x} \, dx,x,i \sinh (x)\right )\\ &=-B \log (i-\sinh (x))+\frac {A \cosh (x)}{1+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. \(81\) vs. \(2(27)=54\).
time = 0.07, size = 81, normalized size = 3.00 \begin {gather*} -\frac {\left (\cosh \left (\frac {x}{2}\right )+i \sinh \left (\frac {x}{2}\right )\right ) \left (B \cosh \left (\frac {x}{2}\right ) \left (2 \text {ArcTan}\left (\tanh \left (\frac {x}{2}\right )\right )-i \log (\cosh (x))\right )+\left (2 A+2 i B \text {ArcTan}\left (\tanh \left (\frac {x}{2}\right )\right )+B \log (\cosh (x))\right ) \sinh \left (\frac {x}{2}\right )\right )}{-i+\sinh (x)} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.59, size = 44, normalized size = 1.63

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 20, normalized size = 0.74 \begin {gather*} -B \log \left (\sinh \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*cosh(x))/(I-sinh(x)),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.46, size = 35, normalized size = 1.30 \begin {gather*} \frac {B x e^{x} - i \, B x - 2 \, {\left (B e^{x} - i \, B\right )} \log \left (e^{x} - i\right ) + 2 \, A}{e^{x} - i} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.08, size = 20, normalized size = 0.74 \begin {gather*} \frac {2 A}{e^{x} - i} + B x - 2 B \log {\left (e^{x} - i \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.12, size = 23, normalized size = 0.85 \begin {gather*} B\,x+\frac {2\,A}{{\mathrm {e}}^x-\mathrm {i}}-2\,B\,\ln \left ({\mathrm {e}}^x-\mathrm {i}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________