Optimal. Leaf size=28 \[ -\frac {(b c-a d) \log (c+d \tanh (x))}{d^2}+\frac {b \tanh (x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 28, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {4427, 45}
\begin {gather*} \frac {b \tanh (x)}{d}-\frac {(b c-a d) \log (c+d \tanh (x))}{d^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 4427
Rubi steps
\begin {align*} \int \frac {\text {sech}^2(x) (a+b \tanh (x))}{c+d \tanh (x)} \, dx &=\text {Subst}\left (\int \frac {a+b x}{c+d x} \, dx,x,\tanh (x)\right )\\ &=\text {Subst}\left (\int \left (\frac {b}{d}+\frac {-b c+a d}{d (c+d x)}\right ) \, dx,x,\tanh (x)\right )\\ &=-\frac {(b c-a d) \log (c+d \tanh (x))}{d^2}+\frac {b \tanh (x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.26, size = 54, normalized size = 1.93 \begin {gather*} \frac {\cosh (x) (a+b \tanh (x)) ((b c-a d) (\log (\cosh (x))-\log (c \cosh (x)+d \sinh (x)))+b d \tanh (x))}{d^2 (a \cosh (x)+b \sinh (x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(74\) vs.
\(2(28)=56\).
time = 1.02, size = 75, normalized size = 2.68
method | result | size |
default | \(\frac {\left (a d -b c \right ) \ln \left (c \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )+2 d \tanh \left (\frac {x}{2}\right )+c \right )}{d^{2}}-\frac {2 \left (-\frac {b d \tanh \left (\frac {x}{2}\right )}{\tanh ^{2}\left (\frac {x}{2}\right )+1}+\frac {\left (a d -b c \right ) \ln \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )}{2}\right )}{d^{2}}\) | \(75\) |
risch | \(-\frac {2 b}{d \left (1+{\mathrm e}^{2 x}\right )}-\frac {\ln \left (1+{\mathrm e}^{2 x}\right ) a}{d}+\frac {\ln \left (1+{\mathrm e}^{2 x}\right ) b c}{d^{2}}+\frac {\ln \left ({\mathrm e}^{2 x}+\frac {c -d}{c +d}\right ) a}{d}-\frac {\ln \left ({\mathrm e}^{2 x}+\frac {c -d}{c +d}\right ) b c}{d^{2}}\) | \(88\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 66 vs.
\(2 (28) = 56\).
time = 0.48, size = 66, normalized size = 2.36 \begin {gather*} -b {\left (\frac {c \log \left (-{\left (c - d\right )} e^{\left (-2 \, x\right )} - c - d\right )}{d^{2}} - \frac {c \log \left (e^{\left (-2 \, x\right )} + 1\right )}{d^{2}} - \frac {2}{d e^{\left (-2 \, x\right )} + d}\right )} + \frac {a \log \left (d \tanh \left (x\right ) + c\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 172 vs.
\(2 (28) = 56\).
time = 0.34, size = 172, normalized size = 6.14 \begin {gather*} -\frac {2 \, b d + {\left ({\left (b c - a d\right )} \cosh \left (x\right )^{2} + 2 \, {\left (b c - a d\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (b c - a d\right )} \sinh \left (x\right )^{2} + b c - a d\right )} \log \left (\frac {2 \, {\left (c \cosh \left (x\right ) + d \sinh \left (x\right )\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) - {\left ({\left (b c - a d\right )} \cosh \left (x\right )^{2} + 2 \, {\left (b c - a d\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (b c - a d\right )} \sinh \left (x\right )^{2} + b c - a d\right )} \log \left (\frac {2 \, \cosh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right )}{d^{2} \cosh \left (x\right )^{2} + 2 \, d^{2} \cosh \left (x\right ) \sinh \left (x\right ) + d^{2} \sinh \left (x\right )^{2} + d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (a + b \tanh {\left (x \right )}\right ) \operatorname {sech}^{2}{\left (x \right )}}{c + d \tanh {\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 113 vs.
\(2 (28) = 56\).
time = 0.41, size = 113, normalized size = 4.04 \begin {gather*} -\frac {{\left (b c^{2} - a c d + b c d - a d^{2}\right )} \log \left ({\left | c e^{\left (2 \, x\right )} + d e^{\left (2 \, x\right )} + c - d \right |}\right )}{c d^{2} + d^{3}} + \frac {{\left (b c - a d\right )} \log \left (e^{\left (2 \, x\right )} + 1\right )}{d^{2}} - \frac {b c e^{\left (2 \, x\right )} - a d e^{\left (2 \, x\right )} + b c - a d + 2 \, b d}{d^{2} {\left (e^{\left (2 \, x\right )} + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.15, size = 297, normalized size = 10.61 \begin {gather*} \frac {2\,\mathrm {atan}\left ({\mathrm {e}}^{2\,x}\,\left (\frac {4\,\left (a\,d\,\sqrt {-d^4}-b\,c\,\sqrt {-d^4}\right )}{d^2\,\sqrt {{\left (a\,d-b\,c\right )}^2}\,\left (c+d\right )\,\left (c-d\right )\,\sqrt {-d^4}}-\frac {4\,c^2\,\sqrt {a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2}}{d^4\,\left (c+d\right )\,\left (c-d\right )\,\left (a\,d-b\,c\right )}\right )\,\left (\frac {d^2\,\sqrt {-d^4}}{4}+\frac {c\,d\,\sqrt {-d^4}}{4}\right )+\frac {4\,c\,\left (d^2\,\sqrt {a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2}-c\,d\,\sqrt {a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2}\right )\,\left (\frac {d^2\,\sqrt {-d^4}}{4}+\frac {c\,d\,\sqrt {-d^4}}{4}\right )}{d^5\,\left (c+d\right )\,\left (c-d\right )\,\left (a\,d-b\,c\right )}\right )\,\sqrt {a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2}}{\sqrt {-d^4}}-\frac {2\,b}{d\,\left ({\mathrm {e}}^{2\,x}+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________