Optimal. Leaf size=69 \[ \frac{b \left (3 a^2+b^2\right ) \log (\cosh (c+d x))}{d}+a x \left (a^2+3 b^2\right )-\frac{2 a b^2 \tanh (c+d x)}{d}-\frac{b (a+b \tanh (c+d x))^2}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0645049, antiderivative size = 69, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {3482, 3525, 3475} \[ \frac{b \left (3 a^2+b^2\right ) \log (\cosh (c+d x))}{d}+a x \left (a^2+3 b^2\right )-\frac{2 a b^2 \tanh (c+d x)}{d}-\frac{b (a+b \tanh (c+d x))^2}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3482
Rule 3525
Rule 3475
Rubi steps
\begin{align*} \int (a+b \tanh (c+d x))^3 \, dx &=-\frac{b (a+b \tanh (c+d x))^2}{2 d}+\int (a+b \tanh (c+d x)) \left (a^2+b^2+2 a b \tanh (c+d x)\right ) \, dx\\ &=a \left (a^2+3 b^2\right ) x-\frac{2 a b^2 \tanh (c+d x)}{d}-\frac{b (a+b \tanh (c+d x))^2}{2 d}+\left (b \left (3 a^2+b^2\right )\right ) \int \tanh (c+d x) \, dx\\ &=a \left (a^2+3 b^2\right ) x+\frac{b \left (3 a^2+b^2\right ) \log (\cosh (c+d x))}{d}-\frac{2 a b^2 \tanh (c+d x)}{d}-\frac{b (a+b \tanh (c+d x))^2}{2 d}\\ \end{align*}
Mathematica [A] time = 0.327111, size = 67, normalized size = 0.97 \[ -\frac{6 a b^2 \tanh (c+d x)+(a-b)^3 (-\log (\tanh (c+d x)+1))+(a+b)^3 \log (1-\tanh (c+d x))+b^3 \tanh ^2(c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.004, size = 173, normalized size = 2.5 \begin{align*} -{\frac{{b}^{3} \left ( \tanh \left ( dx+c \right ) \right ) ^{2}}{2\,d}}-3\,{\frac{a{b}^{2}\tanh \left ( dx+c \right ) }{d}}-{\frac{{a}^{3}\ln \left ( \tanh \left ( dx+c \right ) -1 \right ) }{2\,d}}-{\frac{3\,\ln \left ( \tanh \left ( dx+c \right ) -1 \right ){a}^{2}b}{2\,d}}-{\frac{3\,\ln \left ( \tanh \left ( dx+c \right ) -1 \right ) a{b}^{2}}{2\,d}}-{\frac{\ln \left ( \tanh \left ( dx+c \right ) -1 \right ){b}^{3}}{2\,d}}+{\frac{\ln \left ( \tanh \left ( dx+c \right ) +1 \right ){a}^{3}}{2\,d}}-{\frac{3\,\ln \left ( \tanh \left ( dx+c \right ) +1 \right ){a}^{2}b}{2\,d}}+{\frac{3\,\ln \left ( \tanh \left ( dx+c \right ) +1 \right ) a{b}^{2}}{2\,d}}-{\frac{\ln \left ( \tanh \left ( dx+c \right ) +1 \right ){b}^{3}}{2\,d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.78289, size = 159, normalized size = 2.3 \begin{align*} b^{3}{\left (x + \frac{c}{d} + \frac{\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac{2 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d{\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + 1\right )}}\right )} + 3 \, a b^{2}{\left (x + \frac{c}{d} - \frac{2}{d{\left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}}\right )} + a^{3} x + \frac{3 \, a^{2} b \log \left (\cosh \left (d x + c\right )\right )}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.29269, size = 1563, normalized size = 22.65 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.341366, size = 100, normalized size = 1.45 \begin{align*} \begin{cases} a^{3} x + 3 a^{2} b x - \frac{3 a^{2} b \log{\left (\tanh{\left (c + d x \right )} + 1 \right )}}{d} + 3 a b^{2} x - \frac{3 a b^{2} \tanh{\left (c + d x \right )}}{d} + b^{3} x - \frac{b^{3} \log{\left (\tanh{\left (c + d x \right )} + 1 \right )}}{d} - \frac{b^{3} \tanh ^{2}{\left (c + d x \right )}}{2 d} & \text{for}\: d \neq 0 \\x \left (a + b \tanh{\left (c \right )}\right )^{3} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.23742, size = 138, normalized size = 2. \begin{align*} \frac{{\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )}{\left (d x + c\right )}}{d} + \frac{{\left (3 \, a^{2} b + b^{3}\right )} \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}{d} + \frac{2 \,{\left (3 \, a b^{2} +{\left (3 \, a b^{2} + b^{3}\right )} e^{\left (2 \, d x + 2 \, c\right )}\right )}}{d{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]