Optimal. Leaf size=56 \[ 4 a^3 x+\frac {4 a^3 \log (\cosh (c+d x))}{d}-\frac {2 a^3 \tanh (c+d x)}{d}-\frac {a (a+a \tanh (c+d x))^2}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3559, 3558,
3556} \begin {gather*} -\frac {2 a^3 \tanh (c+d x)}{d}+\frac {4 a^3 \log (\cosh (c+d x))}{d}+4 a^3 x-\frac {a (a \tanh (c+d x)+a)^2}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3558
Rule 3559
Rubi steps
\begin {align*} \int (a+a \tanh (c+d x))^3 \, dx &=-\frac {a (a+a \tanh (c+d x))^2}{2 d}+(2 a) \int (a+a \tanh (c+d x))^2 \, dx\\ &=4 a^3 x-\frac {2 a^3 \tanh (c+d x)}{d}-\frac {a (a+a \tanh (c+d x))^2}{2 d}+\left (4 a^3\right ) \int \tanh (c+d x) \, dx\\ &=4 a^3 x+\frac {4 a^3 \log (\cosh (c+d x))}{d}-\frac {2 a^3 \tanh (c+d x)}{d}-\frac {a (a+a \tanh (c+d x))^2}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.49, size = 103, normalized size = 1.84 \begin {gather*} \frac {a^3 \text {sech}(c) \text {sech}^2(c+d x) (2 d x \cosh (3 c+2 d x)+2 \cosh (3 c+2 d x) \log (\cosh (c+d x))+2 \cosh (c+2 d x) (d x+\log (\cosh (c+d x)))+\cosh (c) (1+4 d x+4 \log (\cosh (c+d x)))+3 \sinh (c)-3 \sinh (c+2 d x))}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.26, size = 38, normalized size = 0.68
method | result | size |
derivativedivides | \(\frac {a^{3} \left (-\frac {\left (\tanh ^{2}\left (d x +c \right )\right )}{2}-3 \tanh \left (d x +c \right )-4 \ln \left (\tanh \left (d x +c \right )-1\right )\right )}{d}\) | \(38\) |
default | \(\frac {a^{3} \left (-\frac {\left (\tanh ^{2}\left (d x +c \right )\right )}{2}-3 \tanh \left (d x +c \right )-4 \ln \left (\tanh \left (d x +c \right )-1\right )\right )}{d}\) | \(38\) |
risch | \(-\frac {8 a^{3} c}{d}+\frac {2 a^{3} \left (4 \,{\mathrm e}^{2 d x +2 c}+3\right )}{d \left (1+{\mathrm e}^{2 d x +2 c}\right )^{2}}+\frac {4 a^{3} \ln \left (1+{\mathrm e}^{2 d x +2 c}\right )}{d}\) | \(65\) |
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. 116 vs.
\(2 (54) = 108\).
time = 0.47, size = 116, normalized size = 2.07 \begin {gather*} a^{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^{3} {\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^{3} \log \left (\cosh \left (d x + c\right )\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. 299 vs.
\(2 (54) = 108\).
time = 0.35, size = 299, normalized size = 5.34 \begin {gather*} \frac {2 \, {\left (4 \, a^{3} \cosh \left (d x + c\right )^{2} + 8 \, a^{3} \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + 4 \, a^{3} \sinh \left (d x + c\right )^{2} + 3 \, a^{3} + 2 \, {\left (a^{3} \cosh \left (d x + c\right )^{4} + 4 \, a^{3} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + a^{3} \sinh \left (d x + c\right )^{4} + 2 \, a^{3} \cosh \left (d x + c\right )^{2} + a^{3} + 2 \, {\left (3 \, a^{3} \cosh \left (d x + c\right )^{2} + a^{3}\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left (a^{3} \cosh \left (d x + c\right )^{3} + a^{3} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )\right )} \log \left (\frac {2 \, \cosh \left (d x + c\right )}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right )\right )}}{d \cosh \left (d x + c\right )^{4} + 4 \, d \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + d \sinh \left (d x + c\right )^{4} + 2 \, d \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, d \cosh \left (d x + c\right )^{2} + d\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left (d \cosh \left (d x + c\right )^{3} + d \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.10, size = 61, normalized size = 1.09 \begin {gather*} \begin {cases} 8 a^{3} x - \frac {4 a^{3} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {a^{3} \tanh ^{2}{\left (c + d x \right )}}{2 d} - \frac {3 a^{3} \tanh {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a \tanh {\left (c \right )} + a\right )^{3} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.41, size = 57, normalized size = 1.02 \begin {gather*} \frac {2 \, {\left (2 \, a^{3} \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) + \frac {4 \, a^{3} e^{\left (2 \, d x + 2 \, c\right )} + 3 \, a^{3}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{2}}\right )}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.09, size = 43, normalized size = 0.77 \begin {gather*} 8\,a^3\,x-\frac {a^3\,\left (8\,\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )+6\,\mathrm {tanh}\left (c+d\,x\right )+{\mathrm {tanh}\left (c+d\,x\right )}^2\right )}{2\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________