3.9.30 \(\int \frac {a+b \sinh (x)}{b^2-2 a b \sinh (x)+a^2 \sinh ^2(x)} \, dx\) [830]

Optimal. Leaf size=12 \[ \frac {\cosh (x)}{b-a \sinh (x)} \]

[Out]

cosh(x)/(b-a*sinh(x))

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 12, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {3369, 2833, 8} \begin {gather*} \frac {\cosh (x)}{b-a \sinh (x)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*Sinh[x])/(b^2 - 2*a*b*Sinh[x] + a^2*Sinh[x]^2),x]

[Out]

Cosh[x]/(b - a*Sinh[x])

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2833

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

Rule 3369

Int[((A_) + (B_.)*sin[(d_.) + (e_.)*(x_)])*((a_) + (b_.)*sin[(d_.) + (e_.)*(x_)] + (c_.)*sin[(d_.) + (e_.)*(x_
)]^2)^(n_), x_Symbol] :> Dist[1/(4^n*c^n), Int[(A + B*Sin[d + e*x])*(b + 2*c*Sin[d + e*x])^(2*n), x], x] /; Fr
eeQ[{a, b, c, d, e, A, B}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[n]

Rubi steps

\begin {align*} \int \frac {a+b \sinh (x)}{b^2-2 a b \sinh (x)+a^2 \sinh ^2(x)} \, dx &=-\left (\left (4 a^2\right ) \int \frac {a+b \sinh (x)}{\left (2 i a b-2 i a^2 \sinh (x)\right )^2} \, dx\right )\\ &=\frac {\cosh (x)}{b-a \sinh (x)}-\frac {\int 0 \, dx}{a^2+b^2}\\ &=\frac {\cosh (x)}{b-a \sinh (x)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 14, normalized size = 1.17 \begin {gather*} -\frac {\cosh (x)}{-b+a \sinh (x)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sinh[x])/(b^2 - 2*a*b*Sinh[x] + a^2*Sinh[x]^2),x]

[Out]

-(Cosh[x]/(-b + a*Sinh[x]))

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(35\) vs. \(2(12)=24\).
time = 0.89, size = 36, normalized size = 3.00

method result size
risch \(-\frac {2 \left ({\mathrm e}^{x} b +a \right )}{a \left ({\mathrm e}^{2 x} a -2 \,{\mathrm e}^{x} b -a \right )}\) \(29\)
default \(-\frac {2 \left (-\frac {a \tanh \left (\frac {x}{2}\right )}{2 b}+\frac {1}{2}\right )}{\frac {b \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )}{2}+a \tanh \left (\frac {x}{2}\right )-\frac {b}{2}}\) \(36\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sinh(x))/(b^2-2*a*b*sinh(x)+a^2*sinh(x)^2),x,method=_RETURNVERBOSE)

[Out]

-2*(-1/2*a/b*tanh(1/2*x)+1/2)/(1/2*b*tanh(1/2*x)^2+a*tanh(1/2*x)-1/2*b)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 225 vs. \(2 (14) = 28\).
time = 0.48, size = 225, normalized size = 18.75 \begin {gather*} b {\left (\frac {a \log \left (\frac {a e^{\left (-x\right )} + b - \sqrt {a^{2} + b^{2}}}{a e^{\left (-x\right )} + b + \sqrt {a^{2} + b^{2}}}\right )}{{\left (a^{2} + b^{2}\right )}^{\frac {3}{2}}} + \frac {2 \, {\left (b^{2} e^{\left (-x\right )} - a b\right )}}{a^{4} + a^{2} b^{2} - 2 \, {\left (a^{3} b + a b^{3}\right )} e^{\left (-x\right )} - {\left (a^{4} + a^{2} b^{2}\right )} e^{\left (-2 \, x\right )}}\right )} - a {\left (\frac {b \log \left (\frac {a e^{\left (-x\right )} + b - \sqrt {a^{2} + b^{2}}}{a e^{\left (-x\right )} + b + \sqrt {a^{2} + b^{2}}}\right )}{{\left (a^{2} + b^{2}\right )}^{\frac {3}{2}}} - \frac {2 \, {\left (b e^{\left (-x\right )} - a\right )}}{a^{3} + a b^{2} - 2 \, {\left (a^{2} b + b^{3}\right )} e^{\left (-x\right )} - {\left (a^{3} + a b^{2}\right )} e^{\left (-2 \, x\right )}}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sinh(x))/(b^2-2*a*b*sinh(x)+a^2*sinh(x)^2),x, algorithm="maxima")

[Out]

b*(a*log((a*e^(-x) + b - sqrt(a^2 + b^2))/(a*e^(-x) + b + sqrt(a^2 + b^2)))/(a^2 + b^2)^(3/2) + 2*(b^2*e^(-x)
- a*b)/(a^4 + a^2*b^2 - 2*(a^3*b + a*b^3)*e^(-x) - (a^4 + a^2*b^2)*e^(-2*x))) - a*(b*log((a*e^(-x) + b - sqrt(
a^2 + b^2))/(a*e^(-x) + b + sqrt(a^2 + b^2)))/(a^2 + b^2)^(3/2) - 2*(b*e^(-x) - a)/(a^3 + a*b^2 - 2*(a^2*b + b
^3)*e^(-x) - (a^3 + a*b^2)*e^(-2*x)))

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 57 vs. \(2 (14) = 28\).
time = 0.39, size = 57, normalized size = 4.75 \begin {gather*} -\frac {2 \, {\left (b \cosh \left (x\right ) + b \sinh \left (x\right ) + a\right )}}{a^{2} \cosh \left (x\right )^{2} + a^{2} \sinh \left (x\right )^{2} - 2 \, a b \cosh \left (x\right ) - a^{2} + 2 \, {\left (a^{2} \cosh \left (x\right ) - a b\right )} \sinh \left (x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sinh(x))/(b^2-2*a*b*sinh(x)+a^2*sinh(x)^2),x, algorithm="fricas")

[Out]

-2*(b*cosh(x) + b*sinh(x) + a)/(a^2*cosh(x)^2 + a^2*sinh(x)^2 - 2*a*b*cosh(x) - a^2 + 2*(a^2*cosh(x) - a*b)*si
nh(x))

________________________________________________________________________________________

Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sinh(x))/(b**2-2*a*b*sinh(x)+a**2*sinh(x)**2),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]
time = 0.43, size = 28, normalized size = 2.33 \begin {gather*} -\frac {2 \, {\left (b e^{x} + a\right )}}{{\left (a e^{\left (2 \, x\right )} - 2 \, b e^{x} - a\right )} a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sinh(x))/(b^2-2*a*b*sinh(x)+a^2*sinh(x)^2),x, algorithm="giac")

[Out]

-2*(b*e^x + a)/((a*e^(2*x) - 2*b*e^x - a)*a)

________________________________________________________________________________________

Mupad [B]
time = 1.91, size = 48, normalized size = 4.00 \begin {gather*} \frac {\frac {2\,{\mathrm {e}}^x\,\left (a^3\,b+a\,b^3\right )}{a\,\left (a^3+a\,b^2\right )}+2}{a+2\,b\,{\mathrm {e}}^x-a\,{\mathrm {e}}^{2\,x}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*sinh(x))/(a^2*sinh(x)^2 + b^2 - 2*a*b*sinh(x)),x)

[Out]

((2*exp(x)*(a*b^3 + a^3*b))/(a*(a*b^2 + a^3)) + 2)/(a + 2*b*exp(x) - a*exp(2*x))

________________________________________________________________________________________