Optimal. Leaf size=52 \[ \frac{\tanh ^{-1}\left (\frac{b-a \tanh (x)}{\sqrt{a^2+b^2}}\right )}{2 \sqrt{a^2+b^2}}+\frac{\log (a+b \sinh (2 x))}{4 b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.162048, antiderivative size = 68, normalized size of antiderivative = 1.31, number of steps used = 9, number of rules used = 7, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.467, Rules used = {1075, 12, 634, 618, 206, 628, 260} \[ \frac{\tanh ^{-1}\left (\frac{b-a \tanh (x)}{\sqrt{a^2+b^2}}\right )}{2 \sqrt{a^2+b^2}}+\frac{\log \left (-a \tanh ^2(x)+a+2 b \tanh (x)\right )}{4 b}+\frac{\log (\cosh (x))}{2 b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1075
Rule 12
Rule 634
Rule 618
Rule 206
Rule 628
Rule 260
Rubi steps
\begin{align*} \int \frac{\sinh ^2(x)}{a+b \sinh (2 x)} \, dx &=-\operatorname{Subst}\left (\int \frac{x^2}{\left (-1+x^2\right ) \left (a+2 b x-a x^2\right )} \, dx,x,\tanh (x)\right )\\ &=\frac{\operatorname{Subst}\left (\int -\frac{2 b x}{-1+x^2} \, dx,x,\tanh (x)\right )}{4 b^2}+\frac{\operatorname{Subst}\left (\int -\frac{2 a b x}{a+2 b x-a x^2} \, dx,x,\tanh (x)\right )}{4 b^2}\\ &=-\frac{\operatorname{Subst}\left (\int \frac{x}{-1+x^2} \, dx,x,\tanh (x)\right )}{2 b}-\frac{a \operatorname{Subst}\left (\int \frac{x}{a+2 b x-a x^2} \, dx,x,\tanh (x)\right )}{2 b}\\ &=\frac{\log (\cosh (x))}{2 b}-\frac{1}{2} \operatorname{Subst}\left (\int \frac{1}{a+2 b x-a x^2} \, dx,x,\tanh (x)\right )+\frac{\operatorname{Subst}\left (\int \frac{2 b-2 a x}{a+2 b x-a x^2} \, dx,x,\tanh (x)\right )}{4 b}\\ &=\frac{\log (\cosh (x))}{2 b}+\frac{\log \left (a+2 b \tanh (x)-a \tanh ^2(x)\right )}{4 b}+\operatorname{Subst}\left (\int \frac{1}{4 \left (a^2+b^2\right )-x^2} \, dx,x,2 b-2 a \tanh (x)\right )\\ &=\frac{\tanh ^{-1}\left (\frac{2 b-2 a \tanh (x)}{2 \sqrt{a^2+b^2}}\right )}{2 \sqrt{a^2+b^2}}+\frac{\log (\cosh (x))}{2 b}+\frac{\log \left (a+2 b \tanh (x)-a \tanh ^2(x)\right )}{4 b}\\ \end{align*}
Mathematica [A] time = 0.0837305, size = 59, normalized size = 1.13 \[ \frac{1}{4} \left (\frac{\log (a+b \sinh (2 x))}{b}-\frac{2 \tan ^{-1}\left (\frac{b-a \tanh (x)}{\sqrt{-a^2-b^2}}\right )}{\sqrt{-a^2-b^2}}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.053, size = 75, normalized size = 1.4 \begin{align*} -{\frac{\ln \left ( 1+\tanh \left ( x \right ) \right ) }{4\,b}}+{\frac{\ln \left ( a \left ( \tanh \left ( x \right ) \right ) ^{2}-2\,b\tanh \left ( x \right ) -a \right ) }{4\,b}}-{\frac{1}{2}{\it Artanh} \left ({\frac{2\,a\tanh \left ( x \right ) -2\,b}{2}{\frac{1}{\sqrt{{a}^{2}+{b}^{2}}}}} \right ){\frac{1}{\sqrt{{a}^{2}+{b}^{2}}}}}-{\frac{\ln \left ( \tanh \left ( x \right ) -1 \right ) }{4\,b}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.89932, size = 730, normalized size = 14.04 \begin{align*} \frac{\sqrt{a^{2} + b^{2}} b \log \left (\frac{b^{2} \cosh \left (x\right )^{4} + 4 \, b^{2} \cosh \left (x\right ) \sinh \left (x\right )^{3} + b^{2} \sinh \left (x\right )^{4} + 2 \, a b \cosh \left (x\right )^{2} + 2 \,{\left (3 \, b^{2} \cosh \left (x\right )^{2} + a b\right )} \sinh \left (x\right )^{2} + 2 \, a^{2} + b^{2} + 4 \,{\left (b^{2} \cosh \left (x\right )^{3} + a b \cosh \left (x\right )\right )} \sinh \left (x\right ) + 2 \,{\left (b \cosh \left (x\right )^{2} + 2 \, b \cosh \left (x\right ) \sinh \left (x\right ) + b \sinh \left (x\right )^{2} + a\right )} \sqrt{a^{2} + b^{2}}}{b \cosh \left (x\right )^{4} + 4 \, b \cosh \left (x\right ) \sinh \left (x\right )^{3} + b \sinh \left (x\right )^{4} + 2 \, a \cosh \left (x\right )^{2} + 2 \,{\left (3 \, b \cosh \left (x\right )^{2} + a\right )} \sinh \left (x\right )^{2} + 4 \,{\left (b \cosh \left (x\right )^{3} + a \cosh \left (x\right )\right )} \sinh \left (x\right ) - b}\right ) - 2 \,{\left (a^{2} + b^{2}\right )} x +{\left (a^{2} + b^{2}\right )} \log \left (\frac{2 \,{\left (2 \, b \cosh \left (x\right ) \sinh \left (x\right ) + a\right )}}{\cosh \left (x\right )^{2} - 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2}}\right )}{4 \,{\left (a^{2} b + b^{3}\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sinh ^{2}{\left (x \right )}}{a + b \sinh{\left (2 x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.21357, size = 124, normalized size = 2.38 \begin{align*} -\frac{\log \left (\frac{{\left | 2 \, b e^{\left (2 \, x\right )} + 2 \, a - 2 \, \sqrt{a^{2} + b^{2}} \right |}}{{\left | 2 \, b e^{\left (2 \, x\right )} + 2 \, a + 2 \, \sqrt{a^{2} + b^{2}} \right |}}\right )}{4 \, \sqrt{a^{2} + b^{2}}} - \frac{x}{2 \, b} + \frac{\log \left ({\left | b e^{\left (4 \, x\right )} + 2 \, a e^{\left (2 \, x\right )} - b \right |}\right )}{4 \, b} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]