Optimal. Leaf size=94 \[ \frac {\left (2 a^2-3 b^2\right ) \tan ^{-1}(\sinh (x))}{2 b^3}-\frac {2 (a-b)^{3/2} (a+b)^{3/2} \tan ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a b^3}-\frac {a \tanh (x)}{b^2}+\frac {x}{a}+\frac {\tanh (x) \text {sech}(x)}{2 b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.32, antiderivative size = 94, 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 = {3898, 2893, 3057, 2659, 205, 3770} \[ \frac {\left (2 a^2-3 b^2\right ) \tan ^{-1}(\sinh (x))}{2 b^3}-\frac {a \tanh (x)}{b^2}-\frac {2 (a-b)^{3/2} (a+b)^{3/2} \tan ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a b^3}+\frac {x}{a}+\frac {\tanh (x) \text {sech}(x)}{2 b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 205
Rule 2659
Rule 2893
Rule 3057
Rule 3770
Rule 3898
Rubi steps
\begin {align*} \int \frac {\tanh ^4(x)}{a+b \text {sech}(x)} \, dx &=\int \frac {\sinh (x) \tanh ^3(x)}{b+a \cosh (x)} \, dx\\ &=-\frac {a \tanh (x)}{b^2}+\frac {\text {sech}(x) \tanh (x)}{2 b}-\frac {\int \frac {\left (-2 a^2+3 b^2-a b \cosh (x)-2 b^2 \cosh ^2(x)\right ) \text {sech}(x)}{b+a \cosh (x)} \, dx}{2 b^2}\\ &=\frac {x}{a}-\frac {a \tanh (x)}{b^2}+\frac {\text {sech}(x) \tanh (x)}{2 b}-\frac {\left (a^2-b^2\right )^2 \int \frac {1}{b+a \cosh (x)} \, dx}{a b^3}-\frac {\left (-2 a^2+3 b^2\right ) \int \text {sech}(x) \, dx}{2 b^3}\\ &=\frac {x}{a}+\frac {\left (2 a^2-3 b^2\right ) \tan ^{-1}(\sinh (x))}{2 b^3}-\frac {a \tanh (x)}{b^2}+\frac {\text {sech}(x) \tanh (x)}{2 b}-\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 b^3}\\ &=\frac {x}{a}+\frac {\left (2 a^2-3 b^2\right ) \tan ^{-1}(\sinh (x))}{2 b^3}-\frac {2 (a-b)^{3/2} (a+b)^{3/2} \tan ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a b^3}-\frac {a \tanh (x)}{b^2}+\frac {\text {sech}(x) \tanh (x)}{2 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.42, size = 113, normalized size = 1.20 \[ \frac {\text {sech}^2(x) (a \cosh (x)+b) \left (2 \cosh (x) \left (a \left (2 a^2-3 b^2\right ) \tan ^{-1}\left (\tanh \left (\frac {x}{2}\right )\right )+2 \left (a^2-b^2\right )^{3/2} \tan ^{-1}\left (\frac {(b-a) \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )+b^3 x\right )+a b (b \tanh (x)-2 a \sinh (x))\right )}{2 a b^3 (a+b \text {sech}(x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.51, size = 1254, normalized size = 13.34 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.14, size = 111, normalized size = 1.18 \[ \frac {x}{a} + \frac {{\left (2 \, a^{2} - 3 \, b^{2}\right )} \arctan \left (e^{x}\right )}{b^{3}} - \frac {2 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \arctan \left (\frac {a e^{x} + b}{\sqrt {a^{2} - b^{2}}}\right )}{\sqrt {a^{2} - b^{2}} a b^{3}} + \frac {b e^{\left (3 \, x\right )} + 2 \, a e^{\left (2 \, x\right )} - b e^{x} + 2 \, a}{b^{2} {\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 = 248, normalized size = 2.64 \[ -\frac {\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{a}-\frac {2 a^{3} \arctan \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{b^{3} \sqrt {\left (a +b \right ) \left (a -b \right )}}+\frac {4 a \arctan \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{b \sqrt {\left (a +b \right ) \left (a -b \right )}}-\frac {2 b \arctan \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a \sqrt {\left (a +b \right ) \left (a -b \right )}}+\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{a}-\frac {2 \left (\tanh ^{3}\left (\frac {x}{2}\right )\right ) a}{b^{2} \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{2}}-\frac {\tanh ^{3}\left (\frac {x}{2}\right )}{b \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{2}}-\frac {2 \tanh \left (\frac {x}{2}\right ) a}{b^{2} \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{2}}+\frac {\tanh \left (\frac {x}{2}\right )}{b \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{2}}+\frac {2 \arctan \left (\tanh \left (\frac {x}{2}\right )\right ) a^{2}}{b^{3}}-\frac {3 \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{b} \]
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 = 7.26, size = 700, normalized size = 7.45 \[ \frac {\frac {2\,a}{b^2}+\frac {{\mathrm {e}}^x}{b}}{{\mathrm {e}}^{2\,x}+1}+\frac {x}{a}-\frac {\ln \left ({\mathrm {e}}^x-\mathrm {i}\right )\,\left (a^2\,2{}\mathrm {i}-b^2\,3{}\mathrm {i}\right )}{2\,b^3}+\frac {\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )\,\left (a^2\,2{}\mathrm {i}-b^2\,3{}\mathrm {i}\right )}{2\,b^3}-\frac {2\,{\mathrm {e}}^x}{b\,\left (2\,{\mathrm {e}}^{2\,x}+{\mathrm {e}}^{4\,x}+1\right )}+\frac {\ln \left (\frac {\left (\frac {64\,a^8+96\,{\mathrm {e}}^x\,a^7\,b-288\,a^6\,b^2-416\,{\mathrm {e}}^x\,a^5\,b^3+456\,a^4\,b^4+600\,{\mathrm {e}}^x\,a^3\,b^5-272\,a^2\,b^6-288\,{\mathrm {e}}^x\,a\,b^7+32\,b^8}{a^6\,b^4}-\frac {\left (\frac {16\,\left (a^2-b^2\right )\,\left (-4\,a^3-7\,{\mathrm {e}}^x\,a^2\,b+4\,a\,b^2+8\,{\mathrm {e}}^x\,b^3\right )}{a^6}+\frac {32\,\sqrt {-{\left (a+b\right )}^3\,{\left (a-b\right )}^3}\,\left (-2\,a^3-3\,{\mathrm {e}}^x\,a^2\,b+3\,a\,b^2+4\,{\mathrm {e}}^x\,b^3\right )}{a^6\,b}\right )\,\sqrt {-{\left (a+b\right )}^3\,{\left (a-b\right )}^3}}{a\,b^3}\right )\,\sqrt {-{\left (a+b\right )}^3\,{\left (a-b\right )}^3}}{a\,b^3}-\frac {8\,{\left (a^2-b^2\right )}^2\,\left (2\,a^2-3\,b^2\right )\,\left (-4\,a^3-7\,{\mathrm {e}}^x\,a^2\,b+6\,a\,b^2+10\,{\mathrm {e}}^x\,b^3\right )}{a^6\,b^6}\right )\,\sqrt {-{\left (a+b\right )}^3\,{\left (a-b\right )}^3}}{a\,b^3}-\frac {\ln \left (-\frac {\left (\frac {64\,a^8+96\,{\mathrm {e}}^x\,a^7\,b-288\,a^6\,b^2-416\,{\mathrm {e}}^x\,a^5\,b^3+456\,a^4\,b^4+600\,{\mathrm {e}}^x\,a^3\,b^5-272\,a^2\,b^6-288\,{\mathrm {e}}^x\,a\,b^7+32\,b^8}{a^6\,b^4}+\frac {\left (\frac {16\,\left (a^2-b^2\right )\,\left (-4\,a^3-7\,{\mathrm {e}}^x\,a^2\,b+4\,a\,b^2+8\,{\mathrm {e}}^x\,b^3\right )}{a^6}-\frac {32\,\sqrt {-{\left (a+b\right )}^3\,{\left (a-b\right )}^3}\,\left (-2\,a^3-3\,{\mathrm {e}}^x\,a^2\,b+3\,a\,b^2+4\,{\mathrm {e}}^x\,b^3\right )}{a^6\,b}\right )\,\sqrt {-{\left (a+b\right )}^3\,{\left (a-b\right )}^3}}{a\,b^3}\right )\,\sqrt {-{\left (a+b\right )}^3\,{\left (a-b\right )}^3}}{a\,b^3}-\frac {8\,{\left (a^2-b^2\right )}^2\,\left (2\,a^2-3\,b^2\right )\,\left (-4\,a^3-7\,{\mathrm {e}}^x\,a^2\,b+6\,a\,b^2+10\,{\mathrm {e}}^x\,b^3\right )}{a^6\,b^6}\right )\,\sqrt {-{\left (a+b\right )}^3\,{\left (a-b\right )}^3}}{a\,b^3} \]
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 \operatorname {sech}{\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________