Optimal. Leaf size=101 \[ \left (a^4+6 a^2 b^2+b^4\right ) x-\frac {b^2 \left (3 a^2+b^2\right ) \coth (c+d x)}{d}-\frac {a b (a+b \coth (c+d x))^2}{d}-\frac {b (a+b \coth (c+d x))^3}{3 d}+\frac {4 a b \left (a^2+b^2\right ) \log (\sinh (c+d x))}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 101, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3563, 3609,
3606, 3556} \begin {gather*} -\frac {b^2 \left (3 a^2+b^2\right ) \coth (c+d x)}{d}+\frac {4 a b \left (a^2+b^2\right ) \log (\sinh (c+d x))}{d}+x \left (a^4+6 a^2 b^2+b^4\right )-\frac {b (a+b \coth (c+d x))^3}{3 d}-\frac {a b (a+b \coth (c+d x))^2}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3563
Rule 3606
Rule 3609
Rubi steps
\begin {align*} \int (a+b \coth (c+d x))^4 \, dx &=-\frac {b (a+b \coth (c+d x))^3}{3 d}+\int (a+b \coth (c+d x))^2 \left (a^2+b^2+2 a b \coth (c+d x)\right ) \, dx\\ &=-\frac {a b (a+b \coth (c+d x))^2}{d}-\frac {b (a+b \coth (c+d x))^3}{3 d}+\int (a+b \coth (c+d x)) \left (a \left (a^2+3 b^2\right )+b \left (3 a^2+b^2\right ) \coth (c+d x)\right ) \, dx\\ &=\left (a^4+6 a^2 b^2+b^4\right ) x-\frac {b^2 \left (3 a^2+b^2\right ) \coth (c+d x)}{d}-\frac {a b (a+b \coth (c+d x))^2}{d}-\frac {b (a+b \coth (c+d x))^3}{3 d}+\left (4 a b \left (a^2+b^2\right )\right ) \int \coth (c+d x) \, dx\\ &=\left (a^4+6 a^2 b^2+b^4\right ) x-\frac {b^2 \left (3 a^2+b^2\right ) \coth (c+d x)}{d}-\frac {a b (a+b \coth (c+d x))^2}{d}-\frac {b (a+b \coth (c+d x))^3}{3 d}+\frac {4 a b \left (a^2+b^2\right ) \log (\sinh (c+d x))}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.61, size = 109, normalized size = 1.08 \begin {gather*} -\frac {6 b^2 \left (6 a^2+b^2\right ) \coth (c+d x)+12 a b^3 \coth ^2(c+d x)+2 b^4 \coth ^3(c+d x)+3 (a+b)^4 \log (1-\tanh (c+d x))-24 a b \left (a^2+b^2\right ) \log (\tanh (c+d x))-3 (a-b)^4 \log (1+\tanh (c+d x))}{6 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.36, size = 134, normalized size = 1.33
method | result | size |
derivativedivides | \(\frac {-\frac {b^{4} \left (\coth ^{3}\left (d x +c \right )\right )}{3}-2 a \,b^{3} \left (\coth ^{2}\left (d x +c \right )\right )-6 a^{2} b^{2} \coth \left (d x +c \right )-b^{4} \coth \left (d x +c \right )-\frac {\left (a^{4}+4 a^{3} b +6 a^{2} b^{2}+4 a \,b^{3}+b^{4}\right ) \ln \left (\coth \left (d x +c \right )-1\right )}{2}+\frac {\left (a^{4}-4 a^{3} b +6 a^{2} b^{2}-4 a \,b^{3}+b^{4}\right ) \ln \left (\coth \left (d x +c \right )+1\right )}{2}}{d}\) | \(134\) |
default | \(\frac {-\frac {b^{4} \left (\coth ^{3}\left (d x +c \right )\right )}{3}-2 a \,b^{3} \left (\coth ^{2}\left (d x +c \right )\right )-6 a^{2} b^{2} \coth \left (d x +c \right )-b^{4} \coth \left (d x +c \right )-\frac {\left (a^{4}+4 a^{3} b +6 a^{2} b^{2}+4 a \,b^{3}+b^{4}\right ) \ln \left (\coth \left (d x +c \right )-1\right )}{2}+\frac {\left (a^{4}-4 a^{3} b +6 a^{2} b^{2}-4 a \,b^{3}+b^{4}\right ) \ln \left (\coth \left (d x +c \right )+1\right )}{2}}{d}\) | \(134\) |
risch | \(x \,a^{4}-4 a^{3} b x +6 a^{2} b^{2} x -4 a \,b^{3} x +b^{4} x -\frac {8 a^{3} b c}{d}-\frac {8 a \,b^{3} c}{d}-\frac {4 b^{2} \left (9 a^{2} {\mathrm e}^{4 d x +4 c}+6 a b \,{\mathrm e}^{4 d x +4 c}+3 b^{2} {\mathrm e}^{4 d x +4 c}-18 a^{2} {\mathrm e}^{2 d x +2 c}-6 a b \,{\mathrm e}^{2 d x +2 c}-3 b^{2} {\mathrm e}^{2 d x +2 c}+9 a^{2}+2 b^{2}\right )}{3 d \left ({\mathrm e}^{2 d x +2 c}-1\right )^{3}}+\frac {4 b \,a^{3} \ln \left ({\mathrm e}^{2 d x +2 c}-1\right )}{d}+\frac {4 b^{3} a \ln \left ({\mathrm e}^{2 d x +2 c}-1\right )}{d}\) | \(211\) |
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. 219 vs.
\(2 (99) = 198\).
time = 0.27, size = 219, normalized size = 2.17 \begin {gather*} \frac {1}{3} \, b^{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 b^{3} {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-d x - c\right )} + 1\right )}{d} + \frac {\log \left (e^{\left (-d x - 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^{2} b^{2} {\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^{3} b \log \left (\sinh \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. 1396 vs.
\(2 (99) = 198\).
time = 0.38, size = 1396, normalized size = 13.82 \begin {gather*} \frac {3 \, {\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} d x \cosh \left (d x + c\right )^{6} + 18 \, {\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} d x \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{5} + 3 \, {\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} d x \sinh \left (d x + c\right )^{6} - 3 \, {\left (12 \, a^{2} b^{2} + 8 \, a b^{3} + 4 \, b^{4} + 3 \, {\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} d x\right )} \cosh \left (d x + c\right )^{4} + 3 \, {\left (15 \, {\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} d x \cosh \left (d x + c\right )^{2} - 12 \, a^{2} b^{2} - 8 \, a b^{3} - 4 \, b^{4} - 3 \, {\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} d x\right )} \sinh \left (d x + c\right )^{4} - 36 \, a^{2} b^{2} - 8 \, b^{4} + 12 \, {\left (5 \, {\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} d x \cosh \left (d x + c\right )^{3} - {\left (12 \, a^{2} b^{2} + 8 \, a b^{3} + 4 \, b^{4} + 3 \, {\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} d x\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )^{3} - 3 \, {\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} d x + 3 \, {\left (24 \, a^{2} b^{2} + 8 \, a b^{3} + 4 \, b^{4} + 3 \, {\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} d x\right )} \cosh \left (d x + c\right )^{2} + 3 \, {\left (15 \, {\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} d x \cosh \left (d x + c\right )^{4} + 24 \, a^{2} b^{2} + 8 \, a b^{3} + 4 \, b^{4} + 3 \, {\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} d x - 6 \, {\left (12 \, a^{2} b^{2} + 8 \, a b^{3} + 4 \, b^{4} + 3 \, {\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} d x\right )} \cosh \left (d x + c\right )^{2}\right )} \sinh \left (d x + c\right )^{2} + 12 \, {\left ({\left (a^{3} b + a b^{3}\right )} \cosh \left (d x + c\right )^{6} + 6 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{5} + {\left (a^{3} b + a b^{3}\right )} \sinh \left (d x + c\right )^{6} - 3 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (d x + c\right )^{4} - 3 \, {\left (a^{3} b + a b^{3} - 5 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (d x + c\right )^{2}\right )} \sinh \left (d x + c\right )^{4} - a^{3} b - a b^{3} + 4 \, {\left (5 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (d x + c\right )^{3} - 3 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )^{3} + 3 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (d x + c\right )^{2} + 3 \, {\left (5 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (d x + c\right )^{4} + a^{3} b + a b^{3} - 6 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (d x + c\right )^{2}\right )} \sinh \left (d x + c\right )^{2} + 6 \, {\left ({\left (a^{3} b + a b^{3}\right )} \cosh \left (d x + c\right )^{5} - 2 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (d x + c\right )^{3} + {\left (a^{3} b + a b^{3}\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )\right )} \log \left (\frac {2 \, \sinh \left (d x + c\right )}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right ) + 6 \, {\left (3 \, {\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} d x \cosh \left (d x + c\right )^{5} - 2 \, {\left (12 \, a^{2} b^{2} + 8 \, a b^{3} + 4 \, b^{4} + 3 \, {\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} d x\right )} \cosh \left (d x + c\right )^{3} + {\left (24 \, a^{2} b^{2} + 8 \, a b^{3} + 4 \, b^{4} + 3 \, {\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} d x\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\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 [B] Leaf count of result is larger than twice the leaf count of optimal. 488 vs.
\(2 (92) = 184\).
time = 1.45, size = 488, normalized size = 4.83 \begin {gather*} \begin {cases} x \left (a + b \coth {\left (c \right )}\right )^{4} & \text {for}\: d = 0 \\- \frac {a^{4} \log {\left (- e^{- d x} \right )}}{d} - \frac {4 a^{3} b \log {\left (- e^{- d x} \right )} \coth {\left (d x + \log {\left (- e^{- d x} \right )} \right )}}{d} - \frac {6 a^{2} b^{2} \log {\left (- e^{- d x} \right )} \coth ^{2}{\left (d x + \log {\left (- e^{- d x} \right )} \right )}}{d} - \frac {4 a b^{3} \log {\left (- e^{- d x} \right )} \coth ^{3}{\left (d x + \log {\left (- e^{- d x} \right )} \right )}}{d} - \frac {b^{4} \log {\left (- e^{- d x} \right )} \coth ^{4}{\left (d x + \log {\left (- e^{- d x} \right )} \right )}}{d} & \text {for}\: c = \log {\left (- e^{- d x} \right )} \\- \frac {a^{4} \log {\left (e^{- d x} \right )}}{d} - \frac {4 a^{3} b \log {\left (e^{- d x} \right )} \coth {\left (d x + \log {\left (e^{- d x} \right )} \right )}}{d} - \frac {6 a^{2} b^{2} \log {\left (e^{- d x} \right )} \coth ^{2}{\left (d x + \log {\left (e^{- d x} \right )} \right )}}{d} - \frac {4 a b^{3} \log {\left (e^{- d x} \right )} \coth ^{3}{\left (d x + \log {\left (e^{- d x} \right )} \right )}}{d} - \frac {b^{4} \log {\left (e^{- d x} \right )} \coth ^{4}{\left (d x + \log {\left (e^{- d x} \right )} \right )}}{d} & \text {for}\: c = \log {\left (e^{- d x} \right )} \\a^{4} x + 4 a^{3} b x - \frac {4 a^{3} b \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} + \frac {4 a^{3} b \log {\left (\tanh {\left (c + d x \right )} \right )}}{d} + 6 a^{2} b^{2} x - \frac {6 a^{2} b^{2}}{d \tanh {\left (c + d x \right )}} + 4 a b^{3} x - \frac {4 a b^{3} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} + \frac {4 a b^{3} \log {\left (\tanh {\left (c + d x \right )} \right )}}{d} - \frac {2 a b^{3}}{d \tanh ^{2}{\left (c + d x \right )}} + b^{4} x - \frac {b^{4}}{d \tanh {\left (c + d x \right )}} - \frac {b^{4}}{3 d \tanh ^{3}{\left (c + d x \right )}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.44, size = 153, normalized size = 1.51 \begin {gather*} \frac {3 \, {\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} {\left (d x + c\right )} + 12 \, {\left (a^{3} b + a b^{3}\right )} \log \left ({\left | e^{\left (2 \, d x + 2 \, c\right )} - 1 \right |}\right ) - \frac {4 \, {\left (9 \, a^{2} b^{2} + 2 \, b^{4} + 3 \, {\left (3 \, a^{2} b^{2} + 2 \, a b^{3} + b^{4}\right )} e^{\left (4 \, d x + 4 \, c\right )} - 3 \, {\left (6 \, a^{2} b^{2} + 2 \, a b^{3} + b^{4}\right )} e^{\left (2 \, d x + 2 \, c\right )}\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} - 1\right )}^{3}}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.24, size = 158, normalized size = 1.56 \begin {gather*} x\,{\left (a-b\right )}^4-\frac {4\,\left (3\,a^2\,b^2+2\,a\,b^3+b^4\right )}{d\,\left ({\mathrm {e}}^{2\,c+2\,d\,x}-1\right )}-\frac {4\,\left (b^4+2\,a\,b^3\right )}{d\,\left ({\mathrm {e}}^{4\,c+4\,d\,x}-2\,{\mathrm {e}}^{2\,c+2\,d\,x}+1\right )}+\frac {\ln \left ({\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}-1\right )\,\left (4\,a^3\,b+4\,a\,b^3\right )}{d}-\frac {8\,b^4}{3\,d\,\left (3\,{\mathrm {e}}^{2\,c+2\,d\,x}-3\,{\mathrm {e}}^{4\,c+4\,d\,x}+{\mathrm {e}}^{6\,c+6\,d\,x}-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________