Optimal. Leaf size=50 \[ \frac {\text {ArcTan}(\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}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, 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 = {3189, 3855,
3153, 210} \begin {gather*} \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 {\text {ArcTan}(\sinh (x))}{a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 3153
Rule 3189
Rule 3855
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) \text {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.09, size = 60, normalized size = 1.20 \begin {gather*} \frac {2 \left (\text {ArcTan}\left (\tanh \left (\frac {x}{2}\right )\right )-\frac {b \text {ArcTan}\left (\frac {a+b \tanh \left (\frac {x}{2}\right )}{\sqrt {-a+b} \sqrt {a+b}}\right )}{\sqrt {-a+b} \sqrt {a+b}}\right )}{a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.70, size = 54, normalized size = 1.08
method | result | size |
default | \(\frac {2 \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{a}-\frac {2 b \arctan \left (\frac {2 b \tanh \left (\frac {x}{2}\right )+2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{a \sqrt {-a^{2}+b^{2}}}\) | \(54\) |
risch | \(\frac {i \ln \left ({\mathrm e}^{x}+i\right )}{a}-\frac {i \ln \left ({\mathrm e}^{x}-i\right )}{a}+\frac {b \ln \left ({\mathrm e}^{x}+\frac {a -b}{\sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, a}-\frac {b \ln \left ({\mathrm e}^{x}-\frac {a -b}{\sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, a}\) | \(102\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.42, size = 200, normalized size = 4.00 \begin {gather*} \left [\frac {\sqrt {a^{2} - b^{2}} b \log \left (\frac {{\left (a + b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a + b\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a + b\right )} \sinh \left (x\right )^{2} + 2 \, \sqrt {a^{2} - b^{2}} {\left (\cosh \left (x\right ) + \sinh \left (x\right )\right )} + a - b}{{\left (a + b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a + b\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a + b\right )} \sinh \left (x\right )^{2} - a + b}\right ) + 2 \, {\left (a^{2} - b^{2}\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\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 \left (x\right ) + {\left (a + b\right )} \sinh \left (x\right )}\right ) - {\left (a^{2} - b^{2}\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right )\right )}}{a^{3} - a b^{2}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\tanh {\left (x \right )}}{a \sinh {\left (x \right )} + b \cosh {\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 48, normalized size = 0.96 \begin {gather*} -\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} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.53, size = 164, normalized size = 3.28 \begin {gather*} \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} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________