Optimal. Leaf size=78 \[ -\frac {(b c-a d)^3 \log (c+d \tanh (x))}{d^4}+\frac {b (b c-a d)^2 \tanh (x)}{d^3}-\frac {(b c-a d) (a+b \tanh (x))^2}{2 d^2}+\frac {(a+b \tanh (x))^3}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 78, normalized size of antiderivative = 1.00, 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 = {4427, 45}
\begin {gather*} -\frac {(b c-a d)^3 \log (c+d \tanh (x))}{d^4}+\frac {b \tanh (x) (b c-a d)^2}{d^3}-\frac {(b c-a d) (a+b \tanh (x))^2}{2 d^2}+\frac {(a+b \tanh (x))^3}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 4427
Rubi steps
\begin {align*} \int \frac {\text {sech}^2(x) (a+b \tanh (x))^3}{c+d \tanh (x)} \, dx &=\text {Subst}\left (\int \frac {(a+b x)^3}{c+d x} \, dx,x,\tanh (x)\right )\\ &=\text {Subst}\left (\int \left (\frac {b (b c-a d)^2}{d^3}-\frac {b (b c-a d) (a+b x)}{d^2}+\frac {b (a+b x)^2}{d}+\frac {(-b c+a d)^3}{d^3 (c+d x)}\right ) \, dx,x,\tanh (x)\right )\\ &=-\frac {(b c-a d)^3 \log (c+d \tanh (x))}{d^4}+\frac {b (b c-a d)^2 \tanh (x)}{d^3}-\frac {(b c-a d) (a+b \tanh (x))^2}{2 d^2}+\frac {(a+b \tanh (x))^3}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.60, size = 134, normalized size = 1.72 \begin {gather*} \frac {(c \cosh (x)+d \sinh (x)) (a+b \tanh (x))^3 \left (6 (b c-a d)^3 \cosh ^2(x) (\log (\cosh (x))-\log (c \cosh (x)+d \sinh (x)))+6 b^3 c^2 d \cosh (x) \sinh (x)+b d^2 \left (\left (-9 a b c+9 a^2 d+b^2 d\right ) \sinh (2 x)+b (3 b c-9 a d-2 b d \tanh (x))\right )\right )}{6 d^4 (a \cosh (x)+b \sinh (x))^3 (c+d \tanh (x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(288\) vs.
\(2(74)=148\).
time = 1.12, size = 289, normalized size = 3.71
method | result | size |
default | \(-\frac {2 \left (\frac {\left (-3 a^{2} b \,d^{3}+3 a \,b^{2} c \,d^{2}-b^{3} c^{2} d \right ) \left (\tanh ^{5}\left (\frac {x}{2}\right )\right )+\left (-3 a \,b^{2} d^{3}+b^{3} c \,d^{2}\right ) \left (\tanh ^{4}\left (\frac {x}{2}\right )\right )+\left (-6 a^{2} b \,d^{3}+6 a \,b^{2} c \,d^{2}-2 b^{3} c^{2} d -\frac {4}{3} b^{3} d^{3}\right ) \left (\tanh ^{3}\left (\frac {x}{2}\right )\right )+\left (-3 a \,b^{2} d^{3}+b^{3} c \,d^{2}\right ) \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )+\left (-3 a^{2} b \,d^{3}+3 a \,b^{2} c \,d^{2}-b^{3} c^{2} d \right ) \tanh \left (\frac {x}{2}\right )}{\left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{3}}+\frac {\left (a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 b^{2} c^{2} d a -b^{3} c^{3}\right ) \ln \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )}{2}\right )}{d^{4}}+\frac {\left (a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 b^{2} c^{2} d a -b^{3} c^{3}\right ) \ln \left (c \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )+2 d \tanh \left (\frac {x}{2}\right )+c \right )}{d^{4}}\) | \(289\) |
risch | \(-\frac {2 b \left (9 a^{2} d^{2} {\mathrm e}^{4 x}-9 a b c d \,{\mathrm e}^{4 x}+9 a b \,d^{2} {\mathrm e}^{4 x}+3 b^{2} c^{2} {\mathrm e}^{4 x}-3 b^{2} c d \,{\mathrm e}^{4 x}+3 b^{2} d^{2} {\mathrm e}^{4 x}+18 a^{2} d^{2} {\mathrm e}^{2 x}-18 a b c d \,{\mathrm e}^{2 x}+9 a b \,d^{2} {\mathrm e}^{2 x}+6 b^{2} c^{2} {\mathrm e}^{2 x}-3 b^{2} c d \,{\mathrm e}^{2 x}+9 a^{2} d^{2}-9 a b c d +3 b^{2} c^{2}+b^{2} d^{2}\right )}{3 d^{3} \left (1+{\mathrm e}^{2 x}\right )^{3}}-\frac {\ln \left (1+{\mathrm e}^{2 x}\right ) a^{3}}{d}+\frac {3 \ln \left (1+{\mathrm e}^{2 x}\right ) a^{2} b c}{d^{2}}-\frac {3 \ln \left (1+{\mathrm e}^{2 x}\right ) b^{2} c^{2} a}{d^{3}}+\frac {\ln \left (1+{\mathrm e}^{2 x}\right ) b^{3} c^{3}}{d^{4}}+\frac {\ln \left ({\mathrm e}^{2 x}+\frac {c -d}{c +d}\right ) a^{3}}{d}-\frac {3 \ln \left ({\mathrm e}^{2 x}+\frac {c -d}{c +d}\right ) a^{2} b c}{d^{2}}+\frac {3 \ln \left ({\mathrm e}^{2 x}+\frac {c -d}{c +d}\right ) b^{2} c^{2} a}{d^{3}}-\frac {\ln \left ({\mathrm e}^{2 x}+\frac {c -d}{c +d}\right ) b^{3} c^{3}}{d^{4}}\) | \(346\) |
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. 276 vs.
\(2 (74) = 148\).
time = 0.48, size = 276, normalized size = 3.54 \begin {gather*} \frac {1}{3} \, b^{3} {\left (\frac {2 \, {\left (3 \, c^{2} + d^{2} + 3 \, {\left (2 \, c^{2} + c d\right )} e^{\left (-2 \, x\right )} + 3 \, {\left (c^{2} + c d + d^{2}\right )} e^{\left (-4 \, x\right )}\right )}}{3 \, d^{3} e^{\left (-2 \, x\right )} + 3 \, d^{3} e^{\left (-4 \, x\right )} + d^{3} e^{\left (-6 \, x\right )} + d^{3}} - \frac {3 \, c^{3} \log \left (-{\left (c - d\right )} e^{\left (-2 \, x\right )} - c - d\right )}{d^{4}} + \frac {3 \, c^{3} \log \left (e^{\left (-2 \, x\right )} + 1\right )}{d^{4}}\right )} - 3 \, a 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 )} - 3 \, a^{2} 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^{3} \log \left (d \tanh \left (x\right ) + c\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. 1975 vs.
\(2 (74) = 148\).
time = 0.43, size = 1975, normalized size = 25.32 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (a + b \tanh {\left (x \right )}\right )^{3} \operatorname {sech}^{2}{\left (x \right )}}{c + d \tanh {\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 543 vs.
\(2 (74) = 148\).
time = 0.41, size = 543, normalized size = 6.96 \begin {gather*} -\frac {{\left (b^{3} c^{4} - 3 \, a b^{2} c^{3} d + b^{3} c^{3} d + 3 \, a^{2} b c^{2} d^{2} - 3 \, a b^{2} c^{2} d^{2} - a^{3} c d^{3} + 3 \, a^{2} b c d^{3} - a^{3} d^{4}\right )} \log \left ({\left | c e^{\left (2 \, x\right )} + d e^{\left (2 \, x\right )} + c - d \right |}\right )}{c d^{4} + d^{5}} + \frac {{\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \log \left (e^{\left (2 \, x\right )} + 1\right )}{d^{4}} - \frac {11 \, b^{3} c^{3} e^{\left (6 \, x\right )} - 33 \, a b^{2} c^{2} d e^{\left (6 \, x\right )} + 33 \, a^{2} b c d^{2} e^{\left (6 \, x\right )} - 11 \, a^{3} d^{3} e^{\left (6 \, x\right )} + 33 \, b^{3} c^{3} e^{\left (4 \, x\right )} - 99 \, a b^{2} c^{2} d e^{\left (4 \, x\right )} + 12 \, b^{3} c^{2} d e^{\left (4 \, x\right )} + 99 \, a^{2} b c d^{2} e^{\left (4 \, x\right )} - 36 \, a b^{2} c d^{2} e^{\left (4 \, x\right )} - 12 \, b^{3} c d^{2} e^{\left (4 \, x\right )} - 33 \, a^{3} d^{3} e^{\left (4 \, x\right )} + 36 \, a^{2} b d^{3} e^{\left (4 \, x\right )} + 36 \, a b^{2} d^{3} e^{\left (4 \, x\right )} + 12 \, b^{3} d^{3} e^{\left (4 \, x\right )} + 33 \, b^{3} c^{3} e^{\left (2 \, x\right )} - 99 \, a b^{2} c^{2} d e^{\left (2 \, x\right )} + 24 \, b^{3} c^{2} d e^{\left (2 \, x\right )} + 99 \, a^{2} b c d^{2} e^{\left (2 \, x\right )} - 72 \, a b^{2} c d^{2} e^{\left (2 \, x\right )} - 12 \, b^{3} c d^{2} e^{\left (2 \, x\right )} - 33 \, a^{3} d^{3} e^{\left (2 \, x\right )} + 72 \, a^{2} b d^{3} e^{\left (2 \, x\right )} + 36 \, a b^{2} d^{3} e^{\left (2 \, x\right )} + 11 \, b^{3} c^{3} - 33 \, a b^{2} c^{2} d + 12 \, b^{3} c^{2} d + 33 \, a^{2} b c d^{2} - 36 \, a b^{2} c d^{2} - 11 \, a^{3} d^{3} + 36 \, a^{2} b d^{3} + 4 \, b^{3} d^{3}}{6 \, d^{4} {\left (e^{\left (2 \, x\right )} + 1\right )}^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.73, size = 1347, normalized size = 17.27 \begin {gather*} \frac {2\,\left (2\,b^3\,d-b^3\,c+3\,a\,b^2\,d\right )}{d^2\,\left (2\,{\mathrm {e}}^{2\,x}+{\mathrm {e}}^{4\,x}+1\right )}-\frac {2\,\left (3\,a^2\,b\,d^2-3\,a\,b^2\,c\,d+3\,a\,b^2\,d^2+b^3\,c^2-b^3\,c\,d+b^3\,d^2\right )}{d^3\,\left ({\mathrm {e}}^{2\,x}+1\right )}-\frac {8\,b^3}{3\,d\,\left (3\,{\mathrm {e}}^{2\,x}+3\,{\mathrm {e}}^{4\,x}+{\mathrm {e}}^{6\,x}+1\right )}-\frac {2\,\mathrm {atan}\left (\frac {\left (\frac {32\,c\,\sqrt {a^6\,d^6-6\,a^5\,b\,c\,d^5+15\,a^4\,b^2\,c^2\,d^4-20\,a^3\,b^3\,c^3\,d^3+15\,a^2\,b^4\,c^4\,d^2-6\,a\,b^5\,c^5\,d+b^6\,c^6}\,\left (-a^3\,c\,d^8+a^3\,d^9+3\,a^2\,b\,c^2\,d^7-3\,a^2\,b\,c\,d^8-3\,a\,b^2\,c^3\,d^6+3\,a\,b^2\,c^2\,d^7+b^3\,c^4\,d^5-b^3\,c^3\,d^6\right )}{d^{16}\,\sqrt {{\left (a\,d-b\,c\right )}^6}\,\left (c+d\right )\,{\left (c-d\right )}^2\,\left (c^2+2\,c\,d+d^2\right )}-{\mathrm {e}}^{2\,x}\,\left (\frac {32\,c\,\left (2\,a^3\,c\,d^8-6\,a^2\,b\,c^2\,d^7+6\,a\,b^2\,c^3\,d^6-2\,b^3\,c^4\,d^5\right )\,\sqrt {a^6\,d^6-6\,a^5\,b\,c\,d^5+15\,a^4\,b^2\,c^2\,d^4-20\,a^3\,b^3\,c^3\,d^3+15\,a^2\,b^4\,c^4\,d^2-6\,a\,b^5\,c^5\,d+b^6\,c^6}}{d^{16}\,\sqrt {{\left (a\,d-b\,c\right )}^6}\,\left (c+d\right )\,{\left (c-d\right )}^2\,\left (c^2+2\,c\,d+d^2\right )}-\frac {16\,\left (c^2\,\sqrt {-d^8}\,\sqrt {a^6\,d^6-6\,a^5\,b\,c\,d^5+15\,a^4\,b^2\,c^2\,d^4-20\,a^3\,b^3\,c^3\,d^3+15\,a^2\,b^4\,c^4\,d^2-6\,a\,b^5\,c^5\,d+b^6\,c^6}+d^2\,\sqrt {-d^8}\,\sqrt {a^6\,d^6-6\,a^5\,b\,c\,d^5+15\,a^4\,b^2\,c^2\,d^4-20\,a^3\,b^3\,c^3\,d^3+15\,a^2\,b^4\,c^4\,d^2-6\,a\,b^5\,c^5\,d+b^6\,c^6}\right )\,\left (c^2+d^2\right )\,\sqrt {a^6\,d^6-6\,a^5\,b\,c\,d^5+15\,a^4\,b^2\,c^2\,d^4-20\,a^3\,b^3\,c^3\,d^3+15\,a^2\,b^4\,c^4\,d^2-6\,a\,b^5\,c^5\,d+b^6\,c^6}}{d^{13}\,\left (c+d\right )\,{\left (c-d\right )}^2\,{\left (a\,d-b\,c\right )}^3\,\sqrt {-d^8}\,\left (c^2+2\,c\,d+d^2\right )}\right )+\frac {16\,\left (c^2\,\sqrt {-d^8}\,\sqrt {a^6\,d^6-6\,a^5\,b\,c\,d^5+15\,a^4\,b^2\,c^2\,d^4-20\,a^3\,b^3\,c^3\,d^3+15\,a^2\,b^4\,c^4\,d^2-6\,a\,b^5\,c^5\,d+b^6\,c^6}-c\,d\,\sqrt {-d^8}\,\sqrt {a^6\,d^6-6\,a^5\,b\,c\,d^5+15\,a^4\,b^2\,c^2\,d^4-20\,a^3\,b^3\,c^3\,d^3+15\,a^2\,b^4\,c^4\,d^2-6\,a\,b^5\,c^5\,d+b^6\,c^6}\right )\,\left (c^2+d^2\right )\,\sqrt {a^6\,d^6-6\,a^5\,b\,c\,d^5+15\,a^4\,b^2\,c^2\,d^4-20\,a^3\,b^3\,c^3\,d^3+15\,a^2\,b^4\,c^4\,d^2-6\,a\,b^5\,c^5\,d+b^6\,c^6}}{d^{13}\,\left (c+d\right )\,{\left (c-d\right )}^2\,{\left (a\,d-b\,c\right )}^3\,\sqrt {-d^8}\,\left (c^2+2\,c\,d+d^2\right )}\right )\,\left (d^{10}\,\sqrt {-d^8}+2\,c\,d^9\,\sqrt {-d^8}+c^2\,d^8\,\sqrt {-d^8}\right )}{16\,\sqrt {a^6\,d^6-6\,a^5\,b\,c\,d^5+15\,a^4\,b^2\,c^2\,d^4-20\,a^3\,b^3\,c^3\,d^3+15\,a^2\,b^4\,c^4\,d^2-6\,a\,b^5\,c^5\,d+b^6\,c^6}}\right )\,\sqrt {a^6\,d^6-6\,a^5\,b\,c\,d^5+15\,a^4\,b^2\,c^2\,d^4-20\,a^3\,b^3\,c^3\,d^3+15\,a^2\,b^4\,c^4\,d^2-6\,a\,b^5\,c^5\,d+b^6\,c^6}}{\sqrt {-d^8}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________