Integrand size = 20, antiderivative size = 38 \[ \int \frac {\cosh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=\frac {x}{a+b}+\frac {\sqrt {b} \arctan \left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)} \]
[Out]
Time = 0.08 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {400, 212, 211} \[ \int \frac {\cosh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=\frac {\sqrt {b} \arctan \left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)}+\frac {x}{a+b} \]
[In]
[Out]
Rule 211
Rule 212
Rule 400
Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {1}{\left (1-x^2\right ) \left (a+b x^2\right )} \, dx,x,\tanh (x)\right ) \\ & = \frac {\text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\tanh (x)\right )}{a+b}+\frac {b \text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\tanh (x)\right )}{a+b} \\ & = \frac {x}{a+b}+\frac {\sqrt {b} \arctan \left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)} \\ \end{align*}
Time = 0.06 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.87 \[ \int \frac {\cosh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=\frac {x+\frac {\sqrt {b} \arctan \left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a}}\right )}{\sqrt {a}}}{a+b} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(91\) vs. \(2(30)=60\).
Time = 0.16 (sec) , antiderivative size = 92, normalized size of antiderivative = 2.42
method | result | size |
risch | \(\frac {x}{a +b}+\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 x}+\frac {a +2 \sqrt {-a b}-b}{a +b}\right )}{2 a \left (a +b \right )}-\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 x}-\frac {-a +2 \sqrt {-a b}+b}{a +b}\right )}{2 a \left (a +b \right )}\) | \(92\) |
default | \(-\frac {2 \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{2 a +2 b}-\frac {2 b a \left (-\frac {\left (-a +\sqrt {b \left (a +b \right )}-b \right ) \operatorname {arctanh}\left (\frac {a \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (2 \sqrt {b \left (a +b \right )}-a -2 b \right ) a}}\right )}{2 a \sqrt {b \left (a +b \right )}\, \sqrt {\left (2 \sqrt {b \left (a +b \right )}-a -2 b \right ) a}}+\frac {\left (a +\sqrt {b \left (a +b \right )}+b \right ) \arctan \left (\frac {a \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (2 \sqrt {b \left (a +b \right )}+a +2 b \right ) a}}\right )}{2 a \sqrt {b \left (a +b \right )}\, \sqrt {\left (2 \sqrt {b \left (a +b \right )}+a +2 b \right ) a}}\right )}{a +b}+\frac {2 \ln \left (1+\tanh \left (\frac {x}{2}\right )\right )}{2 a +2 b}\) | \(186\) |
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 363, normalized size of antiderivative = 9.55 \[ \int \frac {\cosh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=\left [\frac {\sqrt {-\frac {b}{a}} \log \left (\frac {{\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (x\right )^{4} + 4 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (a^{2} + 2 \, a b + b^{2}\right )} \sinh \left (x\right )^{4} + 2 \, {\left (a^{2} - b^{2}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (x\right )^{2} + a^{2} - b^{2}\right )} \sinh \left (x\right )^{2} + a^{2} - 6 \, a b + b^{2} + 4 \, {\left ({\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (x\right )^{3} + {\left (a^{2} - b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + 4 \, {\left ({\left (a^{2} + a b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a^{2} + a b\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a^{2} + a b\right )} \sinh \left (x\right )^{2} + a^{2} - a b\right )} \sqrt {-\frac {b}{a}}}{{\left (a + b\right )} \cosh \left (x\right )^{4} + 4 \, {\left (a + b\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (a + b\right )} \sinh \left (x\right )^{4} + 2 \, {\left (a - b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, {\left (a + b\right )} \cosh \left (x\right )^{2} + a - b\right )} \sinh \left (x\right )^{2} + 4 \, {\left ({\left (a + b\right )} \cosh \left (x\right )^{3} + {\left (a - b\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + a + b}\right ) + 2 \, x}{2 \, {\left (a + b\right )}}, \frac {\sqrt {\frac {b}{a}} \arctan \left (\frac {{\left ({\left (a + b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a + b\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a + b\right )} \sinh \left (x\right )^{2} + a - b\right )} \sqrt {\frac {b}{a}}}{2 \, b}\right ) + x}{a + b}\right ] \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 224 vs. \(2 (32) = 64\).
Time = 0.58 (sec) , antiderivative size = 224, normalized size of antiderivative = 5.89 \[ \int \frac {\cosh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=\begin {cases} \tilde {\infty } \left (x - \frac {\cosh {\left (x \right )}}{\sinh {\left (x \right )}}\right ) & \text {for}\: a = 0 \wedge b = 0 \\\frac {x - \frac {\cosh {\left (x \right )}}{\sinh {\left (x \right )}}}{b} & \text {for}\: a = 0 \\\frac {x \sinh ^{2}{\left (x \right )}}{- 2 b \sinh ^{2}{\left (x \right )} + 2 b \cosh ^{2}{\left (x \right )}} - \frac {x \cosh ^{2}{\left (x \right )}}{- 2 b \sinh ^{2}{\left (x \right )} + 2 b \cosh ^{2}{\left (x \right )}} - \frac {\sinh {\left (x \right )} \cosh {\left (x \right )}}{- 2 b \sinh ^{2}{\left (x \right )} + 2 b \cosh ^{2}{\left (x \right )}} & \text {for}\: a = - b \\\frac {x}{a} & \text {for}\: b = 0 \\\frac {2 a x \sqrt {- \frac {b}{a}}}{2 a^{2} \sqrt {- \frac {b}{a}} + 2 a b \sqrt {- \frac {b}{a}}} - \frac {b \log {\left (- \sqrt {- \frac {b}{a}} \sinh {\left (x \right )} + \cosh {\left (x \right )} \right )}}{2 a^{2} \sqrt {- \frac {b}{a}} + 2 a b \sqrt {- \frac {b}{a}}} + \frac {b \log {\left (\sqrt {- \frac {b}{a}} \sinh {\left (x \right )} + \cosh {\left (x \right )} \right )}}{2 a^{2} \sqrt {- \frac {b}{a}} + 2 a b \sqrt {- \frac {b}{a}}} & \text {otherwise} \end {cases} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 74 vs. \(2 (30) = 60\).
Time = 0.29 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.95 \[ \int \frac {\cosh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=-\frac {{\left (a - b\right )} \arctan \left (\frac {{\left (a + b\right )} e^{\left (2 \, x\right )} + a - b}{2 \, \sqrt {a b}}\right )}{2 \, \sqrt {a b} {\left (a + b\right )}} - \frac {\arctan \left (\frac {{\left (a + b\right )} e^{\left (-2 \, x\right )} + a - b}{2 \, \sqrt {a b}}\right )}{2 \, \sqrt {a b}} + \frac {x}{a + b} \]
[In]
[Out]
none
Time = 0.25 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.18 \[ \int \frac {\cosh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=\frac {b \arctan \left (\frac {a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} + a - b}{2 \, \sqrt {a b}}\right )}{\sqrt {a b} {\left (a + b\right )}} + \frac {x}{a + b} \]
[In]
[Out]
Time = 2.67 (sec) , antiderivative size = 208, normalized size of antiderivative = 5.47 \[ \int \frac {\cosh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=\frac {x}{a+b}+\frac {\sqrt {b}\,\mathrm {atan}\left (\frac {\left ({\mathrm {e}}^{2\,x}\,\left (\frac {4\,b}{{\left (a+b\right )}^4}+\frac {\left (a^2-b^2\right )\,\left (a-b\right )}{{\left (a+b\right )}^3\,\sqrt {a\,{\left (a+b\right )}^2}\,\sqrt {a^3+2\,a^2\,b+a\,b^2}}\right )+\frac {\left (a-b\right )\,\left (a^2+2\,a\,b+b^2\right )}{{\left (a+b\right )}^3\,\sqrt {a\,{\left (a+b\right )}^2}\,\sqrt {a^3+2\,a^2\,b+a\,b^2}}\right )\,\left (a^2\,\sqrt {a^3+2\,a^2\,b+a\,b^2}+b^2\,\sqrt {a^3+2\,a^2\,b+a\,b^2}+2\,a\,b\,\sqrt {a^3+2\,a^2\,b+a\,b^2}\right )}{2\,\sqrt {b}}\right )}{\sqrt {a^3+2\,a^2\,b+a\,b^2}} \]
[In]
[Out]