Integrand size = 20, antiderivative size = 60 \[ \int \frac {\frac {b B}{a}+B \sinh (x)}{a+b \sinh (x)} \, dx=\frac {B x}{b}+\frac {2 \left (a^2-b^2\right ) B \text {arctanh}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{a b \sqrt {a^2+b^2}} \] Output:
B*x/b+2*(a^2-b^2)*B*arctanh((b-a*tanh(1/2*x))/(a^2+b^2)^(1/2))/a/b/(a^2+b^ 2)^(1/2)
Time = 0.11 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.10 \[ \int \frac {\frac {b B}{a}+B \sinh (x)}{a+b \sinh (x)} \, dx=\frac {B \left (a x-\frac {2 \left (a^2-b^2\right ) \arctan \left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {-a^2-b^2}}\right )}{\sqrt {-a^2-b^2}}\right )}{a b} \] Input:
Integrate[((b*B)/a + B*Sinh[x])/(a + b*Sinh[x]),x]
Output:
(B*(a*x - (2*(a^2 - b^2)*ArcTan[(b - a*Tanh[x/2])/Sqrt[-a^2 - b^2]])/Sqrt[ -a^2 - b^2]))/(a*b)
Time = 0.33 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.08, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, 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 {\frac {b B}{a}+B \sinh (x)}{a+b \sinh (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\frac {b B}{a}-i B \sin (i x)}{a-i b \sin (i x)}dx\) |
\(\Big \downarrow \) 3214 |
\(\displaystyle \frac {B x}{b}-\frac {B \left (a^2-b^2\right ) \int \frac {1}{a+b \sinh (x)}dx}{a b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {B x}{b}-\frac {B \left (a^2-b^2\right ) \int \frac {1}{a-i b \sin (i x)}dx}{a b}\) |
\(\Big \downarrow \) 3139 |
\(\displaystyle \frac {B x}{b}-\frac {2 B \left (a^2-b^2\right ) \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 )}{a b}\) |
\(\Big \downarrow \) 1083 |
\(\displaystyle \frac {4 B \left (a^2-b^2\right ) \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 )}{a b}+\frac {B x}{b}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {2 B \left (a^2-b^2\right ) \text {arctanh}\left (\frac {2 b-2 a \tanh \left (\frac {x}{2}\right )}{2 \sqrt {a^2+b^2}}\right )}{a b \sqrt {a^2+b^2}}+\frac {B x}{b}\) |
Input:
Int[((b*B)/a + B*Sinh[x])/(a + b*Sinh[x]),x]
Output:
(B*x)/b + (2*(a^2 - b^2)*B*ArcTanh[(2*b - 2*a*Tanh[x/2])/(2*Sqrt[a^2 + b^2 ])])/(a*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.16 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.33
method | result | size |
default | \(\frac {2 B \left (-\frac {a \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{2 b}+\frac {a \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{2 b}-\frac {\left (a^{2}-b^{2}\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}}}\right )}{a}\) | \(80\) |
risch | \(\frac {B x}{b}+\frac {B a \ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}+b^{2}}+a^{2}+b^{2}}{\sqrt {a^{2}+b^{2}}\, b}\right )}{\sqrt {a^{2}+b^{2}}\, b}-\frac {B b \ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}+b^{2}}+a^{2}+b^{2}}{\sqrt {a^{2}+b^{2}}\, b}\right )}{\sqrt {a^{2}+b^{2}}\, a}-\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 {B b \ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}+b^{2}}-a^{2}-b^{2}}{\sqrt {a^{2}+b^{2}}\, b}\right )}{\sqrt {a^{2}+b^{2}}\, a}\) | \(218\) |
Input:
int((b*B/a+B*sinh(x))/(a+b*sinh(x)),x,method=_RETURNVERBOSE)
Output:
2*B/a*(-1/2/b*a*ln(tanh(1/2*x)-1)+1/2/b*a*ln(tanh(1/2*x)+1)-(a^2-b^2)/b/(a ^2+b^2)^(1/2)*arctanh(1/2*(2*a*tanh(1/2*x)-2*b)/(a^2+b^2)^(1/2)))
Leaf count of result is larger than twice the leaf count of optimal. 154 vs. \(2 (56) = 112\).
Time = 0.10 (sec) , antiderivative size = 154, normalized size of antiderivative = 2.57 \[ \int \frac {\frac {b B}{a}+B \sinh (x)}{a+b \sinh (x)} \, dx=-\frac {{\left (B a^{2} - B b^{2}\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^{3} + B a b^{2}\right )} x}{a^{3} b + a b^{3}} \] Input:
integrate((b*B/a+B*sinh(x))/(a+b*sinh(x)),x, algorithm="fricas")
Output:
-((B*a^2 - B*b^2)*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^3 + B*a*b^2)*x)/(a^3*b + a*b^3)
Result contains complex when optimal does not.
Time = 18.82 (sec) , antiderivative size = 258, normalized size of antiderivative = 4.30 \[ \int \frac {\frac {b B}{a}+B \sinh (x)}{a+b \sinh (x)} \, dx=\begin {cases} \text {NaN} & \text {for}\: a = 0 \wedge b = 0 \\\frac {B \cosh {\left (x \right )}}{a} & \text {for}\: b = 0 \\\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 {4 B}{b \tanh {\left (\frac {x}{2} \right )} - i b} & \text {for}\: a = - 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 {4 B}{b \tanh {\left (\frac {x}{2} \right )} + i b} & \text {for}\: a = i b \\\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} - \frac {B b \log {\left (\tanh {\left (\frac {x}{2} \right )} - \frac {b}{a} - \frac {\sqrt {a^{2} + b^{2}}}{a} \right )}}{a \sqrt {a^{2} + b^{2}}} + \frac {B b \log {\left (\tanh {\left (\frac {x}{2} \right )} - \frac {b}{a} + \frac {\sqrt {a^{2} + b^{2}}}{a} \right )}}{a \sqrt {a^{2} + b^{2}}} & \text {otherwise} \end {cases} \] Input:
integrate((b*B/a+B*sinh(x))/(a+b*sinh(x)),x)
Output:
Piecewise((nan, Eq(a, 0) & Eq(b, 0)), (B*cosh(x)/a, Eq(b, 0)), (B*x*tanh(x /2)/(b*tanh(x/2) - I*b) - I*B*x/(b*tanh(x/2) - I*b) - 4*B/(b*tanh(x/2) - I *b), Eq(a, -I*b)), (B*x*tanh(x/2)/(b*tanh(x/2) + I*b) + I*B*x/(b*tanh(x/2) + I*b) - 4*B/(b*tanh(x/2) + I*b), Eq(a, I*b)), (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 + sq rt(a**2 + b**2)/a)/(b*sqrt(a**2 + b**2)) + B*x/b - B*b*log(tanh(x/2) - b/a - sqrt(a**2 + b**2)/a)/(a*sqrt(a**2 + b**2)) + B*b*log(tanh(x/2) - b/a + sqrt(a**2 + b**2)/a)/(a*sqrt(a**2 + b**2)), True))
Leaf count of result is larger than twice the leaf count of optimal. 128 vs. \(2 (56) = 112\).
Time = 0.12 (sec) , antiderivative size = 128, normalized size of antiderivative = 2.13 \[ \int \frac {\frac {b B}{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 {B b \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}} a} \] Input:
integrate((b*B/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) + B*b*log((b*e^(-x) - a - sqrt(a^2 + b^2))/( b*e^(-x) - a + sqrt(a^2 + b^2)))/(sqrt(a^2 + b^2)*a)
Time = 0.13 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.37 \[ \int \frac {\frac {b B}{a}+B \sinh (x)}{a+b \sinh (x)} \, dx=\frac {B x}{b} - \frac {{\left (B a^{2} - B b^{2}\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}} a b} \] Input:
integrate((b*B/a+B*sinh(x))/(a+b*sinh(x)),x, algorithm="giac")
Output:
B*x/b - (B*a^2 - B*b^2)*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)*a*b)
Time = 2.13 (sec) , antiderivative size = 331, normalized size of antiderivative = 5.52 \[ \int \frac {\frac {b B}{a}+B \sinh (x)}{a+b \sinh (x)} \, dx=\frac {2\,\mathrm {atan}\left (\frac {a\,b^2\,{\mathrm {e}}^x\,\sqrt {-a^4\,b^2-a^2\,b^4}\,\left (\frac {2\,\left (B\,a^2\,\sqrt {-a^4\,b^2-a^2\,b^4}-B\,b^2\,\sqrt {-a^4\,b^2-a^2\,b^4}\right )}{a^2\,b^4\,\sqrt {-a^4\,b^2-a^2\,b^4}\,\sqrt {B^2\,{\left (a^2-b^2\right )}^2}}+\frac {2\,a^2\,\sqrt {B^2\,a^4-2\,B^2\,a^2\,b^2+B^2\,b^4}}{B\,b^2\,\sqrt {-a^4\,b^2-a^2\,b^4}\,\left (a^2-b^2\right )\,\sqrt {-a^2\,b^2\,\left (a^2+b^2\right )}}\right )}{2}-\frac {a^2\,b\,\sqrt {B^2\,a^4-2\,B^2\,a^2\,b^2+B^2\,b^4}}{B\,\left (a^2-b^2\right )\,\sqrt {-a^2\,b^2\,\left (a^2+b^2\right )}}\right )\,\sqrt {B^2\,a^4-2\,B^2\,a^2\,b^2+B^2\,b^4}}{\sqrt {-a^4\,b^2-a^2\,b^4}}+\frac {B\,x}{b} \] Input:
int((B*sinh(x) + (B*b)/a)/(a + b*sinh(x)),x)
Output:
(2*atan((a*b^2*exp(x)*(- a^2*b^4 - a^4*b^2)^(1/2)*((2*(B*a^2*(- a^2*b^4 - a^4*b^2)^(1/2) - B*b^2*(- a^2*b^4 - a^4*b^2)^(1/2)))/(a^2*b^4*(- a^2*b^4 - a^4*b^2)^(1/2)*(B^2*(a^2 - b^2)^2)^(1/2)) + (2*a^2*(B^2*a^4 + B^2*b^4 - 2 *B^2*a^2*b^2)^(1/2))/(B*b^2*(- a^2*b^4 - a^4*b^2)^(1/2)*(a^2 - b^2)*(-a^2* b^2*(a^2 + b^2))^(1/2))))/2 - (a^2*b*(B^2*a^4 + B^2*b^4 - 2*B^2*a^2*b^2)^( 1/2))/(B*(a^2 - b^2)*(-a^2*b^2*(a^2 + b^2))^(1/2)))*(B^2*a^4 + B^2*b^4 - 2 *B^2*a^2*b^2)^(1/2))/(- a^2*b^4 - a^4*b^2)^(1/2) + (B*x)/b
Time = 0.15 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.62 \[ \int \frac {\frac {b B}{a}+B \sinh (x)}{a+b \sinh (x)} \, dx=\frac {-2 \sqrt {a^{2}+b^{2}}\, \mathit {atan} \left (\frac {e^{x} b i +a i}{\sqrt {a^{2}+b^{2}}}\right ) a^{2} i +2 \sqrt {a^{2}+b^{2}}\, \mathit {atan} \left (\frac {e^{x} b i +a i}{\sqrt {a^{2}+b^{2}}}\right ) b^{2} i +a^{3} x +a \,b^{2} x}{a \left (a^{2}+b^{2}\right )} \] Input:
int((b*B/a+B*sinh(x))/(a+b*sinh(x)),x)
Output:
( - 2*sqrt(a**2 + b**2)*atan((e**x*b*i + a*i)/sqrt(a**2 + b**2))*a**2*i + 2*sqrt(a**2 + b**2)*atan((e**x*b*i + a*i)/sqrt(a**2 + b**2))*b**2*i + a**3 *x + a*b**2*x)/(a*(a**2 + b**2))