Integrand size = 20, antiderivative size = 56 \[ \int \frac {\frac {b B}{a}+B \cosh (x)}{a+b \cosh (x)} \, dx=\frac {B x}{b}-\frac {2 \sqrt {a-b} \sqrt {a+b} B \text {arctanh}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a b} \]
[Out]
Time = 0.05 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {2814, 2738, 214} \[ \int \frac {\frac {b B}{a}+B \cosh (x)}{a+b \cosh (x)} \, dx=\frac {B x}{b}-\frac {2 B \sqrt {a-b} \sqrt {a+b} \text {arctanh}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a b} \]
[In]
[Out]
Rule 214
Rule 2738
Rule 2814
Rubi steps \begin{align*} \text {integral}& = \frac {B x}{b}-\frac {\left (a B-\frac {b^2 B}{a}\right ) \int \frac {1}{a+b \cosh (x)} \, dx}{b} \\ & = \frac {B x}{b}-\frac {\left (2 \left (a B-\frac {b^2 B}{a}\right )\right ) \text {Subst}\left (\int \frac {1}{a+b-(a-b) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{b} \\ & = \frac {B x}{b}-\frac {2 \sqrt {a-b} \sqrt {a+b} B \text {arctanh}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a b} \\ \end{align*}
Time = 0.09 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.00 \[ \int \frac {\frac {b B}{a}+B \cosh (x)}{a+b \cosh (x)} \, dx=\frac {B \left (\frac {a x}{b}+\frac {2 \sqrt {-a^2+b^2} \arctan \left (\frac {(-a+b) \tanh \left (\frac {x}{2}\right )}{\sqrt {-a^2+b^2}}\right )}{b}\right )}{a} \]
[In]
[Out]
Time = 0.10 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.45
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 {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{b \sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a}\) | \(81\) |
risch | \(\frac {B x}{b}+\frac {\sqrt {a^{2}-b^{2}}\, B \ln \left ({\mathrm e}^{x}+\frac {a +\sqrt {a^{2}-b^{2}}}{b}\right )}{b a}-\frac {\sqrt {a^{2}-b^{2}}\, B \ln \left ({\mathrm e}^{x}-\frac {-a +\sqrt {a^{2}-b^{2}}}{b}\right )}{b a}\) | \(92\) |
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 190, normalized size of antiderivative = 3.39 \[ \int \frac {\frac {b B}{a}+B \cosh (x)}{a+b \cosh (x)} \, dx=\left [\frac {B a x + \sqrt {a^{2} - b^{2}} 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 )}{a b}, \frac {B a x + 2 \, \sqrt {-a^{2} + b^{2}} B \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cosh \left (x\right ) + b \sinh \left (x\right ) + a\right )}}{a^{2} - b^{2}}\right )}{a b}\right ] \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 168 vs. \(2 (44) = 88\).
Time = 13.46 (sec) , antiderivative size = 168, normalized size of antiderivative = 3.00 \[ \int \frac {\frac {b B}{a}+B \cosh (x)}{a+b \cosh (x)} \, dx=\begin {cases} \text {NaN} & \text {for}\: a = 0 \wedge b = 0 \\\frac {B \sinh {\left (x \right )}}{a} & \text {for}\: b = 0 \\\frac {B x}{b} & \text {for}\: a = - b \vee a = b \\\frac {B x}{b} + \frac {B \log {\left (- \sqrt {\frac {a}{a - b} + \frac {b}{a - b}} + \tanh {\left (\frac {x}{2} \right )} \right )}}{b \sqrt {\frac {a}{a - b} + \frac {b}{a - b}}} - \frac {B \log {\left (\sqrt {\frac {a}{a - b} + \frac {b}{a - b}} + \tanh {\left (\frac {x}{2} \right )} \right )}}{b \sqrt {\frac {a}{a - b} + \frac {b}{a - b}}} + \frac {B \log {\left (- \sqrt {\frac {a}{a - b} + \frac {b}{a - b}} + \tanh {\left (\frac {x}{2} \right )} \right )}}{a \sqrt {\frac {a}{a - b} + \frac {b}{a - b}}} - \frac {B \log {\left (\sqrt {\frac {a}{a - b} + \frac {b}{a - b}} + \tanh {\left (\frac {x}{2} \right )} \right )}}{a \sqrt {\frac {a}{a - b} + \frac {b}{a - b}}} & \text {otherwise} \end {cases} \]
[In]
[Out]
Exception generated. \[ \int \frac {\frac {b B}{a}+B \cosh (x)}{a+b \cosh (x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.25 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.02 \[ \int \frac {\frac {b B}{a}+B \cosh (x)}{a+b \cosh (x)} \, dx=\frac {B x}{b} - \frac {2 \, {\left (B a^{2} - B b^{2}\right )} \arctan \left (\frac {b e^{x} + a}{\sqrt {-a^{2} + b^{2}}}\right )}{\sqrt {-a^{2} + b^{2}} a b} \]
[In]
[Out]
Time = 0.51 (sec) , antiderivative size = 205, normalized size of antiderivative = 3.66 \[ \int \frac {\frac {b B}{a}+B \cosh (x)}{a+b \cosh (x)} \, dx=\frac {2\,\mathrm {atan}\left (\frac {b\,\sqrt {a^2\,b^2}\,\sqrt {B^2\,b^2-B^2\,a^2}}{B\,\left (b^4-a^2\,b^2\right )}+\frac {a\,b^2\,{\mathrm {e}}^x\,\left (\frac {2\,\sqrt {B^2\,b^2-B^2\,a^2}}{B\,b^2\,\left (b^4-a^2\,b^2\right )}-\frac {2\,\left (B\,a^2\,\sqrt {a^2\,b^2}-B\,b^2\,\sqrt {a^2\,b^2}\right )}{a^2\,b^4\,\sqrt {-B^2\,\left (a^2-b^2\right )}\,\sqrt {a^2\,b^2}}\right )\,\sqrt {a^2\,b^2}}{2}\right )\,\sqrt {B^2\,b^2-B^2\,a^2}}{\sqrt {a^2\,b^2}}+\frac {B\,x}{b} \]
[In]
[Out]