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}} \]
[Out]
Time = 0.05 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {2814, 2739, 632, 212} \[ \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}} \]
[In]
[Out]
Rule 212
Rule 632
Rule 2739
Rule 2814
Rubi steps \begin{align*} \text {integral}& = \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)) \text {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)) \text {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) \text {arctanh}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{b \sqrt {a^2+b^2}} \\ \end{align*}
Time = 0.15 (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} \]
[In]
[Out]
Time = 0.53 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.31
method | result | size |
default | \(\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}-\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}}}\) | \(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\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 147 vs. \(2 (51) = 102\).
Time = 0.31 (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}} \]
[In]
[Out]
Result contains complex when optimal does not.
Time = 15.11 (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} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 124 vs. \(2 (51) = 102\).
Time = 0.28 (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}}} \]
[In]
[Out]
none
Time = 0.29 (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} \]
[In]
[Out]
Time = 1.66 (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}} \]
[In]
[Out]