Integrand size = 15, antiderivative size = 55 \[ \int \frac {A+B \sinh (x)}{a+b \sinh (x)} \, dx=\frac {B x}{b}-\frac {2 (A b-a B) \text {arctanh}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{b \sqrt {a^2+b^2}} \] Output:
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)
Time = 0.14 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.11 \[ \int \frac {A+B \sinh (x)}{a+b \sinh (x)} \, dx=\frac {B x+\frac {2 (A b-a B) \arctan \left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {-a^2-b^2}}\right )}{\sqrt {-a^2-b^2}}}{b} \] Input:
Integrate[(A + B*Sinh[x])/(a + b*Sinh[x]),x]
Output:
(B*x + (2*(A*b - a*B)*ArcTan[(b - a*Tanh[x/2])/Sqrt[-a^2 - b^2]])/Sqrt[-a^ 2 - b^2])/b
Time = 0.50 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.09, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {3042, 3214, 3042, 3139, 1083, 219}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {A+B \sinh (x)}{a+b \sinh (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A-i B \sin (i x)}{a-i b \sin (i x)}dx\) |
\(\Big \downarrow \) 3214 |
\(\displaystyle \frac {(A b-a B) \int \frac {1}{a+b \sinh (x)}dx}{b}+\frac {B x}{b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {B x}{b}+\frac {(A b-a B) \int \frac {1}{a-i b \sin (i x)}dx}{b}\) |
\(\Big \downarrow \) 3139 |
\(\displaystyle \frac {2 (A b-a B) \int \frac {1}{-a \tanh ^2\left (\frac {x}{2}\right )+2 b \tanh \left (\frac {x}{2}\right )+a}d\tanh \left (\frac {x}{2}\right )}{b}+\frac {B x}{b}\) |
\(\Big \downarrow \) 1083 |
\(\displaystyle \frac {B x}{b}-\frac {4 (A b-a B) \int \frac {1}{4 \left (a^2+b^2\right )-\left (2 b-2 a \tanh \left (\frac {x}{2}\right )\right )^2}d\left (2 b-2 a \tanh \left (\frac {x}{2}\right )\right )}{b}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {B x}{b}-\frac {2 (A b-a B) \text {arctanh}\left (\frac {2 b-2 a \tanh \left (\frac {x}{2}\right )}{2 \sqrt {a^2+b^2}}\right )}{b \sqrt {a^2+b^2}}\) |
Input:
Int[(A + B*Sinh[x])/(a + b*Sinh[x]),x]
Output:
(B*x)/b - (2*(A*b - a*B)*ArcTanh[(2*b - 2*a*Tanh[x/2])/(2*Sqrt[a^2 + b^2]) ])/(b*Sqrt[a^2 + b^2])
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2 Subst[I nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x]
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = Fre eFactors[Tan[(c + d*x)/2], x]}, Simp[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]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_. )*(x_)]), x_Symbol] :> Simp[b*(x/d), x] - Simp[(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]
Time = 0.14 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.31
method | result | size |
default | \(-\frac {2 \left (-A b +a B \right ) \operatorname {arctanh}\left (\frac {2 a \tanh \left (\frac {x}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{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}\) | \(72\) |
risch | \(\frac {B x}{b}+\frac {\ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}+b^{2}}-a^{2}-b^{2}}{\sqrt {a^{2}+b^{2}}\, b}\right ) A}{\sqrt {a^{2}+b^{2}}}-\frac {\ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}+b^{2}}-a^{2}-b^{2}}{\sqrt {a^{2}+b^{2}}\, b}\right ) a B}{\sqrt {a^{2}+b^{2}}\, b}-\frac {\ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}+b^{2}}+a^{2}+b^{2}}{\sqrt {a^{2}+b^{2}}\, b}\right ) A}{\sqrt {a^{2}+b^{2}}}+\frac {\ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}+b^{2}}+a^{2}+b^{2}}{\sqrt {a^{2}+b^{2}}\, b}\right ) a B}{\sqrt {a^{2}+b^{2}}\, b}\) | \(210\) |
Input:
int((A+B*sinh(x))/(a+b*sinh(x)),x,method=_RETURNVERBOSE)
Output:
-2*(-A*b+B*a)/b/(a^2+b^2)^(1/2)*arctanh(1/2*(2*a*tanh(1/2*x)-2*b)/(a^2+b^2 )^(1/2))+B/b*ln(tanh(1/2*x)+1)-B/b*ln(tanh(1/2*x)-1)
Leaf count of result is larger than twice the leaf count of optimal. 147 vs. \(2 (51) = 102\).
Time = 0.10 (sec) , antiderivative size = 147, normalized size of antiderivative = 2.67 \[ \int \frac {A+B \sinh (x)}{a+b \sinh (x)} \, dx=-\frac {{\left (B a - A b\right )} \sqrt {a^{2} + b^{2}} \log \left (\frac {b^{2} \cosh \left (x\right )^{2} + b^{2} \sinh \left (x\right )^{2} + 2 \, a b \cosh \left (x\right ) + 2 \, a^{2} + b^{2} + 2 \, {\left (b^{2} \cosh \left (x\right ) + a b\right )} \sinh \left (x\right ) - 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cosh \left (x\right ) + b \sinh \left (x\right ) + a\right )}}{b \cosh \left (x\right )^{2} + b \sinh \left (x\right )^{2} + 2 \, a \cosh \left (x\right ) + 2 \, {\left (b \cosh \left (x\right ) + a\right )} \sinh \left (x\right ) - b}\right ) - {\left (B a^{2} + B b^{2}\right )} x}{a^{2} b + b^{3}} \] Input:
integrate((A+B*sinh(x))/(a+b*sinh(x)),x, algorithm="fricas")
Output:
-((B*a - A*b)*sqrt(a^2 + b^2)*log((b^2*cosh(x)^2 + b^2*sinh(x)^2 + 2*a*b*c osh(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)
Result contains complex when optimal does not.
Time = 21.07 (sec) , antiderivative size = 309, normalized size of antiderivative = 5.62 \[ \int \frac {A+B \sinh (x)}{a+b \sinh (x)} \, dx=\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 \log {\left (\tanh {\left (\frac {x}{2} \right )} \right )} + B x}{b} & \text {for}\: a = 0 \\\frac {A x + B \cosh {\left (x \right )}}{a} & \text {for}\: b = 0 \\\frac {2 i A}{b \tanh {\left (\frac {x}{2} \right )} - i b} + \frac {B x \tanh {\left (\frac {x}{2} \right )}}{b \tanh {\left (\frac {x}{2} \right )} - i b} - \frac {i B x}{b \tanh {\left (\frac {x}{2} \right )} - i b} - \frac {2 B}{b \tanh {\left (\frac {x}{2} \right )} - i b} & \text {for}\: a = - i b \\- \frac {2 i A}{b \tanh {\left (\frac {x}{2} \right )} + i b} + \frac {B x \tanh {\left (\frac {x}{2} \right )}}{b \tanh {\left (\frac {x}{2} \right )} + i b} + \frac {i B x}{b \tanh {\left (\frac {x}{2} \right )} + i b} - \frac {2 B}{b \tanh {\left (\frac {x}{2} \right )} + i b} & \text {for}\: a = i b \\- \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} \] Input:
integrate((A+B*sinh(x))/(a+b*sinh(x)),x)
Output:
Piecewise((zoo*(A*log(tanh(x/2)) + B*x), Eq(a, 0) & Eq(b, 0)), ((A*log(tan h(x/2)) + B*x)/b, Eq(a, 0)), ((A*x + B*cosh(x))/a, Eq(b, 0)), (2*I*A/(b*ta nh(x/2) - I*b) + B*x*tanh(x/2)/(b*tanh(x/2) - I*b) - I*B*x/(b*tanh(x/2) - I*b) - 2*B/(b*tanh(x/2) - I*b), Eq(a, -I*b)), (-2*I*A/(b*tanh(x/2) + I*b) + B*x*tanh(x/2)/(b*tanh(x/2) + I*b) + I*B*x/(b*tanh(x/2) + I*b) - 2*B/(b*t anh(x/2) + I*b), Eq(a, I*b)), (-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))
Leaf count of result is larger than twice the leaf count of optimal. 124 vs. \(2 (51) = 102\).
Time = 0.13 (sec) , antiderivative size = 124, normalized size of antiderivative = 2.25 \[ \int \frac {A+B \sinh (x)}{a+b \sinh (x)} \, dx=-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}}} \] Input:
integrate((A+B*sinh(x))/(a+b*sinh(x)),x, algorithm="maxima")
Output:
-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*log((b*e^(-x) - a - sqrt(a^2 + b^2))/(b* e^(-x) - a + sqrt(a^2 + b^2)))/sqrt(a^2 + b^2)
Time = 0.13 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.36 \[ \int \frac {A+B \sinh (x)}{a+b \sinh (x)} \, dx=\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} \] Input:
integrate((A+B*sinh(x))/(a+b*sinh(x)),x, algorithm="giac")
Output:
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)
Time = 1.85 (sec) , antiderivative size = 269, normalized size of antiderivative = 4.89 \[ \int \frac {A+B \sinh (x)}{a+b \sinh (x)} \, dx=\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}} \] Input:
int((A + B*sinh(x))/(a + b*sinh(x)),x)
Output:
(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)
Time = 0.15 (sec) , antiderivative size = 1, normalized size of antiderivative = 0.02 \[ \int \frac {A+B \sinh (x)}{a+b \sinh (x)} \, dx=x \] Input:
int((A+B*sinh(x))/(a+b*sinh(x)),x)
Output:
x