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.0994827, antiderivative size = 61, normalized size of antiderivative = 1., 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 3885
Rule 894
Rule 635
Rule 203
Rule 260
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.0587164, 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]
________________________________________________________________________________________
Maple [A] time = 0.036, size = 108, normalized size = 1.8 \begin{align*} -{\frac{1}{a}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }+{\frac{{b}^{2}}{a \left ({a}^{2}+{b}^{2} \right ) }\ln \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}b-2\,a\tanh \left ( x/2 \right ) -b \right ) }-{\frac{1}{a}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) }+4\,{\frac{a\ln \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) }{4\,{a}^{2}+4\,{b}^{2}}}-8\,{\frac{b\arctan \left ( \tanh \left ( x/2 \right ) \right ) }{4\,{a}^{2}+4\,{b}^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.51938, size = 100, normalized size = 1.64 \begin{align*} \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} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.54987, size = 211, normalized size = 3.46 \begin{align*} -\frac{2 \, a b \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) - b^{2} \log \left (\frac{2 \,{\left (a \sinh \left (x\right ) + b\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) - a^{2} \log \left (\frac{2 \, \cosh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) +{\left (a^{2} + b^{2}\right )} x}{a^{3} + a b^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\tanh{\left (x \right )}}{a + b \operatorname{csch}{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.22835, size = 120, normalized size = 1.97 \begin{align*} \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 )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]