Optimal. Leaf size=52 \[ \frac {x}{2 b}-\frac {\sqrt {a-b} \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh (x)}{\sqrt {a+b}}\right )}{2 b \sqrt {a+b}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11, antiderivative size = 52, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 2, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {1093, 208} \[ \frac {x}{2 b}-\frac {\sqrt {a-b} \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh (x)}{\sqrt {a+b}}\right )}{2 b \sqrt {a+b}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 208
Rule 1093
Rubi steps
\begin {align*} \int \frac {\cosh ^2(x)}{a+b \cosh (2 x)} \, dx &=\operatorname {Subst}\left (\int \frac {1}{a+b-2 a x^2+(a-b) x^4} \, dx,x,\tanh (x)\right )\\ &=\frac {(a-b) \operatorname {Subst}\left (\int \frac {1}{-a-b+(a-b) x^2} \, dx,x,\tanh (x)\right )}{2 b}-\frac {(a-b) \operatorname {Subst}\left (\int \frac {1}{-a+b+(a-b) x^2} \, dx,x,\tanh (x)\right )}{2 b}\\ &=\frac {x}{2 b}-\frac {\sqrt {a-b} \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh (x)}{\sqrt {a+b}}\right )}{2 b \sqrt {a+b}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.06, size = 50, normalized size = 0.96 \[ \frac {\frac {(a-b) \tan ^{-1}\left (\frac {(a-b) \tanh (x)}{\sqrt {b^2-a^2}}\right )}{\sqrt {b^2-a^2}}+x}{2 b} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.57, size = 297, normalized size = 5.71 \[ \left [\frac {\sqrt {\frac {a - b}{a + b}} \log \left (\frac {b^{2} \cosh \relax (x)^{4} + 4 \, b^{2} \cosh \relax (x) \sinh \relax (x)^{3} + b^{2} \sinh \relax (x)^{4} + 2 \, a b \cosh \relax (x)^{2} + 2 \, {\left (3 \, b^{2} \cosh \relax (x)^{2} + a b\right )} \sinh \relax (x)^{2} + 2 \, a^{2} - b^{2} + 4 \, {\left (b^{2} \cosh \relax (x)^{3} + a b \cosh \relax (x)\right )} \sinh \relax (x) + 2 \, {\left ({\left (a b + b^{2}\right )} \cosh \relax (x)^{2} + 2 \, {\left (a b + b^{2}\right )} \cosh \relax (x) \sinh \relax (x) + {\left (a b + b^{2}\right )} \sinh \relax (x)^{2} + a^{2} + a b\right )} \sqrt {\frac {a - b}{a + b}}}{b \cosh \relax (x)^{4} + 4 \, b \cosh \relax (x) \sinh \relax (x)^{3} + b \sinh \relax (x)^{4} + 2 \, a \cosh \relax (x)^{2} + 2 \, {\left (3 \, b \cosh \relax (x)^{2} + a\right )} \sinh \relax (x)^{2} + 4 \, {\left (b \cosh \relax (x)^{3} + a \cosh \relax (x)\right )} \sinh \relax (x) + b}\right ) + 2 \, x}{4 \, b}, \frac {\sqrt {-\frac {a - b}{a + b}} \arctan \left (-\frac {{\left (b \cosh \relax (x)^{2} + 2 \, b \cosh \relax (x) \sinh \relax (x) + b \sinh \relax (x)^{2} + a\right )} \sqrt {-\frac {a - b}{a + b}}}{a - b}\right ) + x}{2 \, b}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.14, size = 49, normalized size = 0.94 \[ -\frac {{\left (a - b\right )} \arctan \left (\frac {b e^{\left (2 \, x\right )} + a}{\sqrt {-a^{2} + b^{2}}}\right )}{2 \, \sqrt {-a^{2} + b^{2}} b} + \frac {x}{2 \, b} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.26, size = 92, normalized size = 1.77 \[ -\frac {\ln \left (\tanh \relax (x )-1\right )}{4 b}+\frac {\ln \left (1+\tanh \relax (x )\right )}{4 b}-\frac {\arctanh \left (\frac {\left (a -b \right ) \tanh \relax (x )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right ) a}{2 b \sqrt {\left (a +b \right ) \left (a -b \right )}}+\frac {\arctanh \left (\frac {\left (a -b \right ) \tanh \relax (x )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{2 \sqrt {\left (a +b \right ) \left (a -b \right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.26, size = 120, normalized size = 2.31 \[ \frac {x}{2\,b}-\frac {\ln \left (\frac {{\mathrm {e}}^{2\,x}\,\left (a-b\right )}{b^2}+\frac {\sqrt {a-b}\,\left (b+a\,{\mathrm {e}}^{2\,x}\right )}{b^2\,\sqrt {a+b}}\right )\,\sqrt {a-b}}{4\,b\,\sqrt {a+b}}+\frac {\ln \left (\frac {{\mathrm {e}}^{2\,x}\,\left (a-b\right )}{b^2}-\frac {\sqrt {a-b}\,\left (b+a\,{\mathrm {e}}^{2\,x}\right )}{b^2\,\sqrt {a+b}}\right )\,\sqrt {a-b}}{4\,b\,\sqrt {a+b}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\cosh ^{2}{\relax (x )}}{a + b \cosh {\left (2 x \right )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________