Integrand size = 13, antiderivative size = 62 \[ \int \frac {\cosh ^2(x)}{a+b \cosh (x)} \, dx=-\frac {a x}{b^2}+\frac {2 a^2 \text {arctanh}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b^2 \sqrt {a+b}}+\frac {\sinh (x)}{b} \]
[Out]
Time = 0.08 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {2825, 12, 2814, 2738, 214} \[ \int \frac {\cosh ^2(x)}{a+b \cosh (x)} \, dx=\frac {2 a^2 \text {arctanh}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{b^2 \sqrt {a-b} \sqrt {a+b}}-\frac {a x}{b^2}+\frac {\sinh (x)}{b} \]
[In]
[Out]
Rule 12
Rule 214
Rule 2738
Rule 2814
Rule 2825
Rubi steps \begin{align*} \text {integral}& = \frac {\sinh (x)}{b}-\frac {\int \frac {a \cosh (x)}{a+b \cosh (x)} \, dx}{b} \\ & = \frac {\sinh (x)}{b}-\frac {a \int \frac {\cosh (x)}{a+b \cosh (x)} \, dx}{b} \\ & = -\frac {a x}{b^2}+\frac {\sinh (x)}{b}+\frac {a^2 \int \frac {1}{a+b \cosh (x)} \, dx}{b^2} \\ & = -\frac {a x}{b^2}+\frac {\sinh (x)}{b}+\frac {\left (2 a^2\right ) \text {Subst}\left (\int \frac {1}{a+b-(a-b) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{b^2} \\ & = -\frac {a x}{b^2}+\frac {2 a^2 \text {arctanh}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b^2 \sqrt {a+b}}+\frac {\sinh (x)}{b} \\ \end{align*}
Time = 0.10 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.92 \[ \int \frac {\cosh ^2(x)}{a+b \cosh (x)} \, dx=\frac {a \left (-x-\frac {2 a \arctan \left (\frac {(a-b) \tanh \left (\frac {x}{2}\right )}{\sqrt {-a^2+b^2}}\right )}{\sqrt {-a^2+b^2}}\right )+b \sinh (x)}{b^2} \]
[In]
[Out]
Time = 0.11 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.52
method | result | size |
default | \(\frac {2 a^{2} \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^{2} \sqrt {\left (a +b \right ) \left (a -b \right )}}-\frac {1}{b \left (\tanh \left (\frac {x}{2}\right )-1\right )}+\frac {a \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{b^{2}}-\frac {1}{b \left (\tanh \left (\frac {x}{2}\right )+1\right )}-\frac {a \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{b^{2}}\) | \(94\) |
risch | \(-\frac {a x}{b^{2}}+\frac {{\mathrm e}^{x}}{2 b}-\frac {{\mathrm e}^{-x}}{2 b}+\frac {a^{2} \ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}-b^{2}}-a^{2}+b^{2}}{b \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, b^{2}}-\frac {a^{2} \ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}-b^{2}}+a^{2}-b^{2}}{b \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, b^{2}}\) | \(144\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 190 vs. \(2 (52) = 104\).
Time = 0.26 (sec) , antiderivative size = 449, normalized size of antiderivative = 7.24 \[ \int \frac {\cosh ^2(x)}{a+b \cosh (x)} \, dx=\left [-\frac {a^{2} b - b^{3} + 2 \, {\left (a^{3} - a b^{2}\right )} x \cosh \left (x\right ) - {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{2} - {\left (a^{2} b - b^{3}\right )} \sinh \left (x\right )^{2} - 2 \, {\left (a^{2} \cosh \left (x\right ) + a^{2} \sinh \left (x\right )\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 ) + 2 \, {\left ({\left (a^{3} - a b^{2}\right )} x - {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )}{2 \, {\left ({\left (a^{2} b^{2} - b^{4}\right )} \cosh \left (x\right ) + {\left (a^{2} b^{2} - b^{4}\right )} \sinh \left (x\right )\right )}}, -\frac {a^{2} b - b^{3} + 2 \, {\left (a^{3} - a b^{2}\right )} x \cosh \left (x\right ) - {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{2} - {\left (a^{2} b - b^{3}\right )} \sinh \left (x\right )^{2} + 4 \, {\left (a^{2} \cosh \left (x\right ) + a^{2} \sinh \left (x\right )\right )} \sqrt {-a^{2} + b^{2}} \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 ) + 2 \, {\left ({\left (a^{3} - a b^{2}\right )} x - {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )}{2 \, {\left ({\left (a^{2} b^{2} - b^{4}\right )} \cosh \left (x\right ) + {\left (a^{2} b^{2} - b^{4}\right )} \sinh \left (x\right )\right )}}\right ] \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 1275 vs. \(2 (53) = 106\).
Time = 51.49 (sec) , antiderivative size = 1275, normalized size of antiderivative = 20.56 \[ \int \frac {\cosh ^2(x)}{a+b \cosh (x)} \, dx=\text {Too large to display} \]
[In]
[Out]
Exception generated. \[ \int \frac {\cosh ^2(x)}{a+b \cosh (x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.25 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.00 \[ \int \frac {\cosh ^2(x)}{a+b \cosh (x)} \, dx=\frac {2 \, a^{2} \arctan \left (\frac {b e^{x} + a}{\sqrt {-a^{2} + b^{2}}}\right )}{\sqrt {-a^{2} + b^{2}} b^{2}} - \frac {a x}{b^{2}} - \frac {e^{\left (-x\right )}}{2 \, b} + \frac {e^{x}}{2 \, b} \]
[In]
[Out]
Time = 1.87 (sec) , antiderivative size = 139, normalized size of antiderivative = 2.24 \[ \int \frac {\cosh ^2(x)}{a+b \cosh (x)} \, dx=\frac {{\mathrm {e}}^x}{2\,b}-\frac {{\mathrm {e}}^{-x}}{2\,b}-\frac {a\,x}{b^2}+\frac {a^2\,\ln \left (-\frac {2\,a^2\,{\mathrm {e}}^x}{b^3}-\frac {2\,a^2\,\left (b+a\,{\mathrm {e}}^x\right )}{b^3\,\sqrt {a+b}\,\sqrt {a-b}}\right )}{b^2\,\sqrt {a+b}\,\sqrt {a-b}}-\frac {a^2\,\ln \left (\frac {2\,a^2\,\left (b+a\,{\mathrm {e}}^x\right )}{b^3\,\sqrt {a+b}\,\sqrt {a-b}}-\frac {2\,a^2\,{\mathrm {e}}^x}{b^3}\right )}{b^2\,\sqrt {a+b}\,\sqrt {a-b}} \]
[In]
[Out]