Optimal. Leaf size=113 \[ \frac {2 (a-b)^{3/2} (a+b)^{3/2} \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a^4}-\frac {b \tanh (x) \text {sech}(x)}{2 a^2}+\frac {b \left (3 a^2-2 b^2\right ) \tan ^{-1}(\sinh (x))}{2 a^4}-\frac {\left (4 a^2-3 b^2\right ) \tanh (x)}{3 a^3}+\frac {\tanh (x) \text {sech}^2(x)}{3 a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.41, antiderivative size = 113, 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 = {2725, 3055, 3001, 3770, 2659, 208} \[ -\frac {\left (4 a^2-3 b^2\right ) \tanh (x)}{3 a^3}+\frac {b \left (3 a^2-2 b^2\right ) \tan ^{-1}(\sinh (x))}{2 a^4}+\frac {2 (a-b)^{3/2} (a+b)^{3/2} \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a^4}-\frac {b \tanh (x) \text {sech}(x)}{2 a^2}+\frac {\tanh (x) \text {sech}^2(x)}{3 a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 208
Rule 2659
Rule 2725
Rule 3001
Rule 3055
Rule 3770
Rubi steps
\begin {align*} \int \frac {\tanh ^4(x)}{a+b \cosh (x)} \, dx &=-\frac {b \text {sech}(x) \tanh (x)}{2 a^2}+\frac {\text {sech}^2(x) \tanh (x)}{3 a}-\frac {\int \frac {\left (2 \left (4 a^2-3 b^2\right )-a b \cosh (x)-3 \left (2 a^2-b^2\right ) \cosh ^2(x)\right ) \text {sech}^2(x)}{a+b \cosh (x)} \, dx}{6 a^2}\\ &=-\frac {\left (4 a^2-3 b^2\right ) \tanh (x)}{3 a^3}-\frac {b \text {sech}(x) \tanh (x)}{2 a^2}+\frac {\text {sech}^2(x) \tanh (x)}{3 a}-\frac {\int \frac {\left (-3 b \left (3 a^2-2 b^2\right )-3 a \left (2 a^2-b^2\right ) \cosh (x)\right ) \text {sech}(x)}{a+b \cosh (x)} \, dx}{6 a^3}\\ &=-\frac {\left (4 a^2-3 b^2\right ) \tanh (x)}{3 a^3}-\frac {b \text {sech}(x) \tanh (x)}{2 a^2}+\frac {\text {sech}^2(x) \tanh (x)}{3 a}+\frac {\left (b \left (3 a^2-2 b^2\right )\right ) \int \text {sech}(x) \, dx}{2 a^4}+\frac {\left (a^2-b^2\right )^2 \int \frac {1}{a+b \cosh (x)} \, dx}{a^4}\\ &=\frac {b \left (3 a^2-2 b^2\right ) \tan ^{-1}(\sinh (x))}{2 a^4}-\frac {\left (4 a^2-3 b^2\right ) \tanh (x)}{3 a^3}-\frac {b \text {sech}(x) \tanh (x)}{2 a^2}+\frac {\text {sech}^2(x) \tanh (x)}{3 a}+\frac {\left (2 \left (a^2-b^2\right )^2\right ) \operatorname {Subst}\left (\int \frac {1}{a+b-(a-b) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{a^4}\\ &=\frac {b \left (3 a^2-2 b^2\right ) \tan ^{-1}(\sinh (x))}{2 a^4}+\frac {2 (a-b)^{3/2} (a+b)^{3/2} \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a^4}-\frac {\left (4 a^2-3 b^2\right ) \tanh (x)}{3 a^3}-\frac {b \text {sech}(x) \tanh (x)}{2 a^2}+\frac {\text {sech}^2(x) \tanh (x)}{3 a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.44, size = 100, normalized size = 0.88 \[ \frac {-12 \left (b^2-a^2\right )^{3/2} \tan ^{-1}\left (\frac {(a-b) \tanh \left (\frac {x}{2}\right )}{\sqrt {b^2-a^2}}\right )+6 b \left (3 a^2-2 b^2\right ) \tan ^{-1}\left (\tanh \left (\frac {x}{2}\right )\right )+a \tanh (x) \left (2 a^2 \text {sech}^2(x)-8 a^2-3 a b \text {sech}(x)+6 b^2\right )}{6 a^4} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 1.57, size = 2003, normalized size = 17.73 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.15, size = 144, normalized size = 1.27 \[ \frac {{\left (3 \, a^{2} b - 2 \, b^{3}\right )} \arctan \left (e^{x}\right )}{a^{4}} + \frac {2 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \arctan \left (\frac {b e^{x} + a}{\sqrt {-a^{2} + b^{2}}}\right )}{\sqrt {-a^{2} + b^{2}} a^{4}} - \frac {3 \, a b e^{\left (5 \, x\right )} - 12 \, a^{2} e^{\left (4 \, x\right )} + 6 \, b^{2} e^{\left (4 \, x\right )} - 12 \, a^{2} e^{\left (2 \, x\right )} + 12 \, b^{2} e^{\left (2 \, x\right )} - 3 \, a b e^{x} - 8 \, a^{2} + 6 \, b^{2}}{3 \, a^{3} {\left (e^{\left (2 \, x\right )} + 1\right )}^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.10, size = 315, normalized size = 2.79 \[ \frac {2 \arctanh \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}-\frac {4 \arctanh \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right ) b^{2}}{a^{2} \sqrt {\left (a +b \right ) \left (a -b \right )}}+\frac {2 b^{4} \arctanh \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a^{4} \sqrt {\left (a +b \right ) \left (a -b \right )}}-\frac {2 \left (\tanh ^{5}\left (\frac {x}{2}\right )\right )}{a \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{3}}+\frac {\left (\tanh ^{5}\left (\frac {x}{2}\right )\right ) b}{a^{2} \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{3}}+\frac {2 \left (\tanh ^{5}\left (\frac {x}{2}\right )\right ) b^{2}}{a^{3} \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{3}}-\frac {20 \left (\tanh ^{3}\left (\frac {x}{2}\right )\right )}{3 a \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{3}}+\frac {4 \left (\tanh ^{3}\left (\frac {x}{2}\right )\right ) b^{2}}{a^{3} \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{3}}-\frac {2 \tanh \left (\frac {x}{2}\right )}{a \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{3}}+\frac {2 \tanh \left (\frac {x}{2}\right ) b^{2}}{a^{3} \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{3}}-\frac {\tanh \left (\frac {x}{2}\right ) b}{a^{2} \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{3}}+\frac {3 \arctan \left (\tanh \left (\frac {x}{2}\right )\right ) b}{a^{2}}-\frac {2 \arctan \left (\tanh \left (\frac {x}{2}\right )\right ) b^{3}}{a^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.94, size = 722, normalized size = 6.39 \[ \frac {8}{3\,a\,\left (3\,{\mathrm {e}}^{2\,x}+3\,{\mathrm {e}}^{4\,x}+{\mathrm {e}}^{6\,x}+1\right )}-\frac {\frac {4}{a}-\frac {2\,b\,{\mathrm {e}}^x}{a^2}}{2\,{\mathrm {e}}^{2\,x}+{\mathrm {e}}^{4\,x}+1}+\frac {\frac {2\,\left (2\,a^2-b^2\right )}{a^3}-\frac {b\,{\mathrm {e}}^x}{a^2}}{{\mathrm {e}}^{2\,x}+1}+\frac {\ln \left (\frac {\left (\frac {32\,a^8-288\,{\mathrm {e}}^x\,a^7\,b-272\,a^6\,b^2+600\,{\mathrm {e}}^x\,a^5\,b^3+456\,a^4\,b^4-416\,{\mathrm {e}}^x\,a^3\,b^5-288\,a^2\,b^6+96\,{\mathrm {e}}^x\,a\,b^7+64\,b^8}{a^6\,b^4}-\frac {\left (\frac {32\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}\,\left (4\,{\mathrm {e}}^x\,a^3+3\,a^2\,b-3\,{\mathrm {e}}^x\,a\,b^2-2\,b^3\right )}{a^2\,b^5}+\frac {16\,\left (a^2-b^2\right )\,\left (8\,{\mathrm {e}}^x\,a^3+4\,a^2\,b-7\,{\mathrm {e}}^x\,a\,b^2-4\,b^3\right )}{a\,b^5}\right )\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}}{a^4}\right )\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}}{a^4}-\frac {8\,{\left (a^2-b^2\right )}^2\,\left (3\,a^2-2\,b^2\right )\,\left (10\,{\mathrm {e}}^x\,a^3+6\,a^2\,b-7\,{\mathrm {e}}^x\,a\,b^2-4\,b^3\right )}{a^9\,b^3}\right )\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}}{a^4}-\frac {\ln \left (-\frac {\left (\frac {32\,a^8-288\,{\mathrm {e}}^x\,a^7\,b-272\,a^6\,b^2+600\,{\mathrm {e}}^x\,a^5\,b^3+456\,a^4\,b^4-416\,{\mathrm {e}}^x\,a^3\,b^5-288\,a^2\,b^6+96\,{\mathrm {e}}^x\,a\,b^7+64\,b^8}{a^6\,b^4}-\frac {\left (\frac {32\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}\,\left (4\,{\mathrm {e}}^x\,a^3+3\,a^2\,b-3\,{\mathrm {e}}^x\,a\,b^2-2\,b^3\right )}{a^2\,b^5}-\frac {16\,\left (a^2-b^2\right )\,\left (8\,{\mathrm {e}}^x\,a^3+4\,a^2\,b-7\,{\mathrm {e}}^x\,a\,b^2-4\,b^3\right )}{a\,b^5}\right )\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}}{a^4}\right )\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}}{a^4}-\frac {8\,{\left (a^2-b^2\right )}^2\,\left (3\,a^2-2\,b^2\right )\,\left (10\,{\mathrm {e}}^x\,a^3+6\,a^2\,b-7\,{\mathrm {e}}^x\,a\,b^2-4\,b^3\right )}{a^9\,b^3}\right )\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}}{a^4}-\frac {b\,\ln \left ({\mathrm {e}}^x-\mathrm {i}\right )\,\left (3\,a^2-2\,b^2\right )\,1{}\mathrm {i}}{2\,a^4}+\frac {b\,\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )\,\left (3\,a^2-2\,b^2\right )\,1{}\mathrm {i}}{2\,a^4} \]
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 ^{4}{\relax (x )}}{a + b \cosh {\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________