Optimal. Leaf size=48 \[ -\frac{a \log (a+b \sinh (x))}{a^2+b^2}+\frac{b \tan ^{-1}(\sinh (x))}{a^2+b^2}+\frac{a \log (\cosh (x))}{a^2+b^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0688227, antiderivative size = 48, 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 = {2721, 801, 635, 203, 260} \[ -\frac{a \log (a+b \sinh (x))}{a^2+b^2}+\frac{b \tan ^{-1}(\sinh (x))}{a^2+b^2}+\frac{a \log (\cosh (x))}{a^2+b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2721
Rule 801
Rule 635
Rule 203
Rule 260
Rubi steps
\begin{align*} \int \frac{\tanh (x)}{a+b \sinh (x)} \, dx &=-\operatorname{Subst}\left (\int \frac{x}{(a+x) \left (-b^2-x^2\right )} \, dx,x,b \sinh (x)\right )\\ &=-\operatorname{Subst}\left (\int \left (\frac{a}{\left (a^2+b^2\right ) (a+x)}+\frac{-b^2-a x}{\left (a^2+b^2\right ) \left (b^2+x^2\right )}\right ) \, dx,x,b \sinh (x)\right )\\ &=-\frac{a \log (a+b \sinh (x))}{a^2+b^2}-\frac{\operatorname{Subst}\left (\int \frac{-b^2-a x}{b^2+x^2} \, dx,x,b \sinh (x)\right )}{a^2+b^2}\\ &=-\frac{a \log (a+b \sinh (x))}{a^2+b^2}+\frac{a \operatorname{Subst}\left (\int \frac{x}{b^2+x^2} \, dx,x,b \sinh (x)\right )}{a^2+b^2}+\frac{b^2 \operatorname{Subst}\left (\int \frac{1}{b^2+x^2} \, dx,x,b \sinh (x)\right )}{a^2+b^2}\\ &=\frac{b \tan ^{-1}(\sinh (x))}{a^2+b^2}+\frac{a \log (\cosh (x))}{a^2+b^2}-\frac{a \log (a+b \sinh (x))}{a^2+b^2}\\ \end{align*}
Mathematica [A] time = 0.0579387, size = 36, normalized size = 0.75 \[ \frac{-a \log (a+b \sinh (x))+a \log (\cosh (x))+2 b \tan ^{-1}\left (\tanh \left (\frac{x}{2}\right )\right )}{a^2+b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.024, size = 84, normalized size = 1.8 \begin{align*} 2\,{\frac{a\ln \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) }{2\,{a}^{2}+2\,{b}^{2}}}+4\,{\frac{b\arctan \left ( \tanh \left ( x/2 \right ) \right ) }{2\,{a}^{2}+2\,{b}^{2}}}-2\,{\frac{a\ln \left ( a \left ( \tanh \left ( x/2 \right ) \right ) ^{2}-2\,\tanh \left ( x/2 \right ) b-a \right ) }{2\,{a}^{2}+2\,{b}^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.53292, size = 89, normalized size = 1.85 \begin{align*} -\frac{2 \, b \arctan \left (e^{\left (-x\right )}\right )}{a^{2} + b^{2}} - \frac{a \log \left (-2 \, a e^{\left (-x\right )} + b e^{\left (-2 \, x\right )} - b\right )}{a^{2} + b^{2}} + \frac{a \log \left (e^{\left (-2 \, x\right )} + 1\right )}{a^{2} + b^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.12042, size = 177, normalized size = 3.69 \begin{align*} \frac{2 \, b \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) - a \log \left (\frac{2 \,{\left (b \sinh \left (x\right ) + a\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) + a \log \left (\frac{2 \, \cosh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right )}{a^{2} + 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 \sinh{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.13206, size = 120, normalized size = 2.5 \begin{align*} -\frac{a b \log \left ({\left | -b{\left (e^{\left (-x\right )} - e^{x}\right )} + 2 \, a \right |}\right )}{a^{2} b + b^{3}} + \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]