Optimal. Leaf size=76 \[ -\frac {b x}{a^2-b^2}+\frac {b \tanh (x)}{a^2}+\frac {\left (a^2+b^2\right ) \log (\cosh (x))}{a^3}+\frac {b^4 \log (a \sinh (x)+b \cosh (x))}{a^3 \left (a^2-b^2\right )}-\frac {\tanh ^2(x)}{2 a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.33, 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 = {3569, 3649, 3652, 3530, 3475} \[ -\frac {b x}{a^2-b^2}+\frac {\left (a^2+b^2\right ) \log (\cosh (x))}{a^3}+\frac {b^4 \log (a \sinh (x)+b \cosh (x))}{a^3 \left (a^2-b^2\right )}+\frac {b \tanh (x)}{a^2}-\frac {\tanh ^2(x)}{2 a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3530
Rule 3569
Rule 3649
Rule 3652
Rubi steps
\begin {align*} \int \frac {\tanh ^3(x)}{a+b \coth (x)} \, dx &=-\frac {\tanh ^2(x)}{2 a}-\frac {i \int \frac {\left (-2 i b+2 i a \coth (x)+2 i b \coth ^2(x)\right ) \tanh ^2(x)}{a+b \coth (x)} \, dx}{2 a}\\ &=\frac {b \tanh (x)}{a^2}-\frac {\tanh ^2(x)}{2 a}-\frac {\int \frac {\left (-2 \left (a^2+b^2\right )+2 b^2 \coth ^2(x)\right ) \tanh (x)}{a+b \coth (x)} \, dx}{2 a^2}\\ &=-\frac {b x}{a^2-b^2}+\frac {b \tanh (x)}{a^2}-\frac {\tanh ^2(x)}{2 a}+\frac {\left (i b^4\right ) \int \frac {-i b-i a \coth (x)}{a+b \coth (x)} \, dx}{a^3 \left (a^2-b^2\right )}+\frac {\left (a^2+b^2\right ) \int \tanh (x) \, dx}{a^3}\\ &=-\frac {b x}{a^2-b^2}+\frac {\left (a^2+b^2\right ) \log (\cosh (x))}{a^3}+\frac {b^4 \log (b \cosh (x)+a \sinh (x))}{a^3 \left (a^2-b^2\right )}+\frac {b \tanh (x)}{a^2}-\frac {\tanh ^2(x)}{2 a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.33, size = 88, normalized size = 1.16 \[ \frac {a^2 \left (a^2-b^2\right ) \text {sech}^2(x)+2 \left (\left (a^4-b^4\right ) \log (\cosh (x))-a^3 b x+a b \left (a^2-b^2\right ) \tanh (x)+b^4 \log (a \sinh (x)+b \cosh (x))\right )}{2 a^3 (a-b) (a+b)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.43, size = 637, normalized size = 8.38 \[ -\frac {{\left (a^{4} + a^{3} b\right )} x \cosh \relax (x)^{4} + 4 \, {\left (a^{4} + a^{3} b\right )} x \cosh \relax (x) \sinh \relax (x)^{3} + {\left (a^{4} + a^{3} b\right )} x \sinh \relax (x)^{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 \relax (x)^{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 \relax (x)^{2} - {\left (a^{4} + a^{3} b\right )} x\right )} \sinh \relax (x)^{2} + {\left (a^{4} + a^{3} b\right )} x - {\left (b^{4} \cosh \relax (x)^{4} + 4 \, b^{4} \cosh \relax (x) \sinh \relax (x)^{3} + b^{4} \sinh \relax (x)^{4} + 2 \, b^{4} \cosh \relax (x)^{2} + b^{4} + 2 \, {\left (3 \, b^{4} \cosh \relax (x)^{2} + b^{4}\right )} \sinh \relax (x)^{2} + 4 \, {\left (b^{4} \cosh \relax (x)^{3} + b^{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 \, \cosh \relax (x)}{\cosh \relax (x) - \sinh \relax (x)}\right ) + 4 \, {\left ({\left (a^{4} + a^{3} b\right )} x \cosh \relax (x)^{3} - {\left (a^{4} - a^{3} b - a^{2} b^{2} + a b^{3} - {\left (a^{4} + a^{3} b\right )} x\right )} \cosh \relax (x)\right )} \sinh \relax (x)}{a^{5} - a^{3} b^{2} + {\left (a^{5} - a^{3} b^{2}\right )} \cosh \relax (x)^{4} + 4 \, {\left (a^{5} - a^{3} b^{2}\right )} \cosh \relax (x) \sinh \relax (x)^{3} + {\left (a^{5} - a^{3} b^{2}\right )} \sinh \relax (x)^{4} + 2 \, {\left (a^{5} - a^{3} b^{2}\right )} \cosh \relax (x)^{2} + 2 \, {\left (a^{5} - a^{3} b^{2} + 3 \, {\left (a^{5} - a^{3} b^{2}\right )} \cosh \relax (x)^{2}\right )} \sinh \relax (x)^{2} + 4 \, {\left ({\left (a^{5} - a^{3} b^{2}\right )} \cosh \relax (x)^{3} + {\left (a^{5} - a^{3} b^{2}\right )} \cosh \relax (x)\right )} \sinh \relax (x)} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.12, size = 97, normalized size = 1.28 \[ \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 (e^{\left (2 \, x\right )} + 1\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}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.14, size = 167, normalized size = 2.20 \[ \frac {b^{4} \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 ) \left (a -b \right ) a^{3}}-\frac {32 \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{32 a +32 b}-\frac {32 \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{32 a -32 b}+\frac {2 \left (\tanh ^{3}\left (\frac {x}{2}\right )\right ) b}{a^{2} \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{2}}-\frac {2 \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )}{a \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{2}}+\frac {2 b \tanh \left (\frac {x}{2}\right )}{a^{2} \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{2}}+\frac {\ln \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )}{a}+\frac {\ln \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right ) b^{2}}{a^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.41, size = 94, normalized size = 1.24 \[ \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 (-2 \, x\right )} + 1\right )}{a^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.51, size = 111, normalized size = 1.46 \[ \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 (2\,{\mathrm {e}}^{2\,x}+{\mathrm {e}}^{4\,x}+1\right )}+\frac {b^4\,\ln \left (b-a+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 )} \]
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 {\tanh ^{3}{\relax (x )}}{a + b \coth {\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________