Optimal. Leaf size=76 \[ \frac {a x}{a^2-b^2}-\frac {b \log (\sinh (x))}{a^2-b^2}-\frac {a^4 \log (a+b \coth (x))}{b^3 \left (a^2-b^2\right )}+\frac {a \coth (x)}{b^2}-\frac {\coth ^2(x)}{2 b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.22, antiderivative size = 76, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.462, Rules used = {3566, 3647, 3627, 3617, 31, 3475} \[ \frac {a x}{a^2-b^2}-\frac {b \log (\sinh (x))}{a^2-b^2}-\frac {a^4 \log (a+b \coth (x))}{b^3 \left (a^2-b^2\right )}+\frac {a \coth (x)}{b^2}-\frac {\coth ^2(x)}{2 b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 3475
Rule 3566
Rule 3617
Rule 3627
Rule 3647
Rubi steps
\begin {align*} \int \frac {\coth ^4(x)}{a+b \coth (x)} \, dx &=-\frac {\coth ^2(x)}{2 b}-\frac {\int \frac {\coth (x) \left (-2 a-2 b \coth (x)+2 a \coth ^2(x)\right )}{a+b \coth (x)} \, dx}{2 b}\\ &=\frac {a \coth (x)}{b^2}-\frac {\coth ^2(x)}{2 b}-\frac {\int \frac {2 a^2-2 \left (a^2+b^2\right ) \coth ^2(x)}{a+b \coth (x)} \, dx}{2 b^2}\\ &=\frac {a x}{a^2-b^2}+\frac {a \coth (x)}{b^2}-\frac {\coth ^2(x)}{2 b}-\frac {a^4 \int \frac {1-\coth ^2(x)}{a+b \coth (x)} \, dx}{b^2 \left (a^2-b^2\right )}-\frac {b \int \coth (x) \, dx}{a^2-b^2}\\ &=\frac {a x}{a^2-b^2}+\frac {a \coth (x)}{b^2}-\frac {\coth ^2(x)}{2 b}-\frac {b \log (\sinh (x))}{a^2-b^2}-\frac {a^4 \operatorname {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \coth (x)\right )}{b^3 \left (a^2-b^2\right )}\\ &=\frac {a x}{a^2-b^2}+\frac {a \coth (x)}{b^2}-\frac {\coth ^2(x)}{2 b}-\frac {a^4 \log (a+b \coth (x))}{b^3 \left (a^2-b^2\right )}-\frac {b \log (\sinh (x))}{a^2-b^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.23, size = 88, normalized size = 1.16 \[ \frac {2 \left (a^4-b^4\right ) \log (\sinh (x))-2 a^4 \log (a \sinh (x)+b \cosh (x))+2 a b \left (a^2-b^2\right ) \coth (x)+\left (b^4-a^2 b^2\right ) \text {csch}^2(x)+2 a b^3 x}{2 b^3 (a-b) (a+b)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.45, size = 648, normalized size = 8.53 \[ \frac {{\left (a b^{3} + b^{4}\right )} x \cosh \relax (x)^{4} + 4 \, {\left (a b^{3} + b^{4}\right )} x \cosh \relax (x) \sinh \relax (x)^{3} + {\left (a b^{3} + b^{4}\right )} x \sinh \relax (x)^{4} - 2 \, a^{3} b + 2 \, a b^{3} + 2 \, {\left (a^{3} b - a^{2} b^{2} - a b^{3} + b^{4} - {\left (a b^{3} + b^{4}\right )} x\right )} \cosh \relax (x)^{2} + 2 \, {\left (a^{3} b - a^{2} b^{2} - a b^{3} + b^{4} + 3 \, {\left (a b^{3} + b^{4}\right )} x \cosh \relax (x)^{2} - {\left (a b^{3} + b^{4}\right )} x\right )} \sinh \relax (x)^{2} + {\left (a b^{3} + b^{4}\right )} x - {\left (a^{4} \cosh \relax (x)^{4} + 4 \, a^{4} \cosh \relax (x) \sinh \relax (x)^{3} + a^{4} \sinh \relax (x)^{4} - 2 \, a^{4} \cosh \relax (x)^{2} + a^{4} + 2 \, {\left (3 \, a^{4} \cosh \relax (x)^{2} - a^{4}\right )} \sinh \relax (x)^{2} + 4 \, {\left (a^{4} \cosh \relax (x)^{3} - a^{4} \cosh \relax (x)\right )} \sinh \relax (x)\right )} \log \left (\frac {2 \, {\left (b \cosh \relax (x) + a \sinh \relax (x)\right )}}{\cosh \relax (x) - \sinh \relax (x)}\right ) + {\left ({\left (a^{4} - b^{4}\right )} \cosh \relax (x)^{4} + 4 \, {\left (a^{4} - b^{4}\right )} \cosh \relax (x) \sinh \relax (x)^{3} + {\left (a^{4} - b^{4}\right )} \sinh \relax (x)^{4} + a^{4} - b^{4} - 2 \, {\left (a^{4} - b^{4}\right )} \cosh \relax (x)^{2} - 2 \, {\left (a^{4} - b^{4} - 3 \, {\left (a^{4} - b^{4}\right )} \cosh \relax (x)^{2}\right )} \sinh \relax (x)^{2} + 4 \, {\left ({\left (a^{4} - b^{4}\right )} \cosh \relax (x)^{3} - {\left (a^{4} - b^{4}\right )} \cosh \relax (x)\right )} \sinh \relax (x)\right )} \log \left (\frac {2 \, \sinh \relax (x)}{\cosh \relax (x) - \sinh \relax (x)}\right ) + 4 \, {\left ({\left (a b^{3} + b^{4}\right )} x \cosh \relax (x)^{3} + {\left (a^{3} b - a^{2} b^{2} - a b^{3} + b^{4} - {\left (a b^{3} + b^{4}\right )} x\right )} \cosh \relax (x)\right )} \sinh \relax (x)}{a^{2} b^{3} - b^{5} + {\left (a^{2} b^{3} - b^{5}\right )} \cosh \relax (x)^{4} + 4 \, {\left (a^{2} b^{3} - b^{5}\right )} \cosh \relax (x) \sinh \relax (x)^{3} + {\left (a^{2} b^{3} - b^{5}\right )} \sinh \relax (x)^{4} - 2 \, {\left (a^{2} b^{3} - b^{5}\right )} \cosh \relax (x)^{2} - 2 \, {\left (a^{2} b^{3} - b^{5} - 3 \, {\left (a^{2} b^{3} - b^{5}\right )} \cosh \relax (x)^{2}\right )} \sinh \relax (x)^{2} + 4 \, {\left ({\left (a^{2} b^{3} - b^{5}\right )} \cosh \relax (x)^{3} - {\left (a^{2} b^{3} - b^{5}\right )} \cosh \relax (x)\right )} \sinh \relax (x)} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.14, size = 100, normalized size = 1.32 \[ -\frac {a^{4} \log \left ({\left | a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} - a + b \right |}\right )}{a^{2} b^{3} - b^{5}} + \frac {x}{a - b} + \frac {{\left (a^{2} + b^{2}\right )} \log \left ({\left | e^{\left (2 \, x\right )} - 1 \right |}\right )}{b^{3}} - \frac {2 \, {\left (a b - {\left (a b - b^{2}\right )} e^{\left (2 \, x\right )}\right )}}{b^{3} {\left (e^{\left (2 \, x\right )} - 1\right )}^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.06, size = 76, normalized size = 1.00 \[ -\frac {\coth ^{2}\relax (x )}{2 b}+\frac {a \coth \relax (x )}{b^{2}}-\frac {\ln \left (\coth \relax (x )-1\right )}{2 b +2 a}+\frac {\ln \left (1+\coth \relax (x )\right )}{2 a -2 b}-\frac {a^{4} \ln \left (a +b \coth \relax (x )\right )}{b^{3} \left (a +b \right ) \left (a -b \right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.98, size = 119, normalized size = 1.57 \[ -\frac {a^{4} \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} + a + b\right )}{a^{2} b^{3} - b^{5}} + \frac {2 \, {\left ({\left (a + b\right )} e^{\left (-2 \, x\right )} - a\right )}}{2 \, b^{2} e^{\left (-2 \, x\right )} - b^{2} e^{\left (-4 \, x\right )} - b^{2}} + \frac {x}{a + b} + \frac {{\left (a^{2} + b^{2}\right )} \log \left (e^{\left (-x\right )} + 1\right )}{b^{3}} + \frac {{\left (a^{2} + b^{2}\right )} \log \left (e^{\left (-x\right )} - 1\right )}{b^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.63, size = 110, normalized size = 1.45 \[ \frac {x}{a-b}-\frac {2}{b\,\left ({\mathrm {e}}^{4\,x}-2\,{\mathrm {e}}^{2\,x}+1\right )}+\frac {\ln \left ({\mathrm {e}}^{2\,x}-1\right )\,\left (a^2+b^2\right )}{b^3}+\frac {a^4\,\ln \left (b-a+a\,{\mathrm {e}}^{2\,x}+b\,{\mathrm {e}}^{2\,x}\right )}{b^5-a^2\,b^3}+\frac {2\,\left (a^2-b^2\right )}{b^2\,\left (a+b\right )\,\left ({\mathrm {e}}^{2\,x}-1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 3.40, size = 882, normalized size = 11.61 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________