Optimal. Leaf size=39 \[ \frac{a x}{a^2-b^2}-\frac{b \log (a \cosh (x)+b \sinh (x))}{a^2-b^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0460166, antiderivative size = 39, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 8, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {3484, 3530} \[ \frac{a x}{a^2-b^2}-\frac{b \log (a \cosh (x)+b \sinh (x))}{a^2-b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3484
Rule 3530
Rubi steps
\begin{align*} \int \frac{1}{a+b \tanh (x)} \, dx &=\frac{a x}{a^2-b^2}-\frac{(i b) \int \frac{-i b-i a \tanh (x)}{a+b \tanh (x)} \, dx}{a^2-b^2}\\ &=\frac{a x}{a^2-b^2}-\frac{b \log (a \cosh (x)+b \sinh (x))}{a^2-b^2}\\ \end{align*}
Mathematica [A] time = 0.0411584, size = 29, normalized size = 0.74 \[ \frac{a x-b \log (a \cosh (x)+b \sinh (x))}{a^2-b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0., size = 55, normalized size = 1.4 \begin{align*}{\frac{\ln \left ( 1+\tanh \left ( x \right ) \right ) }{2\,a-2\,b}}-{\frac{\ln \left ( \tanh \left ( x \right ) -1 \right ) }{2\,b+2\,a}}-{\frac{b\ln \left ( a+b\tanh \left ( x \right ) \right ) }{ \left ( a+b \right ) \left ( a-b \right ) }} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.1422, size = 55, normalized size = 1.41 \begin{align*} -\frac{b \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} - a - b\right )}{a^{2} - b^{2}} + \frac{x}{a + b} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.17193, size = 108, normalized size = 2.77 \begin{align*} \frac{{\left (a + b\right )} x - b \log \left (\frac{2 \,{\left (a \cosh \left (x\right ) + b \sinh \left (x\right )\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 [A] time = 0.687084, size = 146, normalized size = 3.74 \begin{align*} \begin{cases} \tilde{\infty } \left (x - \log{\left (\tanh{\left (x \right )} + 1 \right )} + \log{\left (\tanh{\left (x \right )} \right )}\right ) & \text{for}\: a = 0 \wedge b = 0 \\\frac{x}{a} & \text{for}\: b = 0 \\- \frac{x \tanh{\left (x \right )}}{2 b \tanh{\left (x \right )} - 2 b} + \frac{x}{2 b \tanh{\left (x \right )} - 2 b} + \frac{1}{2 b \tanh{\left (x \right )} - 2 b} & \text{for}\: a = - b \\\frac{x \tanh{\left (x \right )}}{2 b \tanh{\left (x \right )} + 2 b} + \frac{x}{2 b \tanh{\left (x \right )} + 2 b} - \frac{1}{2 b \tanh{\left (x \right )} + 2 b} & \text{for}\: a = b \\\frac{a x}{a^{2} - b^{2}} - \frac{b x}{a^{2} - b^{2}} - \frac{b \log{\left (\frac{a}{b} + \tanh{\left (x \right )} \right )}}{a^{2} - b^{2}} + \frac{b \log{\left (\tanh{\left (x \right )} + 1 \right )}}{a^{2} - b^{2}} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.16697, size = 58, normalized size = 1.49 \begin{align*} -\frac{b \log \left ({\left | a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} + a - b \right |}\right )}{a^{2} - b^{2}} + \frac{x}{a - b} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]