Optimal. Leaf size=51 \[ -\frac {b x}{a^2-b^2}+\frac {\log (\cosh (x))}{a}+\frac {b^2 \log (b \cosh (x)+a \sinh (x))}{a \left (a^2-b^2\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {3652, 3611,
3556} \begin {gather*} -\frac {b x}{a^2-b^2}+\frac {b^2 \log (a \sinh (x)+b \cosh (x))}{a \left (a^2-b^2\right )}+\frac {\log (\cosh (x))}{a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3611
Rule 3652
Rubi steps
\begin {align*} \int \frac {\tanh (x)}{a+b \coth (x)} \, dx &=-\frac {b x}{a^2-b^2}+\frac {\int \tanh (x) \, dx}{a}+\frac {\left (i b^2\right ) \int \frac {-i b-i a \coth (x)}{a+b \coth (x)} \, dx}{a \left (a^2-b^2\right )}\\ &=-\frac {b x}{a^2-b^2}+\frac {\log (\cosh (x))}{a}+\frac {b^2 \log (b \cosh (x)+a \sinh (x))}{a \left (a^2-b^2\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.07, size = 46, normalized size = 0.90 \begin {gather*} \frac {\left (a^2-b^2\right ) \log (\cosh (x))+b (-a x+b \log (b \cosh (x)+a \sinh (x)))}{a^3-a b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.64, size = 88, normalized size = 1.73
method | result | size |
risch | \(\frac {x}{a +b}-\frac {2 x}{a}-\frac {2 x \,b^{2}}{a \left (a^{2}-b^{2}\right )}+\frac {\ln \left (1+{\mathrm e}^{2 x}\right )}{a}+\frac {b^{2} \ln \left ({\mathrm e}^{2 x}-\frac {a -b}{a +b}\right )}{a \left (a^{2}-b^{2}\right )}\) | \(82\) |
default | \(-\frac {8 \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{8 a -8 b}+\frac {\ln \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )}{a}+\frac {b^{2} \ln \left (b \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )+2 a \tanh \left (\frac {x}{2}\right )+b \right )}{\left (a +b \right ) \left (a -b \right ) a}-\frac {8 \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{8 a +8 b}\) | \(88\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.47, size = 50, normalized size = 0.98 \begin {gather*} \frac {b^{2} \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} + a + b\right )}{a^{3} - a b^{2}} + \frac {x}{a + b} + \frac {\log \left (e^{\left (-2 \, x\right )} + 1\right )}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 73, normalized size = 1.43 \begin {gather*} \frac {b^{2} \log \left (\frac {2 \, {\left (b \cosh \left (x\right ) + a \sinh \left (x\right )\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) - {\left (a^{2} + a b\right )} x + {\left (a^{2} - b^{2}\right )} \log \left (\frac {2 \, \cosh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right )}{a^{3} - a b^{2}} \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 + b \coth {\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.41, size = 57, normalized size = 1.12 \begin {gather*} \frac {b^{2} \log \left ({\left | a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} - a + b \right |}\right )}{a^{3} - a b^{2}} - \frac {x}{a - b} + \frac {\log \left (e^{\left (2 \, x\right )} + 1\right )}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.32, size = 58, normalized size = 1.14 \begin {gather*} \frac {\ln \left ({\mathrm {e}}^{2\,x}+1\right )}{a}-\frac {x}{a-b}-\frac {b^2\,\ln \left (b-a+a\,{\mathrm {e}}^{2\,x}+b\,{\mathrm {e}}^{2\,x}\right )}{a\,b^2-a^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________