Optimal. Leaf size=61 \[ -\frac {a \log (\tanh (x))}{a^2+b^2}-\frac {b \tan ^{-1}(\sinh (x))}{a^2+b^2}+\frac {b^2 \log (a+b \text {csch}(x))}{a \left (a^2+b^2\right )}+\frac {\log (\sinh (x))}{a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.10, antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.454, Rules used = {3885, 894, 635, 203, 260} \[ -\frac {a \log (\tanh (x))}{a^2+b^2}-\frac {b \tan ^{-1}(\sinh (x))}{a^2+b^2}+\frac {b^2 \log (a+b \text {csch}(x))}{a \left (a^2+b^2\right )}+\frac {\log (\sinh (x))}{a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 260
Rule 635
Rule 894
Rule 3885
Rubi steps
\begin {align*} \int \frac {\tanh (x)}{a+b \text {csch}(x)} \, dx &=b^2 \operatorname {Subst}\left (\int \frac {1}{x (a+x) \left (-b^2-x^2\right )} \, dx,x,b \text {csch}(x)\right )\\ &=b^2 \operatorname {Subst}\left (\int \left (-\frac {1}{a b^2 x}+\frac {1}{a \left (a^2+b^2\right ) (a+x)}+\frac {b^2+a x}{b^2 \left (a^2+b^2\right ) \left (b^2+x^2\right )}\right ) \, dx,x,b \text {csch}(x)\right )\\ &=\frac {b^2 \log (a+b \text {csch}(x))}{a \left (a^2+b^2\right )}+\frac {\log (\sinh (x))}{a}+\frac {\operatorname {Subst}\left (\int \frac {b^2+a x}{b^2+x^2} \, dx,x,b \text {csch}(x)\right )}{a^2+b^2}\\ &=\frac {b^2 \log (a+b \text {csch}(x))}{a \left (a^2+b^2\right )}+\frac {\log (\sinh (x))}{a}+\frac {a \operatorname {Subst}\left (\int \frac {x}{b^2+x^2} \, dx,x,b \text {csch}(x)\right )}{a^2+b^2}+\frac {b^2 \operatorname {Subst}\left (\int \frac {1}{b^2+x^2} \, dx,x,b \text {csch}(x)\right )}{a^2+b^2}\\ &=-\frac {b \tan ^{-1}(\sinh (x))}{a^2+b^2}+\frac {b^2 \log (a+b \text {csch}(x))}{a \left (a^2+b^2\right )}+\frac {\log (\sinh (x))}{a}-\frac {a \log (\tanh (x))}{a^2+b^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.06, size = 63, normalized size = 1.03 \[ \frac {2 b^2 \log (a \sinh (x)+b)+a (a+i b) \log (-\sinh (x)+i)+a (a-i b) \log (\sinh (x)+i)}{2 a \left (a^2+b^2\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.26, size = 75, normalized size = 1.23 \[ -\frac {2 \, a b \arctan \left (\cosh \relax (x) + \sinh \relax (x)\right ) - b^{2} \log \left (\frac {2 \, {\left (a \sinh \relax (x) + b\right )}}{\cosh \relax (x) - \sinh \relax (x)}\right ) - a^{2} \log \left (\frac {2 \, \cosh \relax (x)}{\cosh \relax (x) - \sinh \relax (x)}\right ) + {\left (a^{2} + b^{2}\right )} x}{a^{3} + a b^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.13, size = 89, normalized size = 1.46 \[ \frac {b^{2} \log \left ({\left | -a {\left (e^{\left (-x\right )} - e^{x}\right )} + 2 \, b \right |}\right )}{a^{3} + a b^{2}} - \frac {{\left (\pi + 2 \, \arctan \left (\frac {1}{2} \, {\left (e^{\left (2 \, x\right )} - 1\right )} e^{\left (-x\right )}\right )\right )} b}{2 \, {\left (a^{2} + b^{2}\right )}} + \frac {a \log \left ({\left (e^{\left (-x\right )} - e^{x}\right )}^{2} + 4\right )}{2 \, {\left (a^{2} + b^{2}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.18, size = 108, normalized size = 1.77 \[ -\frac {\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{a}-\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{a}+\frac {b^{2} \ln \left (\left (\tanh ^{2}\left (\frac {x}{2}\right )\right ) b -2 a \tanh \left (\frac {x}{2}\right )-b \right )}{a \left (a^{2}+b^{2}\right )}+\frac {4 a \ln \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )}{4 a^{2}+4 b^{2}}-\frac {8 b \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{4 a^{2}+4 b^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.41, size = 74, normalized size = 1.21 \[ \frac {b^{2} \log \left (-2 \, b e^{\left (-x\right )} + a e^{\left (-2 \, x\right )} - a\right )}{a^{3} + a b^{2}} + \frac {2 \, b \arctan \left (e^{\left (-x\right )}\right )}{a^{2} + b^{2}} + \frac {a \log \left (e^{\left (-2 \, x\right )} + 1\right )}{a^{2} + b^{2}} + \frac {x}{a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.53, size = 132, normalized size = 2.16 \[ \frac {\ln \left (1+{\mathrm {e}}^x\,1{}\mathrm {i}\right )}{a-b\,1{}\mathrm {i}}-\frac {x}{a}+\frac {b^2\,\ln \left (a^5\,{\mathrm {e}}^{2\,x}-a\,b^4-a^5+a^3\,b^2+2\,b^5\,{\mathrm {e}}^x-a^3\,b^2\,{\mathrm {e}}^{2\,x}+2\,a^4\,b\,{\mathrm {e}}^x+a\,b^4\,{\mathrm {e}}^{2\,x}-2\,a^2\,b^3\,{\mathrm {e}}^x\right )}{a^3+a\,b^2}+\frac {\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{-b+a\,1{}\mathrm {i}} \]
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 + b \operatorname {csch}{\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________