Integrand size = 15, antiderivative size = 51 \[ \int \frac {A+B \cosh (x)}{a+b \sinh (x)} \, dx=-\frac {2 A \text {arctanh}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{\sqrt {a^2+b^2}}+\frac {B \log (a+b \sinh (x))}{b} \]
[Out]
Time = 0.09 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {4486, 2739, 632, 212, 2747, 31} \[ \int \frac {A+B \cosh (x)}{a+b \sinh (x)} \, dx=\frac {B \log (a+b \sinh (x))}{b}-\frac {2 A \text {arctanh}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{\sqrt {a^2+b^2}} \]
[In]
[Out]
Rule 31
Rule 212
Rule 632
Rule 2739
Rule 2747
Rule 4486
Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {A}{a+b \sinh (x)}+\frac {B \cosh (x)}{a+b \sinh (x)}\right ) \, dx \\ & = A \int \frac {1}{a+b \sinh (x)} \, dx+B \int \frac {\cosh (x)}{a+b \sinh (x)} \, dx \\ & = (2 A) \text {Subst}\left (\int \frac {1}{a+2 b x-a x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )+\frac {B \text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \sinh (x)\right )}{b} \\ & = \frac {B \log (a+b \sinh (x))}{b}-(4 A) \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 ) \\ & = -\frac {2 A \text {arctanh}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{\sqrt {a^2+b^2}}+\frac {B \log (a+b \sinh (x))}{b} \\ \end{align*}
Time = 0.08 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.16 \[ \int \frac {A+B \cosh (x)}{a+b \sinh (x)} \, dx=\frac {2 A \arctan \left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {-a^2-b^2}}\right )}{\sqrt {-a^2-b^2}}+\frac {B \log (a+b \sinh (x))}{b} \]
[In]
[Out]
Time = 1.65 (sec) , antiderivative size = 49, normalized size of antiderivative = 0.96
method | result | size |
parts | \(\frac {2 A \,\operatorname {arctanh}\left (\frac {2 a \tanh \left (\frac {x}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\sqrt {a^{2}+b^{2}}}+\frac {B \ln \left (a +b \sinh \left (x \right )\right )}{b}\) | \(49\) |
default | \(\frac {B \ln \left (\tanh \left (\frac {x}{2}\right )^{2} a -2 b \tanh \left (\frac {x}{2}\right )-a \right )+\frac {2 A b \,\operatorname {arctanh}\left (\frac {2 a \tanh \left (\frac {x}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\sqrt {a^{2}+b^{2}}}}{b}-\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}\) | \(92\) |
risch | \(\frac {B x}{b}-\frac {2 x B \,a^{2} b}{a^{2} b^{2}+b^{4}}-\frac {2 x B \,b^{3}}{a^{2} b^{2}+b^{4}}+\frac {\ln \left ({\mathrm e}^{x}+\frac {A a b -\sqrt {A^{2} a^{2} b^{2}+A^{2} b^{4}}}{A \,b^{2}}\right ) B \,a^{2}}{\left (a^{2}+b^{2}\right ) b}+\frac {b \ln \left ({\mathrm e}^{x}+\frac {A a b -\sqrt {A^{2} a^{2} b^{2}+A^{2} b^{4}}}{A \,b^{2}}\right ) B}{a^{2}+b^{2}}+\frac {\ln \left ({\mathrm e}^{x}+\frac {A a b -\sqrt {A^{2} a^{2} b^{2}+A^{2} b^{4}}}{A \,b^{2}}\right ) \sqrt {A^{2} a^{2} b^{2}+A^{2} b^{4}}}{\left (a^{2}+b^{2}\right ) b}+\frac {\ln \left ({\mathrm e}^{x}+\frac {A a b +\sqrt {A^{2} a^{2} b^{2}+A^{2} b^{4}}}{A \,b^{2}}\right ) B \,a^{2}}{\left (a^{2}+b^{2}\right ) b}+\frac {b \ln \left ({\mathrm e}^{x}+\frac {A a b +\sqrt {A^{2} a^{2} b^{2}+A^{2} b^{4}}}{A \,b^{2}}\right ) B}{a^{2}+b^{2}}-\frac {\ln \left ({\mathrm e}^{x}+\frac {A a b +\sqrt {A^{2} a^{2} b^{2}+A^{2} b^{4}}}{A \,b^{2}}\right ) \sqrt {A^{2} a^{2} b^{2}+A^{2} b^{4}}}{\left (a^{2}+b^{2}\right ) b}\) | \(396\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 170 vs. \(2 (47) = 94\).
Time = 0.30 (sec) , antiderivative size = 170, normalized size of antiderivative = 3.33 \[ \int \frac {A+B \cosh (x)}{a+b \sinh (x)} \, dx=\frac {\sqrt {a^{2} + b^{2}} A b \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 + {\left (B a^{2} + B b^{2}\right )} \log \left (\frac {2 \, {\left (b \sinh \left (x\right ) + a\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right )}{a^{2} b + b^{3}} \]
[In]
[Out]
Result contains complex when optimal does not.
Time = 15.13 (sec) , antiderivative size = 517, normalized size of antiderivative = 10.14 \[ \int \frac {A+B \cosh (x)}{a+b \sinh (x)} \, dx=\begin {cases} \tilde {\infty } \left (A \log {\left (\tanh {\left (\frac {x}{2} \right )} \right )} + B x - 2 B \log {\left (\tanh {\left (\frac {x}{2} \right )} + 1 \right )} + B \log {\left (\tanh {\left (\frac {x}{2} \right )} \right )}\right ) & \text {for}\: a = 0 \wedge b = 0 \\\frac {A \log {\left (\tanh {\left (\frac {x}{2} \right )} \right )} + B x - 2 B \log {\left (\tanh {\left (\frac {x}{2} \right )} + 1 \right )} + B \log {\left (\tanh {\left (\frac {x}{2} \right )} \right )}}{b} & \text {for}\: a = 0 \\\frac {A x + B \sinh {\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 \log {\left (\tanh {\left (\frac {x}{2} \right )} + 1 \right )} \tanh {\left (\frac {x}{2} \right )}}{b \tanh {\left (\frac {x}{2} \right )} - i b} + \frac {2 i B \log {\left (\tanh {\left (\frac {x}{2} \right )} + 1 \right )}}{b \tanh {\left (\frac {x}{2} \right )} - i b} + \frac {2 B \log {\left (\tanh {\left (\frac {x}{2} \right )} - i \right )} \tanh {\left (\frac {x}{2} \right )}}{b \tanh {\left (\frac {x}{2} \right )} - i b} - \frac {2 i B \log {\left (\tanh {\left (\frac {x}{2} \right )} - i \right )}}{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 \log {\left (\tanh {\left (\frac {x}{2} \right )} + 1 \right )} \tanh {\left (\frac {x}{2} \right )}}{b \tanh {\left (\frac {x}{2} \right )} + i b} - \frac {2 i B \log {\left (\tanh {\left (\frac {x}{2} \right )} + 1 \right )}}{b \tanh {\left (\frac {x}{2} \right )} + i b} + \frac {2 B \log {\left (\tanh {\left (\frac {x}{2} \right )} + i \right )} \tanh {\left (\frac {x}{2} \right )}}{b \tanh {\left (\frac {x}{2} \right )} + i b} + \frac {2 i B \log {\left (\tanh {\left (\frac {x}{2} \right )} + i \right )}}{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 x}{b} - \frac {2 B \log {\left (\tanh {\left (\frac {x}{2} \right )} + 1 \right )}}{b} + \frac {B \log {\left (\tanh {\left (\frac {x}{2} \right )} - \frac {b}{a} - \frac {\sqrt {a^{2} + b^{2}}}{a} \right )}}{b} + \frac {B \log {\left (\tanh {\left (\frac {x}{2} \right )} - \frac {b}{a} + \frac {\sqrt {a^{2} + b^{2}}}{a} \right )}}{b} & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.33 \[ \int \frac {A+B \cosh (x)}{a+b \sinh (x)} \, dx=\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}}} + \frac {B \log \left (b \sinh \left (x\right ) + a\right )}{b} \]
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.71 \[ \int \frac {A+B \cosh (x)}{a+b \sinh (x)} \, dx=\frac {A \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}}} - \frac {B x}{b} + \frac {B \log \left ({\left | b e^{\left (2 \, x\right )} + 2 \, a e^{x} - b \right |}\right )}{b} \]
[In]
[Out]
Time = 3.52 (sec) , antiderivative size = 198, normalized size of antiderivative = 3.88 \[ \int \frac {A+B \cosh (x)}{a+b \sinh (x)} \, dx=\frac {B\,b^3\,\ln \left (8\,A^2\,a\,{\mathrm {e}}^x-4\,A^2\,b+4\,A^2\,b\,{\mathrm {e}}^{2\,x}\right )}{a^2\,b^2+b^4}-\frac {B\,x}{b}-\frac {2\,\mathrm {atan}\left (\frac {A^2\,b^2\,{\mathrm {e}}^x\,\sqrt {-a^2-b^2}}{\left (A\,a^2\,b+A\,b^3\right )\,\sqrt {A^2}}+\frac {A^2\,a\,b\,\sqrt {-a^2-b^2}}{\left (A\,a^2\,b+A\,b^3\right )\,\sqrt {A^2}}\right )\,\sqrt {A^2}}{\sqrt {-a^2-b^2}}+\frac {B\,a^2\,b\,\ln \left (8\,A^2\,a\,{\mathrm {e}}^x-4\,A^2\,b+4\,A^2\,b\,{\mathrm {e}}^{2\,x}\right )}{a^2\,b^2+b^4} \]
[In]
[Out]