3.129 \(\int \frac {A+B \sinh (x)}{a+b \sinh (x)} \, dx\)

Optimal. Leaf size=55 \[ \frac {B x}{b}-\frac {2 (A b-a B) \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{b \sqrt {a^2+b^2}} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {2735, 2660, 618, 206} \[ \frac {B x}{b}-\frac {2 (A b-a B) \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{b \sqrt {a^2+b^2}} \]

Antiderivative was successfully verified.

[In]

Int[(A + B*Sinh[x])/(a + b*Sinh[x]),x]

[Out]

(B*x)/b - (2*(A*b - a*B)*ArcTanh[(b - a*Tanh[x/2])/Sqrt[a^2 + b^2]])/(b*Sqrt[a^2 + b^2])

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 2660

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x]}, Dis
t[(2*e)/d, Subst[Int[1/(a + 2*b*e*x + a*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] &&
 NeQ[a^2 - b^2, 0]

Rule 2735

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)}{a+b \sinh (x)} \, dx &=\frac {B x}{b}-\frac {(i (i A b-i a B)) \int \frac {1}{a+b \sinh (x)} \, dx}{b}\\ &=\frac {B x}{b}-\frac {(2 i (i A b-i a B)) \operatorname {Subst}\left (\int \frac {1}{a+2 b x-a x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{b}\\ &=\frac {B x}{b}+\frac {(4 i (i A b-i a B)) \operatorname {Subst}\left (\int \frac {1}{4 \left (a^2+b^2\right )-x^2} \, dx,x,2 b-2 a \tanh \left (\frac {x}{2}\right )\right )}{b}\\ &=\frac {B x}{b}-\frac {2 (A b-a B) \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{b \sqrt {a^2+b^2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.11, size = 61, normalized size = 1.11 \[ \frac {\frac {2 (A b-a B) \tan ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {-a^2-b^2}}\right )}{\sqrt {-a^2-b^2}}+B x}{b} \]

Antiderivative was successfully verified.

[In]

Integrate[(A + B*Sinh[x])/(a + b*Sinh[x]),x]

[Out]

(B*x + (2*(A*b - a*B)*ArcTan[(b - a*Tanh[x/2])/Sqrt[-a^2 - b^2]])/Sqrt[-a^2 - b^2])/b

________________________________________________________________________________________

fricas [B]  time = 0.74, size = 147, normalized size = 2.67 \[ -\frac {{\left (B a - A b\right )} \sqrt {a^{2} + b^{2}} \log \left (\frac {b^{2} \cosh \relax (x)^{2} + b^{2} \sinh \relax (x)^{2} + 2 \, a b \cosh \relax (x) + 2 \, a^{2} + b^{2} + 2 \, {\left (b^{2} \cosh \relax (x) + a b\right )} \sinh \relax (x) - 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cosh \relax (x) + b \sinh \relax (x) + a\right )}}{b \cosh \relax (x)^{2} + b \sinh \relax (x)^{2} + 2 \, a \cosh \relax (x) + 2 \, {\left (b \cosh \relax (x) + a\right )} \sinh \relax (x) - b}\right ) - {\left (B a^{2} + B b^{2}\right )} x}{a^{2} b + b^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sinh(x))/(a+b*sinh(x)),x, algorithm="fricas")

[Out]

-((B*a - A*b)*sqrt(a^2 + b^2)*log((b^2*cosh(x)^2 + b^2*sinh(x)^2 + 2*a*b*cosh(x) + 2*a^2 + b^2 + 2*(b^2*cosh(x
) + a*b)*sinh(x) - 2*sqrt(a^2 + b^2)*(b*cosh(x) + b*sinh(x) + a))/(b*cosh(x)^2 + b*sinh(x)^2 + 2*a*cosh(x) + 2
*(b*cosh(x) + a)*sinh(x) - b)) - (B*a^2 + B*b^2)*x)/(a^2*b + b^3)

________________________________________________________________________________________

giac [A]  time = 0.36, size = 75, normalized size = 1.36 \[ \frac {B x}{b} - \frac {{\left (B a - A b\right )} \log \left (\frac {{\left | 2 \, b e^{x} + 2 \, a - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, b e^{x} + 2 \, a + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{\sqrt {a^{2} + b^{2}} b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sinh(x))/(a+b*sinh(x)),x, algorithm="giac")

[Out]

B*x/b - (B*a - A*b)*log(abs(2*b*e^x + 2*a - 2*sqrt(a^2 + b^2))/abs(2*b*e^x + 2*a + 2*sqrt(a^2 + b^2)))/(sqrt(a
^2 + b^2)*b)

________________________________________________________________________________________

maple [B]  time = 0.03, size = 101, normalized size = 1.84 \[ \frac {2 \arctanh \left (\frac {2 a \tanh \left (\frac {x}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right ) A}{\sqrt {a^{2}+b^{2}}}-\frac {2 \arctanh \left (\frac {2 a \tanh \left (\frac {x}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right ) a B}{b \sqrt {a^{2}+b^{2}}}-\frac {B \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{b}+\frac {B \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*sinh(x))/(a+b*sinh(x)),x)

[Out]

2/(a^2+b^2)^(1/2)*arctanh(1/2*(2*a*tanh(1/2*x)-2*b)/(a^2+b^2)^(1/2))*A-2/b/(a^2+b^2)^(1/2)*arctanh(1/2*(2*a*ta
nh(1/2*x)-2*b)/(a^2+b^2)^(1/2))*a*B-B/b*ln(tanh(1/2*x)-1)+B/b*ln(tanh(1/2*x)+1)

________________________________________________________________________________________

maxima [B]  time = 0.40, size = 124, normalized size = 2.25 \[ -B {\left (\frac {a \log \left (\frac {b e^{\left (-x\right )} - a - \sqrt {a^{2} + b^{2}}}{b e^{\left (-x\right )} - a + \sqrt {a^{2} + b^{2}}}\right )}{\sqrt {a^{2} + b^{2}} b} - \frac {x}{b}\right )} + \frac {A \log \left (\frac {b e^{\left (-x\right )} - a - \sqrt {a^{2} + b^{2}}}{b e^{\left (-x\right )} - a + \sqrt {a^{2} + b^{2}}}\right )}{\sqrt {a^{2} + b^{2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sinh(x))/(a+b*sinh(x)),x, algorithm="maxima")

[Out]

-B*(a*log((b*e^(-x) - a - sqrt(a^2 + b^2))/(b*e^(-x) - a + sqrt(a^2 + b^2)))/(sqrt(a^2 + b^2)*b) - x/b) + A*lo
g((b*e^(-x) - a - sqrt(a^2 + b^2))/(b*e^(-x) - a + sqrt(a^2 + b^2)))/sqrt(a^2 + b^2)

________________________________________________________________________________________

mupad [B]  time = 0.93, size = 269, normalized size = 4.89 \[ \frac {B\,x}{b}-\frac {2\,\mathrm {atan}\left (\frac {b^2\,{\mathrm {e}}^x\,\sqrt {-a^2\,b^2-b^4}\,\left (\frac {2\,\left (A\,b\,\sqrt {-a^2\,b^2-b^4}-B\,a\,\sqrt {-a^2\,b^2-b^4}\right )}{b^4\,\sqrt {-a^2\,b^2-b^4}\,\sqrt {{\left (A\,b-B\,a\right )}^2}}+\frac {2\,a^2\,\sqrt {A^2\,b^2-2\,A\,B\,a\,b+B^2\,a^2}}{b^2\,\sqrt {-b^2\,\left (a^2+b^2\right )}\,\sqrt {-a^2\,b^2-b^4}\,\left (A\,b-B\,a\right )}\right )}{2}-\frac {a\,b\,\sqrt {A^2\,b^2-2\,A\,B\,a\,b+B^2\,a^2}}{\sqrt {-b^2\,\left (a^2+b^2\right )}\,\left (A\,b-B\,a\right )}\right )\,\sqrt {A^2\,b^2-2\,A\,B\,a\,b+B^2\,a^2}}{\sqrt {-a^2\,b^2-b^4}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*sinh(x))/(a + b*sinh(x)),x)

[Out]

(B*x)/b - (2*atan((b^2*exp(x)*(- b^4 - a^2*b^2)^(1/2)*((2*(A*b*(- b^4 - a^2*b^2)^(1/2) - B*a*(- b^4 - a^2*b^2)
^(1/2)))/(b^4*(- b^4 - a^2*b^2)^(1/2)*((A*b - B*a)^2)^(1/2)) + (2*a^2*(A^2*b^2 + B^2*a^2 - 2*A*B*a*b)^(1/2))/(
b^2*(-b^2*(a^2 + b^2))^(1/2)*(- b^4 - a^2*b^2)^(1/2)*(A*b - B*a))))/2 - (a*b*(A^2*b^2 + B^2*a^2 - 2*A*B*a*b)^(
1/2))/((-b^2*(a^2 + b^2))^(1/2)*(A*b - B*a)))*(A^2*b^2 + B^2*a^2 - 2*A*B*a*b)^(1/2))/(- b^4 - a^2*b^2)^(1/2)

________________________________________________________________________________________

sympy [A]  time = 64.57, size = 422, normalized size = 7.67 \[ \begin {cases} \tilde {\infty } \left (A \log {\left (\tanh {\left (\frac {x}{2} \right )} \right )} + B x\right ) & \text {for}\: a = 0 \wedge b = 0 \\\frac {A x + B \cosh {\relax (x )}}{a} & \text {for}\: b = 0 \\\frac {A \log {\left (\tanh {\left (\frac {x}{2} \right )} \right )} + B x}{b} & \text {for}\: a = 0 \\- \frac {2 A b}{b^{2} + i b \sqrt {b^{2}} \tanh {\left (\frac {x}{2} \right )}} + \frac {B b x}{b^{2} + i b \sqrt {b^{2}} \tanh {\left (\frac {x}{2} \right )}} + \frac {i B x \sqrt {b^{2}} \tanh {\left (\frac {x}{2} \right )}}{b^{2} + i b \sqrt {b^{2}} \tanh {\left (\frac {x}{2} \right )}} - \frac {2 i B \sqrt {b^{2}}}{b^{2} + i b \sqrt {b^{2}} \tanh {\left (\frac {x}{2} \right )}} & \text {for}\: a = - \sqrt {- b^{2}} \\- \frac {2 A b}{b^{2} - i b \sqrt {b^{2}} \tanh {\left (\frac {x}{2} \right )}} + \frac {B b x}{b^{2} - i b \sqrt {b^{2}} \tanh {\left (\frac {x}{2} \right )}} - \frac {i B x \sqrt {b^{2}} \tanh {\left (\frac {x}{2} \right )}}{b^{2} - i b \sqrt {b^{2}} \tanh {\left (\frac {x}{2} \right )}} + \frac {2 i B \sqrt {b^{2}}}{b^{2} - i b \sqrt {b^{2}} \tanh {\left (\frac {x}{2} \right )}} & \text {for}\: a = \sqrt {- b^{2}} \\- \frac {A \log {\left (\tanh {\left (\frac {x}{2} \right )} - \frac {b}{a} - \frac {\sqrt {a^{2} + b^{2}}}{a} \right )}}{\sqrt {a^{2} + b^{2}}} + \frac {A \log {\left (\tanh {\left (\frac {x}{2} \right )} - \frac {b}{a} + \frac {\sqrt {a^{2} + b^{2}}}{a} \right )}}{\sqrt {a^{2} + b^{2}}} + \frac {B a \log {\left (\tanh {\left (\frac {x}{2} \right )} - \frac {b}{a} - \frac {\sqrt {a^{2} + b^{2}}}{a} \right )}}{b \sqrt {a^{2} + b^{2}}} - \frac {B a \log {\left (\tanh {\left (\frac {x}{2} \right )} - \frac {b}{a} + \frac {\sqrt {a^{2} + b^{2}}}{a} \right )}}{b \sqrt {a^{2} + b^{2}}} + \frac {B x}{b} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sinh(x))/(a+b*sinh(x)),x)

[Out]

Piecewise((zoo*(A*log(tanh(x/2)) + B*x), Eq(a, 0) & Eq(b, 0)), ((A*x + B*cosh(x))/a, Eq(b, 0)), ((A*log(tanh(x
/2)) + B*x)/b, Eq(a, 0)), (-2*A*b/(b**2 + I*b*sqrt(b**2)*tanh(x/2)) + B*b*x/(b**2 + I*b*sqrt(b**2)*tanh(x/2))
+ I*B*x*sqrt(b**2)*tanh(x/2)/(b**2 + I*b*sqrt(b**2)*tanh(x/2)) - 2*I*B*sqrt(b**2)/(b**2 + I*b*sqrt(b**2)*tanh(
x/2)), Eq(a, -sqrt(-b**2))), (-2*A*b/(b**2 - I*b*sqrt(b**2)*tanh(x/2)) + B*b*x/(b**2 - I*b*sqrt(b**2)*tanh(x/2
)) - I*B*x*sqrt(b**2)*tanh(x/2)/(b**2 - I*b*sqrt(b**2)*tanh(x/2)) + 2*I*B*sqrt(b**2)/(b**2 - I*b*sqrt(b**2)*ta
nh(x/2)), Eq(a, sqrt(-b**2))), (-A*log(tanh(x/2) - b/a - sqrt(a**2 + b**2)/a)/sqrt(a**2 + b**2) + A*log(tanh(x
/2) - b/a + sqrt(a**2 + b**2)/a)/sqrt(a**2 + b**2) + B*a*log(tanh(x/2) - b/a - sqrt(a**2 + b**2)/a)/(b*sqrt(a*
*2 + b**2)) - B*a*log(tanh(x/2) - b/a + sqrt(a**2 + b**2)/a)/(b*sqrt(a**2 + b**2)) + B*x/b, True))

________________________________________________________________________________________