Optimal. Leaf size=92 \[ -\frac {\sinh ^2(x) (b-a \coth (x))}{2 \left (a^2-b^2\right )}-\frac {b^3 \log (a+b \coth (x))}{\left (a^2-b^2\right )^2}+\frac {(a+2 b) \log (1-\coth (x))}{4 (a+b)^2}-\frac {(a-2 b) \log (\coth (x)+1)}{4 (a-b)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.14, antiderivative size = 92, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3506, 741, 801} \[ -\frac {b^3 \log (a+b \coth (x))}{\left (a^2-b^2\right )^2}-\frac {\sinh ^2(x) (b-a \coth (x))}{2 \left (a^2-b^2\right )}+\frac {(a+2 b) \log (1-\coth (x))}{4 (a+b)^2}-\frac {(a-2 b) \log (\coth (x)+1)}{4 (a-b)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 741
Rule 801
Rule 3506
Rubi steps
\begin {align*} \int \frac {\sinh ^2(x)}{a+b \coth (x)} \, dx &=-\frac {\operatorname {Subst}\left (\int \frac {1}{(a+x) \left (1-\frac {x^2}{b^2}\right )^2} \, dx,x,b \coth (x)\right )}{b}\\ &=-\frac {(b-a \coth (x)) \sinh ^2(x)}{2 \left (a^2-b^2\right )}-\frac {b \operatorname {Subst}\left (\int \frac {-2+\frac {a^2}{b^2}+\frac {a x}{b^2}}{(a+x) \left (1-\frac {x^2}{b^2}\right )} \, dx,x,b \coth (x)\right )}{2 \left (a^2-b^2\right )}\\ &=-\frac {(b-a \coth (x)) \sinh ^2(x)}{2 \left (a^2-b^2\right )}-\frac {b \operatorname {Subst}\left (\int \left (\frac {(a-b) (a+2 b)}{2 b (a+b) (b-x)}+\frac {2 b^2}{(a-b) (a+b) (a+x)}+\frac {(a-2 b) (a+b)}{2 (a-b) b (b+x)}\right ) \, dx,x,b \coth (x)\right )}{2 \left (a^2-b^2\right )}\\ &=\frac {(a+2 b) \log (1-\coth (x))}{4 (a+b)^2}-\frac {(a-2 b) \log (1+\coth (x))}{4 (a-b)^2}-\frac {b^3 \log (a+b \coth (x))}{\left (a^2-b^2\right )^2}-\frac {(b-a \coth (x)) \sinh ^2(x)}{2 \left (a^2-b^2\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.17, size = 75, normalized size = 0.82 \[ \frac {-2 a^3 x+\left (b^3-a^2 b\right ) \cosh (2 x)+a \left (a^2-b^2\right ) \sinh (2 x)-4 b^3 \log (a \sinh (x)+b \cosh (x))+6 a b^2 x}{4 (a-b)^2 (a+b)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.41, size = 331, normalized size = 3.60 \[ \frac {{\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \relax (x)^{4} + 4 \, {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \relax (x) \sinh \relax (x)^{3} + {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \sinh \relax (x)^{4} - 4 \, {\left (a^{3} - 3 \, a b^{2} - 2 \, b^{3}\right )} x \cosh \relax (x)^{2} - a^{3} - a^{2} b + a b^{2} + b^{3} + 2 \, {\left (3 \, {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \relax (x)^{2} - 2 \, {\left (a^{3} - 3 \, a b^{2} - 2 \, b^{3}\right )} x\right )} \sinh \relax (x)^{2} - 8 \, {\left (b^{3} \cosh \relax (x)^{2} + 2 \, b^{3} \cosh \relax (x) \sinh \relax (x) + b^{3} \sinh \relax (x)^{2}\right )} \log \left (\frac {2 \, {\left (b \cosh \relax (x) + a \sinh \relax (x)\right )}}{\cosh \relax (x) - \sinh \relax (x)}\right ) + 4 \, {\left ({\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \relax (x)^{3} - 2 \, {\left (a^{3} - 3 \, a b^{2} - 2 \, b^{3}\right )} x \cosh \relax (x)\right )} \sinh \relax (x)}{8 \, {\left ({\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \relax (x)^{2} + 2 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \relax (x) \sinh \relax (x) + {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sinh \relax (x)^{2}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.12, size = 114, normalized size = 1.24 \[ -\frac {b^{3} \log \left ({\left | -a e^{\left (2 \, x\right )} - b e^{\left (2 \, x\right )} + a - b \right |}\right )}{a^{4} - 2 \, a^{2} b^{2} + b^{4}} - \frac {{\left (a - 2 \, b\right )} x}{2 \, {\left (a^{2} - 2 \, a b + b^{2}\right )}} + \frac {{\left (2 \, a e^{\left (2 \, x\right )} - 4 \, b e^{\left (2 \, x\right )} - a + b\right )} e^{\left (-2 \, x\right )}}{8 \, {\left (a^{2} - 2 \, a b + b^{2}\right )}} + \frac {e^{\left (2 \, x\right )}}{8 \, {\left (a + b\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.13, size = 175, normalized size = 1.90 \[ -\frac {b^{3} \ln \left (\left (\tanh ^{2}\left (\frac {x}{2}\right )\right ) b +2 a \tanh \left (\frac {x}{2}\right )+b \right )}{\left (a -b \right )^{2} \left (a +b \right )^{2}}+\frac {8}{\left (16 a +16 b \right ) \left (\tanh \left (\frac {x}{2}\right )-1\right )^{2}}+\frac {16}{\left (32 a +32 b \right ) \left (\tanh \left (\frac {x}{2}\right )-1\right )}+\frac {\ln \left (\tanh \left (\frac {x}{2}\right )-1\right ) a}{2 \left (a +b \right )^{2}}+\frac {\ln \left (\tanh \left (\frac {x}{2}\right )-1\right ) b}{\left (a +b \right )^{2}}-\frac {8}{\left (16 a -16 b \right ) \left (\tanh \left (\frac {x}{2}\right )+1\right )^{2}}+\frac {16}{\left (32 a -32 b \right ) \left (\tanh \left (\frac {x}{2}\right )+1\right )}-\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+1\right ) a}{2 \left (a -b \right )^{2}}+\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+1\right ) b}{\left (a -b \right )^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.33, size = 83, normalized size = 0.90 \[ -\frac {b^{3} \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} + a + b\right )}{a^{4} - 2 \, a^{2} b^{2} + b^{4}} - \frac {{\left (a + 2 \, b\right )} x}{2 \, {\left (a^{2} + 2 \, a b + b^{2}\right )}} + \frac {e^{\left (2 \, x\right )}}{8 \, {\left (a + b\right )}} - \frac {e^{\left (-2 \, x\right )}}{8 \, {\left (a - b\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.47, size = 85, normalized size = 0.92 \[ \frac {{\mathrm {e}}^{2\,x}}{8\,a+8\,b}-\frac {{\mathrm {e}}^{-2\,x}}{8\,a-8\,b}-\frac {b^3\,\ln \left (b-a+a\,{\mathrm {e}}^{2\,x}+b\,{\mathrm {e}}^{2\,x}\right )}{a^4-2\,a^2\,b^2+b^4}-\frac {x\,\left (a-2\,b\right )}{2\,{\left (a-b\right )}^2} \]
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 {\sinh ^{2}{\relax (x )}}{a + b \coth {\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________