Optimal. Leaf size=50 \[ \frac {a x}{a^2-b^2}-\frac {b \log (a \cosh (c+d x)+b \sinh (c+d x))}{\left (a^2-b^2\right ) d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 50, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3565, 3611}
\begin {gather*} \frac {a x}{a^2-b^2}-\frac {b \log (a \cosh (c+d x)+b \sinh (c+d x))}{d \left (a^2-b^2\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3565
Rule 3611
Rubi steps
\begin {align*} \int \frac {1}{a+b \tanh (c+d x)} \, dx &=\frac {a x}{a^2-b^2}-\frac {(i b) \int \frac {-i b-i a \tanh (c+d x)}{a+b \tanh (c+d x)} \, dx}{a^2-b^2}\\ &=\frac {a x}{a^2-b^2}-\frac {b \log (a \cosh (c+d x)+b \sinh (c+d x))}{\left (a^2-b^2\right ) d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.06, size = 64, normalized size = 1.28 \begin {gather*} \frac {(-a+b) \log (1-\tanh (c+d x))+(a+b) \log (1+\tanh (c+d x))-2 b \log (a+b \tanh (c+d x))}{2 (a-b) (a+b) d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.85, size = 71, normalized size = 1.42
method | result | size |
derivativedivides | \(\frac {\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2 a -2 b}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2 b +2 a}-\frac {b \ln \left (a +b \tanh \left (d x +c \right )\right )}{\left (a -b \right ) \left (a +b \right )}}{d}\) | \(71\) |
default | \(\frac {\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2 a -2 b}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2 b +2 a}-\frac {b \ln \left (a +b \tanh \left (d x +c \right )\right )}{\left (a -b \right ) \left (a +b \right )}}{d}\) | \(71\) |
risch | \(\frac {x}{a +b}+\frac {2 b x}{a^{2}-b^{2}}+\frac {2 b c}{d \left (a^{2}-b^{2}\right )}-\frac {b \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {a -b}{a +b}\right )}{d \left (a^{2}-b^{2}\right )}\) | \(81\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 56, normalized size = 1.12 \begin {gather*} -\frac {b \log \left (-{\left (a - b\right )} e^{\left (-2 \, d x - 2 \, c\right )} - a - b\right )}{{\left (a^{2} - b^{2}\right )} d} + \frac {d x + c}{{\left (a + b\right )} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.41, size = 62, normalized size = 1.24 \begin {gather*} \frac {{\left (a + b\right )} d x - b \log \left (\frac {2 \, {\left (a \cosh \left (d x + c\right ) + b \sinh \left (d x + c\right )\right )}}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right )}{{\left (a^{2} - b^{2}\right )} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 224 vs.
\(2 (37) = 74\).
time = 0.72, size = 224, normalized size = 4.48 \begin {gather*} \begin {cases} \frac {\tilde {\infty } x}{\tanh {\left (c \right )}} & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\- \frac {d x \tanh {\left (c + d x \right )}}{2 b d \tanh {\left (c + d x \right )} - 2 b d} + \frac {d x}{2 b d \tanh {\left (c + d x \right )} - 2 b d} + \frac {1}{2 b d \tanh {\left (c + d x \right )} - 2 b d} & \text {for}\: a = - b \\\frac {d x \tanh {\left (c + d x \right )}}{2 b d \tanh {\left (c + d x \right )} + 2 b d} + \frac {d x}{2 b d \tanh {\left (c + d x \right )} + 2 b d} - \frac {1}{2 b d \tanh {\left (c + d x \right )} + 2 b d} & \text {for}\: a = b \\\frac {x}{a + b \tanh {\left (c \right )}} & \text {for}\: d = 0 \\\frac {x}{a} & \text {for}\: b = 0 \\\frac {a d x}{a^{2} d - b^{2} d} - \frac {b d x}{a^{2} d - b^{2} d} - \frac {b \log {\left (\frac {a}{b} + \tanh {\left (c + d x \right )} \right )}}{a^{2} d - b^{2} d} + \frac {b \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{a^{2} d - b^{2} d} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.43, size = 62, normalized size = 1.24 \begin {gather*} -\frac {\frac {b \log \left ({\left | a e^{\left (2 \, d x + 2 \, c\right )} + b e^{\left (2 \, d x + 2 \, c\right )} + a - b \right |}\right )}{a^{2} - b^{2}} - \frac {d x + c}{a - b}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.14, size = 60, normalized size = 1.20 \begin {gather*} \frac {a\,x-b\,x}{a^2-b^2}+\frac {b\,\left (\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )-\ln \left (a+b\,\mathrm {tanh}\left (c+d\,x\right )\right )\right )}{d\,\left (a^2-b^2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________