Optimal. Leaf size=50 \[ \frac {b \tanh ^{-1}\left (\frac {a \cosh (x)+b \sinh (x)}{\sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2}}+\frac {\tan ^{-1}(\sinh (x))}{a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.10, antiderivative size = 50, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3110, 3770, 3074, 204} \[ \frac {b \tanh ^{-1}\left (\frac {a \cosh (x)+b \sinh (x)}{\sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2}}+\frac {\tan ^{-1}(\sinh (x))}{a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 204
Rule 3074
Rule 3110
Rule 3770
Rubi steps
\begin {align*} \int \frac {\tanh (x)}{b \cosh (x)+a \sinh (x)} \, dx &=-\left (i \int \left (\frac {i \text {sech}(x)}{a}-\frac {i b}{a (b \cosh (x)+a \sinh (x))}\right ) \, dx\right )\\ &=\frac {\int \text {sech}(x) \, dx}{a}-\frac {b \int \frac {1}{b \cosh (x)+a \sinh (x)} \, dx}{a}\\ &=\frac {\tan ^{-1}(\sinh (x))}{a}-\frac {(i b) \operatorname {Subst}\left (\int \frac {1}{-a^2+b^2-x^2} \, dx,x,-i a \cosh (x)-i b \sinh (x)\right )}{a}\\ &=\frac {\tan ^{-1}(\sinh (x))}{a}+\frac {b \tanh ^{-1}\left (\frac {a \cosh (x)+b \sinh (x)}{\sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.13, size = 60, normalized size = 1.20 \[ \frac {2 \left (\tan ^{-1}\left (\tanh \left (\frac {x}{2}\right )\right )-\frac {b \tan ^{-1}\left (\frac {a+b \tanh \left (\frac {x}{2}\right )}{\sqrt {b-a} \sqrt {a+b}}\right )}{\sqrt {b-a} \sqrt {a+b}}\right )}{a} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.47, size = 200, normalized size = 4.00 \[ \left [\frac {\sqrt {a^{2} - b^{2}} b \log \left (\frac {{\left (a + b\right )} \cosh \relax (x)^{2} + 2 \, {\left (a + b\right )} \cosh \relax (x) \sinh \relax (x) + {\left (a + b\right )} \sinh \relax (x)^{2} + 2 \, \sqrt {a^{2} - b^{2}} {\left (\cosh \relax (x) + \sinh \relax (x)\right )} + a - b}{{\left (a + b\right )} \cosh \relax (x)^{2} + 2 \, {\left (a + b\right )} \cosh \relax (x) \sinh \relax (x) + {\left (a + b\right )} \sinh \relax (x)^{2} - a + b}\right ) + 2 \, {\left (a^{2} - b^{2}\right )} \arctan \left (\cosh \relax (x) + \sinh \relax (x)\right )}{a^{3} - a b^{2}}, -\frac {2 \, {\left (\sqrt {-a^{2} + b^{2}} b \arctan \left (\frac {\sqrt {-a^{2} + b^{2}}}{{\left (a + b\right )} \cosh \relax (x) + {\left (a + b\right )} \sinh \relax (x)}\right ) - {\left (a^{2} - b^{2}\right )} \arctan \left (\cosh \relax (x) + \sinh \relax (x)\right )\right )}}{a^{3} - a b^{2}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.12, size = 48, normalized size = 0.96 \[ -\frac {2 \, b \arctan \left (\frac {a e^{x} + b e^{x}}{\sqrt {-a^{2} + b^{2}}}\right )}{\sqrt {-a^{2} + b^{2}} a} + \frac {2 \, \arctan \left (e^{x}\right )}{a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.30, size = 54, normalized size = 1.08 \[ -\frac {2 b \arctan \left (\frac {2 \tanh \left (\frac {x}{2}\right ) b +2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{a \sqrt {-a^{2}+b^{2}}}+\frac {2 \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{a} \]
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 = 3.53, size = 164, normalized size = 3.28 \[ \frac {b\,\ln \left (32\,a\,b^2\,{\mathrm {e}}^x+32\,a^2\,b\,{\mathrm {e}}^x+32\,a\,b\,\sqrt {a^2-b^2}\right )}{a\,\sqrt {a^2-b^2}}-\frac {b\,\ln \left (32\,a\,b^2\,{\mathrm {e}}^x+32\,a^2\,b\,{\mathrm {e}}^x-32\,a\,b\,\sqrt {a^2-b^2}\right )}{a\,\sqrt {a^2-b^2}}+\frac {\ln \left (32\,a\,b\,{\mathrm {e}}^x-32\,a^2\,{\mathrm {e}}^x+a\,b\,32{}\mathrm {i}-a^2\,32{}\mathrm {i}\right )\,1{}\mathrm {i}}{a}-\frac {\ln \left (32\,a^2\,{\mathrm {e}}^x-32\,a\,b\,{\mathrm {e}}^x+a\,b\,32{}\mathrm {i}-a^2\,32{}\mathrm {i}\right )\,1{}\mathrm {i}}{a} \]
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 {\relax (x )}}{a \sinh {\relax (x )} + b \cosh {\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________