Optimal. Leaf size=57 \[ -\frac {b \text {sech}(x)}{a^2}+\frac {\left (a^2-b^2\right ) \log (\cosh (x))}{a^3}-\frac {\left (a^2-b^2\right ) \log (a+b \cosh (x))}{a^3}+\frac {\text {sech}^2(x)}{2 a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.10, antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {2721, 894} \[ \frac {\left (a^2-b^2\right ) \log (\cosh (x))}{a^3}-\frac {\left (a^2-b^2\right ) \log (a+b \cosh (x))}{a^3}-\frac {b \text {sech}(x)}{a^2}+\frac {\text {sech}^2(x)}{2 a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 894
Rule 2721
Rubi steps
\begin {align*} \int \frac {\tanh ^3(x)}{a+b \cosh (x)} \, dx &=-\operatorname {Subst}\left (\int \frac {b^2-x^2}{x^3 (a+x)} \, dx,x,b \cosh (x)\right )\\ &=-\operatorname {Subst}\left (\int \left (\frac {b^2}{a x^3}-\frac {b^2}{a^2 x^2}+\frac {-a^2+b^2}{a^3 x}+\frac {a^2-b^2}{a^3 (a+x)}\right ) \, dx,x,b \cosh (x)\right )\\ &=\frac {\left (a^2-b^2\right ) \log (\cosh (x))}{a^3}-\frac {\left (a^2-b^2\right ) \log (a+b \cosh (x))}{a^3}-\frac {b \text {sech}(x)}{a^2}+\frac {\text {sech}^2(x)}{2 a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.10, size = 46, normalized size = 0.81 \[ \frac {2 \left (a^2-b^2\right ) (\log (\cosh (x))-\log (a+b \cosh (x)))+a^2 \text {sech}^2(x)-2 a b \text {sech}(x)}{2 a^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.71, size = 450, normalized size = 7.89 \[ -\frac {2 \, a b \cosh \relax (x)^{3} + 2 \, a b \sinh \relax (x)^{3} - 2 \, a^{2} \cosh \relax (x)^{2} + 2 \, a b \cosh \relax (x) + 2 \, {\left (3 \, a b \cosh \relax (x) - a^{2}\right )} \sinh \relax (x)^{2} + {\left ({\left (a^{2} - b^{2}\right )} \cosh \relax (x)^{4} + 4 \, {\left (a^{2} - b^{2}\right )} \cosh \relax (x) \sinh \relax (x)^{3} + {\left (a^{2} - b^{2}\right )} \sinh \relax (x)^{4} + 2 \, {\left (a^{2} - b^{2}\right )} \cosh \relax (x)^{2} + 2 \, {\left (3 \, {\left (a^{2} - b^{2}\right )} \cosh \relax (x)^{2} + a^{2} - b^{2}\right )} \sinh \relax (x)^{2} + a^{2} - b^{2} + 4 \, {\left ({\left (a^{2} - b^{2}\right )} \cosh \relax (x)^{3} + {\left (a^{2} - b^{2}\right )} \cosh \relax (x)\right )} \sinh \relax (x)\right )} \log \left (\frac {2 \, {\left (b \cosh \relax (x) + a\right )}}{\cosh \relax (x) - \sinh \relax (x)}\right ) - {\left ({\left (a^{2} - b^{2}\right )} \cosh \relax (x)^{4} + 4 \, {\left (a^{2} - b^{2}\right )} \cosh \relax (x) \sinh \relax (x)^{3} + {\left (a^{2} - b^{2}\right )} \sinh \relax (x)^{4} + 2 \, {\left (a^{2} - b^{2}\right )} \cosh \relax (x)^{2} + 2 \, {\left (3 \, {\left (a^{2} - b^{2}\right )} \cosh \relax (x)^{2} + a^{2} - b^{2}\right )} \sinh \relax (x)^{2} + a^{2} - b^{2} + 4 \, {\left ({\left (a^{2} - b^{2}\right )} \cosh \relax (x)^{3} + {\left (a^{2} - b^{2}\right )} \cosh \relax (x)\right )} \sinh \relax (x)\right )} \log \left (\frac {2 \, \cosh \relax (x)}{\cosh \relax (x) - \sinh \relax (x)}\right ) + 2 \, {\left (3 \, a b \cosh \relax (x)^{2} - 2 \, a^{2} \cosh \relax (x) + a b\right )} \sinh \relax (x)}{a^{3} \cosh \relax (x)^{4} + 4 \, a^{3} \cosh \relax (x) \sinh \relax (x)^{3} + a^{3} \sinh \relax (x)^{4} + 2 \, a^{3} \cosh \relax (x)^{2} + a^{3} + 2 \, {\left (3 \, a^{3} \cosh \relax (x)^{2} + a^{3}\right )} \sinh \relax (x)^{2} + 4 \, {\left (a^{3} \cosh \relax (x)^{3} + a^{3} \cosh \relax (x)\right )} \sinh \relax (x)} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.13, size = 115, normalized size = 2.02 \[ \frac {{\left (a^{2} - b^{2}\right )} \log \left (e^{\left (-x\right )} + e^{x}\right )}{a^{3}} - \frac {{\left (a^{2} b - b^{3}\right )} \log \left ({\left | b {\left (e^{\left (-x\right )} + e^{x}\right )} + 2 \, a \right |}\right )}{a^{3} b} - \frac {3 \, a^{2} {\left (e^{\left (-x\right )} + e^{x}\right )}^{2} - 3 \, b^{2} {\left (e^{\left (-x\right )} + e^{x}\right )}^{2} + 4 \, a b {\left (e^{\left (-x\right )} + e^{x}\right )} - 4 \, a^{2}}{2 \, a^{3} {\left (e^{\left (-x\right )} + e^{x}\right )}^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.10, size = 140, normalized size = 2.46 \[ -\frac {\ln \left (a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-\left (\tanh ^{2}\left (\frac {x}{2}\right )\right ) b -a -b \right )}{a}+\frac {\ln \left (a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-\left (\tanh ^{2}\left (\frac {x}{2}\right )\right ) b -a -b \right ) b^{2}}{a^{3}}+\frac {2}{a \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{2}}-\frac {2}{a \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )}-\frac {2 b}{a^{2} \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )}+\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.44, size = 96, normalized size = 1.68 \[ -\frac {2 \, {\left (b e^{\left (-x\right )} - a e^{\left (-2 \, x\right )} + b e^{\left (-3 \, x\right )}\right )}}{2 \, a^{2} e^{\left (-2 \, x\right )} + a^{2} e^{\left (-4 \, x\right )} + a^{2}} - \frac {{\left (a^{2} - b^{2}\right )} \log \left (2 \, a e^{\left (-x\right )} + b e^{\left (-2 \, x\right )} + b\right )}{a^{3}} + \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.61, size = 1221, normalized size = 21.42 \[ \frac {\frac {2}{a}-\frac {2\,b\,{\mathrm {e}}^x}{a^2}}{{\mathrm {e}}^{2\,x}+1}-\frac {2}{a\,\left (2\,{\mathrm {e}}^{2\,x}+{\mathrm {e}}^{4\,x}+1\right )}+\frac {\left (2\,\mathrm {atan}\left (\left (4\,a^4\,b^3\,{\left (a^2-b^2\right )}^2\,\sqrt {-a^6}-4\,a^6\,b\,{\left (a^2-b^2\right )}^2\,\sqrt {-a^6}\right )\,\left ({\mathrm {e}}^x\,\left (\frac {1}{16\,a^4\,b^2\,{\left (a^2-b^2\right )}^3\,\sqrt {{\left (a^2-b^2\right )}^2}}-\frac {{\left (a^2-2\,b^2\right )}^2}{16\,a^8\,b^2\,{\left (a^2-b^2\right )}^3\,\sqrt {{\left (a^2-b^2\right )}^2}}\right )+\frac {1}{8\,a^5\,b\,{\left (a^2-b^2\right )}^3\,\sqrt {{\left (a^2-b^2\right )}^2}}+\frac {a^2-2\,b^2}{8\,a^7\,b\,{\left (a^2-b^2\right )}^3\,\sqrt {{\left (a^2-b^2\right )}^2}}\right )\right )+2\,\mathrm {atan}\left (\frac {a^2\,\sqrt {-a^6}\,\sqrt {a^4-2\,a^2\,b^2+b^4}-2\,b^2\,\sqrt {-a^6}\,\sqrt {a^4-2\,a^2\,b^2+b^4}}{2\,a^3\,{\left (a^2-b^2\right )}^2}+\frac {\left (a^7-a^5\,b^2\right )\,\sqrt {-a^6}}{2\,a^6\,\left (a^2-b^2\right )\,\sqrt {{\left (a^2-b^2\right )}^2}}+\frac {a^6\,b^2\,{\mathrm {e}}^{3\,x}\,\left (\frac {2\,\left (a^7-a^5\,b^2\right )\,\sqrt {a^4-2\,a^2\,b^2+b^4}}{a^{11}\,b^3\,\left (a^2-b^2\right )\,\sqrt {{\left (a^2-b^2\right )}^2}}-\frac {2\,\left (a^2-2\,b^2\right )\,\left (a^2\,\sqrt {-a^6}\,\sqrt {a^4-2\,a^2\,b^2+b^4}-2\,b^2\,\sqrt {-a^6}\,\sqrt {a^4-2\,a^2\,b^2+b^4}\right )\,\sqrt {a^4-2\,a^2\,b^2+b^4}}{a^{10}\,b^3\,{\left (a^2-b^2\right )}^2\,\sqrt {-a^6}}\right )\,\sqrt {-a^6}}{8\,\sqrt {a^4-2\,a^2\,b^2+b^4}}-\frac {a^6\,b^2\,{\mathrm {e}}^x\,\sqrt {-a^6}\,\left (\frac {8\,\left (a^4-2\,a^2\,b^2+b^4\right )}{a^8\,b\,{\left (a^2-b^2\right )}^2}-\frac {4\,\left (2\,a^6\,b-2\,a^4\,b^3\right )\,\sqrt {a^4-2\,a^2\,b^2+b^4}}{a^{12}\,b^2\,\left (a^2-b^2\right )\,\sqrt {{\left (a^2-b^2\right )}^2}}-\frac {2\,\left (a^7-a^5\,b^2\right )\,\sqrt {a^4-2\,a^2\,b^2+b^4}}{a^{11}\,b^3\,\left (a^2-b^2\right )\,\sqrt {{\left (a^2-b^2\right )}^2}}+\frac {2\,\left (a^2-2\,b^2\right )\,\left (a^2\,\sqrt {-a^6}\,\sqrt {a^4-2\,a^2\,b^2+b^4}-2\,b^2\,\sqrt {-a^6}\,\sqrt {a^4-2\,a^2\,b^2+b^4}\right )\,\sqrt {a^4-2\,a^2\,b^2+b^4}}{a^{10}\,b^3\,{\left (a^2-b^2\right )}^2\,\sqrt {-a^6}}\right )}{8\,\sqrt {a^4-2\,a^2\,b^2+b^4}}+\frac {a^6\,b^2\,{\mathrm {e}}^{2\,x}\,\sqrt {-a^6}\,\left (\frac {4\,\left (a^2-2\,b^2\right )\,\left (a^4-2\,a^2\,b^2+b^4\right )}{a^9\,b^2\,{\left (a^2-b^2\right )}^2}+\frac {4\,\left (a^2\,\sqrt {-a^6}\,\sqrt {a^4-2\,a^2\,b^2+b^4}-2\,b^2\,\sqrt {-a^6}\,\sqrt {a^4-2\,a^2\,b^2+b^4}\right )\,\sqrt {a^4-2\,a^2\,b^2+b^4}}{a^9\,b^2\,{\left (a^2-b^2\right )}^2\,\sqrt {-a^6}}+\frac {2\,\left (2\,a^6\,b-2\,a^4\,b^3\right )\,\sqrt {a^4-2\,a^2\,b^2+b^4}}{a^{11}\,b^3\,\left (a^2-b^2\right )\,\sqrt {{\left (a^2-b^2\right )}^2}}+\frac {4\,\left (a^7-a^5\,b^2\right )\,\sqrt {a^4-2\,a^2\,b^2+b^4}}{a^{12}\,b^2\,\left (a^2-b^2\right )\,\sqrt {{\left (a^2-b^2\right )}^2}}\right )}{8\,\sqrt {a^4-2\,a^2\,b^2+b^4}}\right )\right )\,\sqrt {a^4-2\,a^2\,b^2+b^4}}{\sqrt {-a^6}} \]
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 \cosh {\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________