Integrand size = 20, antiderivative size = 39 \[ \int \frac {\sinh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=\frac {x}{a+b}-\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a}}\right )}{\sqrt {b} (a+b)} \]
[Out]
Time = 0.11 (sec) , antiderivative size = 39, 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 = {492, 213, 211} \[ \int \frac {\sinh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=\frac {x}{a+b}-\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a}}\right )}{\sqrt {b} (a+b)} \]
[In]
[Out]
Rule 211
Rule 213
Rule 492
Rubi steps \begin{align*} \text {integral}& = -\text {Subst}\left (\int \frac {x^2}{\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 {a \text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\tanh (x)\right )}{a+b} \\ & = \frac {x}{a+b}-\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a}}\right )}{\sqrt {b} (a+b)} \\ \end{align*}
Time = 0.31 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.87 \[ \int \frac {\sinh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=\frac {x-\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a}}\right )}{\sqrt {b}}}{a+b} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(91\) vs. \(2(31)=62\).
Time = 0.18 (sec) , antiderivative size = 92, normalized size of antiderivative = 2.36
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 b \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 b \left (a +b \right )}\) | \(92\) |
default | \(\frac {8 a^{2} \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 )}{4 a +4 b}+\frac {8 \ln \left (1+\tanh \left (\frac {x}{2}\right )\right )}{8 a +8 b}-\frac {8 \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{8 a +8 b}\) | \(191\) |
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 367, normalized size of antiderivative = 9.41 \[ \int \frac {\sinh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=\left [\frac {\sqrt {-\frac {a}{b}} \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 b + b^{2}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a b + b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a b + b^{2}\right )} \sinh \left (x\right )^{2} + a b - b^{2}\right )} \sqrt {-\frac {a}{b}}}{{\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 {a}{b}} \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 {a}{b}}}{2 \, a}\right ) - x}{a + b}\right ] \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 202 vs. \(2 (32) = 64\).
Time = 0.59 (sec) , antiderivative size = 202, normalized size of antiderivative = 5.18 \[ \int \frac {\sinh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=\begin {cases} \tilde {\infty } x & \text {for}\: a = 0 \wedge b = 0 \\\frac {x}{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 - \frac {\sinh {\left (x \right )}}{\cosh {\left (x \right )}}}{a} & \text {for}\: b = 0 \\\frac {2 x \sqrt {- \frac {b}{a}}}{2 a \sqrt {- \frac {b}{a}} + 2 b \sqrt {- \frac {b}{a}}} + \frac {\log {\left (- \sqrt {- \frac {b}{a}} \sinh {\left (x \right )} + \cosh {\left (x \right )} \right )}}{2 a \sqrt {- \frac {b}{a}} + 2 b \sqrt {- \frac {b}{a}}} - \frac {\log {\left (\sqrt {- \frac {b}{a}} \sinh {\left (x \right )} + \cosh {\left (x \right )} \right )}}{2 a \sqrt {- \frac {b}{a}} + 2 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 (31) = 62\).
Time = 0.30 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.90 \[ \int \frac {\sinh ^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.27 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.18 \[ \int \frac {\sinh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=-\frac {a \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.91 (sec) , antiderivative size = 209, normalized size of antiderivative = 5.36 \[ \int \frac {\sinh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=\frac {x}{a+b}-\frac {\sqrt {a}\,\mathrm {atan}\left (\frac {\left ({\mathrm {e}}^{2\,x}\,\left (\frac {4\,a}{{\left (a+b\right )}^4}+\frac {\left (a^2-b^2\right )\,\left (a-b\right )}{{\left (a+b\right )}^3\,\sqrt {b\,{\left (a+b\right )}^2}\,\sqrt {a^2\,b+2\,a\,b^2+b^3}}\right )+\frac {\left (a-b\right )\,\left (a^2+2\,a\,b+b^2\right )}{{\left (a+b\right )}^3\,\sqrt {b\,{\left (a+b\right )}^2}\,\sqrt {a^2\,b+2\,a\,b^2+b^3}}\right )\,\left (a^2\,\sqrt {a^2\,b+2\,a\,b^2+b^3}+b^2\,\sqrt {a^2\,b+2\,a\,b^2+b^3}+2\,a\,b\,\sqrt {a^2\,b+2\,a\,b^2+b^3}\right )}{2\,\sqrt {a}}\right )}{\sqrt {a^2\,b+2\,a\,b^2+b^3}} \]
[In]
[Out]