3.247 \(\int \frac{A+B \cosh (x)}{i+\sinh (x)} \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0830601, antiderivative size = 25, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.267, Rules used = {4401, 2648, 2667, 31} \[ B \log (\sinh (x)+i)-\frac{A \cosh (x)}{1-i \sinh (x)} \]

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 4401

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

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]

Rule 2667

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 31

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

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\\ &=(i A) \int \frac{1}{-1+i \sinh (x)} \, dx+(i B) \int \frac{\cosh (x)}{-1+i \sinh (x)} \, dx\\ &=-\frac{A \cosh (x)}{1-i \sinh (x)}+B \operatorname{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 [A]  time = 0.0658703, size = 48, normalized size = 1.92 \[ -\frac{2 i A \sinh \left (\frac{x}{2}\right )}{\cosh \left (\frac{x}{2}\right )-i \sinh \left (\frac{x}{2}\right )}-2 i B \tan ^{-1}\left (\tanh \left (\frac{x}{2}\right )\right )+B \log (\cosh (x)) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.032, size = 46, normalized size = 1.8 \begin{align*} -B\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) -B\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) +2\,B\ln \left ( \tanh \left ( x/2 \right ) +i \right ) -{2\,iA \left ( \tanh \left ({\frac{x}{2}} \right ) +i \right ) ^{-1}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.03481, size = 26, normalized size = 1.04 \begin{align*} B \log \left (\sinh \left (x\right ) + i\right ) - \frac{2 \, A}{e^{\left (-x\right )} - i} \end{align*}

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 = 2.04706, size = 90, normalized size = 3.6 \begin{align*} -\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{align*}

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 = 1.3108, size = 20, normalized size = 0.8 \begin{align*} - \frac{2 A}{e^{x} + i} - B x + 2 B \log{\left (e^{x} + i \right )} \end{align*}

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 = 1.13634, size = 30, normalized size = 1.2 \begin{align*} -B x + 2 \, B \log \left (e^{x} + i\right ) - \frac{2 \, A}{e^{x} + i} \end{align*}

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)