Optimal. Leaf size=53 \[ -\frac{b \tanh (x) (b c-a d)}{d^2}+\frac{(b c-a d)^2 \log (c+d \tanh (x))}{d^3}+\frac{(a+b \tanh (x))^2}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.157541, antiderivative size = 53, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.095, Rules used = {4342, 43} \[ -\frac{b \tanh (x) (b c-a d)}{d^2}+\frac{(b c-a d)^2 \log (c+d \tanh (x))}{d^3}+\frac{(a+b \tanh (x))^2}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4342
Rule 43
Rubi steps
\begin{align*} \int \frac{\text{sech}^2(x) (a+b \tanh (x))^2}{c+d \tanh (x)} \, dx &=\operatorname{Subst}\left (\int \frac{(a+b x)^2}{c+d x} \, dx,x,\tanh (x)\right )\\ &=\operatorname{Subst}\left (\int \left (-\frac{b (b c-a d)}{d^2}+\frac{b (a+b x)}{d}+\frac{(-b c+a d)^2}{d^2 (c+d x)}\right ) \, dx,x,\tanh (x)\right )\\ &=\frac{(b c-a d)^2 \log (c+d \tanh (x))}{d^3}-\frac{b (b c-a d) \tanh (x)}{d^2}+\frac{(a+b \tanh (x))^2}{2 d}\\ \end{align*}
Mathematica [A] time = 0.565627, size = 61, normalized size = 1.15 \[ -\frac{2 b d \tanh (x) (b c-2 a d)+2 (b c-a d)^2 (\log (\cosh (x))-\log (c \cosh (x)+d \sinh (x)))+b^2 d^2 \text{sech}^2(x)}{2 d^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.063, size = 251, normalized size = 4.7 \begin{align*} 4\,{\frac{ \left ( \tanh \left ( x/2 \right ) \right ) ^{3}ab}{d \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{2}}}-2\,{\frac{ \left ( \tanh \left ( x/2 \right ) \right ) ^{3}{b}^{2}c}{{d}^{2} \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{2}}}+2\,{\frac{{b}^{2} \left ( \tanh \left ( x/2 \right ) \right ) ^{2}}{d \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{2}}}+4\,{\frac{a\tanh \left ( x/2 \right ) b}{d \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{2}}}-2\,{\frac{\tanh \left ( x/2 \right ){b}^{2}c}{{d}^{2} \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{2}}}-{\frac{{a}^{2}}{d}\ln \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) }+2\,{\frac{\ln \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) cba}{{d}^{2}}}-{\frac{{c}^{2}{b}^{2}}{{d}^{3}}\ln \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) }+{\frac{{a}^{2}}{d}\ln \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}c+2\,\tanh \left ( x/2 \right ) d+c \right ) }-2\,{\frac{\ln \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}c+2\,\tanh \left ( x/2 \right ) d+c \right ) cba}{{d}^{2}}}+{\frac{{c}^{2}{b}^{2}}{{d}^{3}}\ln \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}c+2\,\tanh \left ( x/2 \right ) d+c \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.58313, size = 204, normalized size = 3.85 \begin{align*} -b^{2}{\left (\frac{2 \,{\left ({\left (c + d\right )} e^{\left (-2 \, x\right )} + c\right )}}{2 \, d^{2} e^{\left (-2 \, x\right )} + d^{2} e^{\left (-4 \, x\right )} + d^{2}} - \frac{c^{2} \log \left (-{\left (c - d\right )} e^{\left (-2 \, x\right )} - c - d\right )}{d^{3}} + \frac{c^{2} \log \left (e^{\left (-2 \, x\right )} + 1\right )}{d^{3}}\right )} - 2 \, a 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^{2} \log \left (d \tanh \left (x\right ) + c\right )}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.37237, size = 1667, normalized size = 31.45 \begin{align*} \text{result too large to display} \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{\left (a + b \tanh{\left (x \right )}\right )^{2} \operatorname{sech}^{2}{\left (x \right )}}{c + d \tanh{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.15526, size = 356, normalized size = 6.72 \begin{align*} \frac{{\left (b^{2} c^{3} - 2 \, a b c^{2} d + b^{2} c^{2} d + a^{2} c d^{2} - 2 \, a b c d^{2} + a^{2} d^{3}\right )} \log \left ({\left | c e^{\left (2 \, x\right )} + d e^{\left (2 \, x\right )} + c - d \right |}\right )}{c d^{3} + d^{4}} - \frac{{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (e^{\left (2 \, x\right )} + 1\right )}{d^{3}} + \frac{3 \, b^{2} c^{2} e^{\left (4 \, x\right )} - 6 \, a b c d e^{\left (4 \, x\right )} + 3 \, a^{2} d^{2} e^{\left (4 \, x\right )} + 6 \, b^{2} c^{2} e^{\left (2 \, x\right )} - 12 \, a b c d e^{\left (2 \, x\right )} + 4 \, b^{2} c d e^{\left (2 \, x\right )} + 6 \, a^{2} d^{2} e^{\left (2 \, x\right )} - 8 \, a b d^{2} e^{\left (2 \, x\right )} - 4 \, b^{2} d^{2} e^{\left (2 \, x\right )} + 3 \, b^{2} c^{2} - 6 \, a b c d + 4 \, b^{2} c d + 3 \, a^{2} d^{2} - 8 \, a b d^{2}}{2 \, d^{3}{\left (e^{\left (2 \, x\right )} + 1\right )}^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]