Optimal. Leaf size=83 \[ \frac {x}{b^2}+\frac {2 a \left (a^2+2 b^2\right ) \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{b^2 \left (a^2+b^2\right )^{3/2}}-\frac {a^2 \cosh (x)}{b \left (a^2+b^2\right ) (a+b \sinh (x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 83, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {2869, 2814,
2739, 632, 212} \begin {gather*} \frac {2 a \left (a^2+2 b^2\right ) \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{b^2 \left (a^2+b^2\right )^{3/2}}-\frac {a^2 \cosh (x)}{b \left (a^2+b^2\right ) (a+b \sinh (x))}+\frac {x}{b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 632
Rule 2739
Rule 2814
Rule 2869
Rubi steps
\begin {align*} \int \frac {\sinh ^2(x)}{(a+b \sinh (x))^2} \, dx &=-\frac {a^2 \cosh (x)}{b \left (a^2+b^2\right ) (a+b \sinh (x))}-\frac {i \int \frac {-i a b+i \left (a^2+b^2\right ) \sinh (x)}{a+b \sinh (x)} \, dx}{b \left (a^2+b^2\right )}\\ &=\frac {x}{b^2}-\frac {a^2 \cosh (x)}{b \left (a^2+b^2\right ) (a+b \sinh (x))}-\frac {\left (a \left (a^2+2 b^2\right )\right ) \int \frac {1}{a+b \sinh (x)} \, dx}{b^2 \left (a^2+b^2\right )}\\ &=\frac {x}{b^2}-\frac {a^2 \cosh (x)}{b \left (a^2+b^2\right ) (a+b \sinh (x))}-\frac {\left (2 a \left (a^2+2 b^2\right )\right ) \text {Subst}\left (\int \frac {1}{a+2 b x-a x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{b^2 \left (a^2+b^2\right )}\\ &=\frac {x}{b^2}-\frac {a^2 \cosh (x)}{b \left (a^2+b^2\right ) (a+b \sinh (x))}+\frac {\left (4 a \left (a^2+2 b^2\right )\right ) \text {Subst}\left (\int \frac {1}{4 \left (a^2+b^2\right )-x^2} \, dx,x,2 b-2 a \tanh \left (\frac {x}{2}\right )\right )}{b^2 \left (a^2+b^2\right )}\\ &=\frac {x}{b^2}+\frac {2 a \left (a^2+2 b^2\right ) \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{b^2 \left (a^2+b^2\right )^{3/2}}-\frac {a^2 \cosh (x)}{b \left (a^2+b^2\right ) (a+b \sinh (x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.14, size = 86, normalized size = 1.04 \begin {gather*} \frac {x+\frac {2 a \left (a^2+2 b^2\right ) \text {ArcTan}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {-a^2-b^2}}\right )}{\left (-a^2-b^2\right )^{3/2}}-\frac {a^2 b \cosh (x)}{\left (a^2+b^2\right ) (a+b \sinh (x))}}{b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.50, size = 127, normalized size = 1.53
method | result | size |
default | \(\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{b^{2}}-\frac {\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{b^{2}}+\frac {2 a \left (\frac {\frac {b^{2} \tanh \left (\frac {x}{2}\right )}{a^{2}+b^{2}}+\frac {a b}{a^{2}+b^{2}}}{a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-2 b \tanh \left (\frac {x}{2}\right )-a}-\frac {\left (a^{2}+2 b^{2}\right ) \arctanh \left (\frac {2 a \tanh \left (\frac {x}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )}{b^{2}}\) | \(127\) |
risch | \(\frac {x}{b^{2}}+\frac {2 a^{2} \left (a \,{\mathrm e}^{x}-b \right )}{b^{2} \left (a^{2}+b^{2}\right ) \left (b \,{\mathrm e}^{2 x}+2 a \,{\mathrm e}^{x}-b \right )}+\frac {a^{3} \ln \left ({\mathrm e}^{x}+\frac {a \left (a^{2}+b^{2}\right )^{\frac {3}{2}}+a^{4}+2 a^{2} b^{2}+b^{4}}{b \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}} b^{2}}+\frac {2 a \ln \left ({\mathrm e}^{x}+\frac {a \left (a^{2}+b^{2}\right )^{\frac {3}{2}}+a^{4}+2 a^{2} b^{2}+b^{4}}{b \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}}}-\frac {a^{3} \ln \left ({\mathrm e}^{x}+\frac {a \left (a^{2}+b^{2}\right )^{\frac {3}{2}}-a^{4}-2 a^{2} b^{2}-b^{4}}{b \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}} b^{2}}-\frac {2 a \ln \left ({\mathrm e}^{x}+\frac {a \left (a^{2}+b^{2}\right )^{\frac {3}{2}}-a^{4}-2 a^{2} b^{2}-b^{4}}{b \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\) | \(286\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 149, normalized size = 1.80 \begin {gather*} -\frac {{\left (a^{2} + 2 \, b^{2}\right )} a \log \left (\frac {b e^{\left (-x\right )} - a - \sqrt {a^{2} + b^{2}}}{b e^{\left (-x\right )} - a + \sqrt {a^{2} + b^{2}}}\right )}{{\left (a^{2} b^{2} + b^{4}\right )} \sqrt {a^{2} + b^{2}}} - \frac {2 \, {\left (a^{3} e^{\left (-x\right )} + a^{2} b\right )}}{a^{2} b^{3} + b^{5} + 2 \, {\left (a^{3} b^{2} + a b^{4}\right )} e^{\left (-x\right )} - {\left (a^{2} b^{3} + b^{5}\right )} e^{\left (-2 \, x\right )}} + \frac {x}{b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 521 vs.
\(2 (79) = 158\).
time = 0.44, size = 521, normalized size = 6.28 \begin {gather*} \frac {2 \, a^{4} b + 2 \, a^{2} b^{3} - {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} x \cosh \left (x\right )^{2} - {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} x \sinh \left (x\right )^{2} + {\left (a^{3} b + 2 \, a b^{3} - {\left (a^{3} b + 2 \, a b^{3}\right )} \cosh \left (x\right )^{2} - {\left (a^{3} b + 2 \, a b^{3}\right )} \sinh \left (x\right )^{2} - 2 \, {\left (a^{4} + 2 \, a^{2} b^{2}\right )} \cosh \left (x\right ) - 2 \, {\left (a^{4} + 2 \, a^{2} b^{2} + {\left (a^{3} b + 2 \, a b^{3}\right )} \cosh \left (x\right )\right )} \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 ) + {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} x - 2 \, {\left (a^{5} + a^{3} b^{2} + {\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} x\right )} \cosh \left (x\right ) - 2 \, {\left (a^{5} + a^{3} b^{2} + {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} x \cosh \left (x\right ) + {\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} x\right )} \sinh \left (x\right )}{a^{4} b^{3} + 2 \, a^{2} b^{5} + b^{7} - {\left (a^{4} b^{3} + 2 \, a^{2} b^{5} + b^{7}\right )} \cosh \left (x\right )^{2} - {\left (a^{4} b^{3} + 2 \, a^{2} b^{5} + b^{7}\right )} \sinh \left (x\right )^{2} - 2 \, {\left (a^{5} b^{2} + 2 \, a^{3} b^{4} + a b^{6}\right )} \cosh \left (x\right ) - 2 \, {\left (a^{5} b^{2} + 2 \, a^{3} b^{4} + a b^{6} + {\left (a^{4} b^{3} + 2 \, a^{2} b^{5} + b^{7}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 131, normalized size = 1.58 \begin {gather*} -\frac {{\left (a^{3} + 2 \, a b^{2}\right )} \log \left (\frac {{\left | 2 \, b e^{x} + 2 \, a - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, b e^{x} + 2 \, a + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{{\left (a^{2} b^{2} + b^{4}\right )} \sqrt {a^{2} + b^{2}}} + \frac {2 \, {\left (a^{3} e^{x} - a^{2} b\right )}}{{\left (a^{2} b^{2} + b^{4}\right )} {\left (b e^{\left (2 \, x\right )} + 2 \, a e^{x} - b\right )}} + \frac {x}{b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.79, size = 228, normalized size = 2.75 \begin {gather*} \frac {x}{b^2}-\frac {\frac {2\,a^2}{a^2\,b+b^3}-\frac {2\,a^3\,{\mathrm {e}}^x}{b\,\left (a^2\,b+b^3\right )}}{2\,a\,{\mathrm {e}}^x-b+b\,{\mathrm {e}}^{2\,x}}-\frac {a\,\ln \left (\frac {2\,{\mathrm {e}}^x\,\left (a^3+2\,a\,b^2\right )}{b^3\,\left (a^2+b^2\right )}-\frac {2\,a\,\left (a^2+2\,b^2\right )\,\left (b-a\,{\mathrm {e}}^x\right )}{b^3\,{\left (a^2+b^2\right )}^{3/2}}\right )\,\left (a^2+2\,b^2\right )}{b^2\,{\left (a^2+b^2\right )}^{3/2}}+\frac {a\,\ln \left (\frac {2\,{\mathrm {e}}^x\,\left (a^3+2\,a\,b^2\right )}{b^3\,\left (a^2+b^2\right )}+\frac {2\,a\,\left (a^2+2\,b^2\right )\,\left (b-a\,{\mathrm {e}}^x\right )}{b^3\,{\left (a^2+b^2\right )}^{3/2}}\right )\,\left (a^2+2\,b^2\right )}{b^2\,{\left (a^2+b^2\right )}^{3/2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________