Optimal. Leaf size=77 \[ 8 a^4 x+\frac {8 a^4 \log (\cosh (c+d x))}{d}-\frac {4 a^4 \tanh (c+d x)}{d}-\frac {a (a+a \tanh (c+d x))^3}{3 d}-\frac {\left (a^2+a^2 \tanh (c+d x)\right )^2}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 77, normalized size of antiderivative = 1.00, number of steps
used = 4, 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 {4 a^4 \tanh (c+d x)}{d}+\frac {8 a^4 \log (\cosh (c+d x))}{d}+8 a^4 x-\frac {\left (a^2 \tanh (c+d x)+a^2\right )^2}{d}-\frac {a (a \tanh (c+d x)+a)^3}{3 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))^4 \, dx &=-\frac {a (a+a \tanh (c+d x))^3}{3 d}+(2 a) \int (a+a \tanh (c+d x))^3 \, dx\\ &=-\frac {a (a+a \tanh (c+d x))^3}{3 d}-\frac {\left (a^2+a^2 \tanh (c+d x)\right )^2}{d}+\left (4 a^2\right ) \int (a+a \tanh (c+d x))^2 \, dx\\ &=8 a^4 x-\frac {4 a^4 \tanh (c+d x)}{d}-\frac {a (a+a \tanh (c+d x))^3}{3 d}-\frac {\left (a^2+a^2 \tanh (c+d x)\right )^2}{d}+\left (8 a^4\right ) \int \tanh (c+d x) \, dx\\ &=8 a^4 x+\frac {8 a^4 \log (\cosh (c+d x))}{d}-\frac {4 a^4 \tanh (c+d x)}{d}-\frac {a (a+a \tanh (c+d x))^3}{3 d}-\frac {\left (a^2+a^2 \tanh (c+d x)\right )^2}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(178\) vs. \(2(77)=154\).
time = 0.57, size = 178, normalized size = 2.31 \begin {gather*} \frac {a^4 \text {sech}(c) \text {sech}^3(c+d x) (\cosh (4 d x)+\sinh (4 d x)) (6 d x \cosh (2 c+3 d x)+6 d x \cosh (4 c+3 d x)+6 \cosh (2 c+3 d x) \log (\cosh (c+d x))+6 \cosh (4 c+3 d x) \log (\cosh (c+d x))+6 \cosh (d x) (1+3 d x+3 \log (\cosh (c+d x)))+6 \cosh (2 c+d x) (1+3 d x+3 \log (\cosh (c+d x)))-21 \sinh (d x)+12 \sinh (2 c+d x)-11 \sinh (2 c+3 d x))}{6 d (\cosh (d x)+\sinh (d x))^4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.26, size = 48, normalized size = 0.62
method | result | size |
derivativedivides | \(\frac {a^{4} \left (-\frac {\left (\tanh ^{3}\left (d x +c \right )\right )}{3}-2 \left (\tanh ^{2}\left (d x +c \right )\right )-7 \tanh \left (d x +c \right )-8 \ln \left (\tanh \left (d x +c \right )-1\right )\right )}{d}\) | \(48\) |
default | \(\frac {a^{4} \left (-\frac {\left (\tanh ^{3}\left (d x +c \right )\right )}{3}-2 \left (\tanh ^{2}\left (d x +c \right )\right )-7 \tanh \left (d x +c \right )-8 \ln \left (\tanh \left (d x +c \right )-1\right )\right )}{d}\) | \(48\) |
risch | \(-\frac {16 a^{4} c}{d}+\frac {4 a^{4} \left (18 \,{\mathrm e}^{4 d x +4 c}+27 \,{\mathrm e}^{2 d x +2 c}+11\right )}{3 d \left (1+{\mathrm e}^{2 d x +2 c}\right )^{3}}+\frac {8 a^{4} \ln \left (1+{\mathrm e}^{2 d x +2 c}\right )}{d}\) | \(76\) |
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. 196 vs.
\(2 (75) = 150\).
time = 0.48, size = 196, normalized size = 2.55 \begin {gather*} \frac {1}{3} \, a^{4} {\left (3 \, x + \frac {3 \, c}{d} - \frac {4 \, {\left (3 \, e^{\left (-2 \, d x - 2 \, c\right )} + 3 \, e^{\left (-4 \, d x - 4 \, c\right )} + 2\right )}}{d {\left (3 \, e^{\left (-2 \, d x - 2 \, c\right )} + 3 \, e^{\left (-4 \, d x - 4 \, c\right )} + e^{\left (-6 \, d x - 6 \, c\right )} + 1\right )}}\right )} + 4 \, a^{4} {\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 )} + 6 \, a^{4} {\left (x + \frac {c}{d} - \frac {2}{d {\left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}}\right )} + a^{4} x + \frac {4 \, a^{4} \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. 562 vs.
\(2 (75) = 150\).
time = 0.39, size = 562, normalized size = 7.30 \begin {gather*} \frac {4 \, {\left (18 \, a^{4} \cosh \left (d x + c\right )^{4} + 72 \, a^{4} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + 18 \, a^{4} \sinh \left (d x + c\right )^{4} + 27 \, a^{4} \cosh \left (d x + c\right )^{2} + 11 \, a^{4} + 27 \, {\left (4 \, a^{4} \cosh \left (d x + c\right )^{2} + a^{4}\right )} \sinh \left (d x + c\right )^{2} + 6 \, {\left (a^{4} \cosh \left (d x + c\right )^{6} + 6 \, a^{4} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{5} + a^{4} \sinh \left (d x + c\right )^{6} + 3 \, a^{4} \cosh \left (d x + c\right )^{4} + 3 \, a^{4} \cosh \left (d x + c\right )^{2} + 3 \, {\left (5 \, a^{4} \cosh \left (d x + c\right )^{2} + a^{4}\right )} \sinh \left (d x + c\right )^{4} + a^{4} + 4 \, {\left (5 \, a^{4} \cosh \left (d x + c\right )^{3} + 3 \, a^{4} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )^{3} + 3 \, {\left (5 \, a^{4} \cosh \left (d x + c\right )^{4} + 6 \, a^{4} \cosh \left (d x + c\right )^{2} + a^{4}\right )} \sinh \left (d x + c\right )^{2} + 6 \, {\left (a^{4} \cosh \left (d x + c\right )^{5} + 2 \, a^{4} \cosh \left (d x + c\right )^{3} + a^{4} \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 ) + 18 \, {\left (4 \, a^{4} \cosh \left (d x + c\right )^{3} + 3 \, a^{4} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )\right )}}{3 \, {\left (d \cosh \left (d x + c\right )^{6} + 6 \, d \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{5} + d \sinh \left (d x + c\right )^{6} + 3 \, d \cosh \left (d x + c\right )^{4} + 3 \, {\left (5 \, d \cosh \left (d x + c\right )^{2} + d\right )} \sinh \left (d x + c\right )^{4} + 4 \, {\left (5 \, d \cosh \left (d x + c\right )^{3} + 3 \, d \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )^{3} + 3 \, d \cosh \left (d x + c\right )^{2} + 3 \, {\left (5 \, d \cosh \left (d x + c\right )^{4} + 6 \, d \cosh \left (d x + c\right )^{2} + d\right )} \sinh \left (d x + c\right )^{2} + 6 \, {\left (d \cosh \left (d x + c\right )^{5} + 2 \, d \cosh \left (d x + c\right )^{3} + d \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.11, size = 76, normalized size = 0.99 \begin {gather*} \begin {cases} 16 a^{4} x - \frac {8 a^{4} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {a^{4} \tanh ^{3}{\left (c + d x \right )}}{3 d} - \frac {2 a^{4} \tanh ^{2}{\left (c + d x \right )}}{d} - \frac {7 a^{4} \tanh {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a \tanh {\left (c \right )} + a\right )^{4} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 71, normalized size = 0.92 \begin {gather*} \frac {4 \, {\left (6 \, a^{4} \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) + \frac {18 \, a^{4} e^{\left (4 \, d x + 4 \, c\right )} + 27 \, a^{4} e^{\left (2 \, d x + 2 \, c\right )} + 11 \, a^{4}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{3}}\right )}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.11, size = 53, normalized size = 0.69 \begin {gather*} 16\,a^4\,x-\frac {a^4\,\left (24\,\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )+21\,\mathrm {tanh}\left (c+d\,x\right )+6\,{\mathrm {tanh}\left (c+d\,x\right )}^2+{\mathrm {tanh}\left (c+d\,x\right )}^3\right )}{3\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________