Optimal. Leaf size=76 \[ -\frac {b x}{a^2-b^2}+\frac {b \coth (x)}{a^2}-\frac {\coth ^2(x)}{2 a}+\frac {\left (a^2+b^2\right ) \log (\sinh (x))}{a^3}+\frac {b^4 \log (a \cosh (x)+b \sinh (x))}{a^3 \left (a^2-b^2\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.21, antiderivative size = 76, 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 = {3650, 3730,
3733, 3611, 3556} \begin {gather*} -\frac {b x}{a^2-b^2}+\frac {b \coth (x)}{a^2}+\frac {\left (a^2+b^2\right ) \log (\sinh (x))}{a^3}+\frac {b^4 \log (a \cosh (x)+b \sinh (x))}{a^3 \left (a^2-b^2\right )}-\frac {\coth ^2(x)}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3611
Rule 3650
Rule 3730
Rule 3733
Rubi steps
\begin {align*} \int \frac {\coth ^3(x)}{a+b \tanh (x)} \, dx &=-\frac {\coth ^2(x)}{2 a}-\frac {i \int \frac {\coth ^2(x) \left (-2 i b+2 i a \tanh (x)+2 i b \tanh ^2(x)\right )}{a+b \tanh (x)} \, dx}{2 a}\\ &=\frac {b \coth (x)}{a^2}-\frac {\coth ^2(x)}{2 a}-\frac {\int \frac {\coth (x) \left (-2 \left (a^2+b^2\right )+2 b^2 \tanh ^2(x)\right )}{a+b \tanh (x)} \, dx}{2 a^2}\\ &=-\frac {b x}{a^2-b^2}+\frac {b \coth (x)}{a^2}-\frac {\coth ^2(x)}{2 a}+\frac {\left (i b^4\right ) \int \frac {-i b-i a \tanh (x)}{a+b \tanh (x)} \, dx}{a^3 \left (a^2-b^2\right )}+\frac {\left (a^2+b^2\right ) \int \coth (x) \, dx}{a^3}\\ &=-\frac {b x}{a^2-b^2}+\frac {b \coth (x)}{a^2}-\frac {\coth ^2(x)}{2 a}+\frac {\left (a^2+b^2\right ) \log (\sinh (x))}{a^3}+\frac {b^4 \log (a \cosh (x)+b \sinh (x))}{a^3 \left (a^2-b^2\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.14, size = 91, normalized size = 1.20 \begin {gather*} \frac {-2 a^3 b x+2 a b \left (a^2-b^2\right ) \coth (x)+\left (-a^4+a^2 b^2\right ) \text {csch}^2(x)+2 a^4 \log (\sinh (x))-2 b^4 \log (\sinh (x))+2 b^4 \log (a \cosh (x)+b \sinh (x))}{2 a^3 (a-b) (a+b)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.64, size = 135, normalized size = 1.78
method | result | size |
risch | \(\frac {x}{a +b}-\frac {2 x}{a}-\frac {2 x \,b^{2}}{a^{3}}-\frac {2 x \,b^{4}}{a^{3} \left (a^{2}-b^{2}\right )}-\frac {2 \left ({\mathrm e}^{2 x} a -b \,{\mathrm e}^{2 x}+b \right )}{\left ({\mathrm e}^{2 x}-1\right )^{2} a^{2}}+\frac {\ln \left ({\mathrm e}^{2 x}-1\right )}{a}+\frac {\ln \left ({\mathrm e}^{2 x}-1\right ) b^{2}}{a^{3}}+\frac {b^{4} \ln \left ({\mathrm e}^{2 x}+\frac {a -b}{a +b}\right )}{a^{3} \left (a^{2}-b^{2}\right )}\) | \(132\) |
default | \(-\frac {\frac {a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )}{2}-2 b \tanh \left (\frac {x}{2}\right )}{4 a^{2}}+\frac {b^{4} \ln \left (a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )+2 b \tanh \left (\frac {x}{2}\right )+a \right )}{a^{3} \left (a +b \right ) \left (a -b \right )}-\frac {\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{a +b}-\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{a -b}-\frac {1}{8 a \tanh \left (\frac {x}{2}\right )^{2}}+\frac {\left (4 a^{2}+4 b^{2}\right ) \ln \left (\tanh \left (\frac {x}{2}\right )\right )}{4 a^{3}}+\frac {b}{2 a^{2} \tanh \left (\frac {x}{2}\right )}\) | \(135\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 121, normalized size = 1.59 \begin {gather*} \frac {b^{4} \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} - a - b\right )}{a^{5} - a^{3} b^{2}} + \frac {2 \, {\left ({\left (a + b\right )} e^{\left (-2 \, x\right )} - b\right )}}{2 \, a^{2} e^{\left (-2 \, x\right )} - a^{2} e^{\left (-4 \, x\right )} - a^{2}} + \frac {x}{a + b} + \frac {{\left (a^{2} + b^{2}\right )} \log \left (e^{\left (-x\right )} + 1\right )}{a^{3}} + \frac {{\left (a^{2} + b^{2}\right )} \log \left (e^{\left (-x\right )} - 1\right )}{a^{3}} \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. 641 vs.
\(2 (74) = 148\).
time = 0.43, size = 641, normalized size = 8.43 \begin {gather*} -\frac {{\left (a^{4} + a^{3} b\right )} x \cosh \left (x\right )^{4} + 4 \, {\left (a^{4} + a^{3} b\right )} x \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (a^{4} + a^{3} b\right )} x \sinh \left (x\right )^{4} + 2 \, a^{3} b - 2 \, a b^{3} + 2 \, {\left (a^{4} - a^{3} b - a^{2} b^{2} + a b^{3} - {\left (a^{4} + a^{3} b\right )} x\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a^{4} - a^{3} b - a^{2} b^{2} + a b^{3} + 3 \, {\left (a^{4} + a^{3} b\right )} x \cosh \left (x\right )^{2} - {\left (a^{4} + a^{3} b\right )} x\right )} \sinh \left (x\right )^{2} + {\left (a^{4} + a^{3} b\right )} x - {\left (b^{4} \cosh \left (x\right )^{4} + 4 \, b^{4} \cosh \left (x\right ) \sinh \left (x\right )^{3} + b^{4} \sinh \left (x\right )^{4} - 2 \, b^{4} \cosh \left (x\right )^{2} + b^{4} + 2 \, {\left (3 \, b^{4} \cosh \left (x\right )^{2} - b^{4}\right )} \sinh \left (x\right )^{2} + 4 \, {\left (b^{4} \cosh \left (x\right )^{3} - b^{4} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \log \left (\frac {2 \, {\left (a \cosh \left (x\right ) + b \sinh \left (x\right )\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) - {\left ({\left (a^{4} - b^{4}\right )} \cosh \left (x\right )^{4} + 4 \, {\left (a^{4} - b^{4}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (a^{4} - b^{4}\right )} \sinh \left (x\right )^{4} + a^{4} - b^{4} - 2 \, {\left (a^{4} - b^{4}\right )} \cosh \left (x\right )^{2} - 2 \, {\left (a^{4} - b^{4} - 3 \, {\left (a^{4} - b^{4}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{2} + 4 \, {\left ({\left (a^{4} - b^{4}\right )} \cosh \left (x\right )^{3} - {\left (a^{4} - b^{4}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \log \left (\frac {2 \, \sinh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) + 4 \, {\left ({\left (a^{4} + a^{3} b\right )} x \cosh \left (x\right )^{3} + {\left (a^{4} - a^{3} b - a^{2} b^{2} + a b^{3} - {\left (a^{4} + a^{3} b\right )} x\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )}{a^{5} - a^{3} b^{2} + {\left (a^{5} - a^{3} b^{2}\right )} \cosh \left (x\right )^{4} + 4 \, {\left (a^{5} - a^{3} b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (a^{5} - a^{3} b^{2}\right )} \sinh \left (x\right )^{4} - 2 \, {\left (a^{5} - a^{3} b^{2}\right )} \cosh \left (x\right )^{2} - 2 \, {\left (a^{5} - a^{3} b^{2} - 3 \, {\left (a^{5} - a^{3} b^{2}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{2} + 4 \, {\left ({\left (a^{5} - a^{3} b^{2}\right )} \cosh \left (x\right )^{3} - {\left (a^{5} - a^{3} b^{2}\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]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\coth ^{3}{\left (x \right )}}{a + b \tanh {\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.41, size = 97, normalized size = 1.28 \begin {gather*} \frac {b^{4} \log \left ({\left | a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} + a - b \right |}\right )}{a^{5} - a^{3} b^{2}} - \frac {x}{a - b} + \frac {{\left (a^{2} + b^{2}\right )} \log \left ({\left | e^{\left (2 \, x\right )} - 1 \right |}\right )}{a^{3}} - \frac {2 \, {\left (a b + {\left (a^{2} - a b\right )} e^{\left (2 \, x\right )}\right )}}{a^{3} {\left (e^{\left (2 \, x\right )} - 1\right )}^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.42, size = 111, normalized size = 1.46 \begin {gather*} \frac {\ln \left ({\mathrm {e}}^{2\,x}-1\right )\,\left (a^2+b^2\right )}{a^3}-\frac {x}{a-b}-\frac {2}{a\,\left ({\mathrm {e}}^{4\,x}-2\,{\mathrm {e}}^{2\,x}+1\right )}+\frac {b^4\,\ln \left (a-b+a\,{\mathrm {e}}^{2\,x}+b\,{\mathrm {e}}^{2\,x}\right )}{a^5-a^3\,b^2}-\frac {2\,\left (a^2-b^2\right )}{a^2\,\left (a+b\right )\,\left ({\mathrm {e}}^{2\,x}-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________