Optimal. Leaf size=165 \[ \frac {x^4 \coth ^{-1}(\tanh (a+b x))^{1+n}}{b (1+n)}-\frac {4 x^3 \coth ^{-1}(\tanh (a+b x))^{2+n}}{b^2 (1+n) (2+n)}+\frac {12 x^2 \coth ^{-1}(\tanh (a+b x))^{3+n}}{b^3 (1+n) (2+n) (3+n)}-\frac {24 x \coth ^{-1}(\tanh (a+b x))^{4+n}}{b^4 (1+n) (2+n) (3+n) (4+n)}+\frac {24 \coth ^{-1}(\tanh (a+b x))^{5+n}}{b^5 (1+n) (2+n) (3+n) (4+n) (5+n)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 165, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {2199, 2188, 30}
\begin {gather*} \frac {24 \coth ^{-1}(\tanh (a+b x))^{n+5}}{b^5 (n+1) (n+2) (n+3) (n+4) (n+5)}-\frac {24 x \coth ^{-1}(\tanh (a+b x))^{n+4}}{b^4 (n+1) (n+2) (n+3) (n+4)}+\frac {12 x^2 \coth ^{-1}(\tanh (a+b x))^{n+3}}{b^3 (n+1) (n+2) (n+3)}-\frac {4 x^3 \coth ^{-1}(\tanh (a+b x))^{n+2}}{b^2 (n+1) (n+2)}+\frac {x^4 \coth ^{-1}(\tanh (a+b x))^{n+1}}{b (n+1)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 2188
Rule 2199
Rubi steps
\begin {align*} \int x^4 \coth ^{-1}(\tanh (a+b x))^n \, dx &=\frac {x^4 \coth ^{-1}(\tanh (a+b x))^{1+n}}{b (1+n)}-\frac {4 \int x^3 \coth ^{-1}(\tanh (a+b x))^{1+n} \, dx}{b (1+n)}\\ &=\frac {x^4 \coth ^{-1}(\tanh (a+b x))^{1+n}}{b (1+n)}-\frac {4 x^3 \coth ^{-1}(\tanh (a+b x))^{2+n}}{b^2 (1+n) (2+n)}+\frac {12 \int x^2 \coth ^{-1}(\tanh (a+b x))^{2+n} \, dx}{b^2 (1+n) (2+n)}\\ &=\frac {x^4 \coth ^{-1}(\tanh (a+b x))^{1+n}}{b (1+n)}-\frac {4 x^3 \coth ^{-1}(\tanh (a+b x))^{2+n}}{b^2 (1+n) (2+n)}+\frac {12 x^2 \coth ^{-1}(\tanh (a+b x))^{3+n}}{b^3 (1+n) (2+n) (3+n)}-\frac {24 \int x \coth ^{-1}(\tanh (a+b x))^{3+n} \, dx}{b^3 (1+n) (2+n) (3+n)}\\ &=\frac {x^4 \coth ^{-1}(\tanh (a+b x))^{1+n}}{b (1+n)}-\frac {4 x^3 \coth ^{-1}(\tanh (a+b x))^{2+n}}{b^2 (1+n) (2+n)}+\frac {12 x^2 \coth ^{-1}(\tanh (a+b x))^{3+n}}{b^3 (1+n) (2+n) (3+n)}-\frac {24 x \coth ^{-1}(\tanh (a+b x))^{4+n}}{b^4 (1+n) (2+n) (3+n) (4+n)}+\frac {24 \int \coth ^{-1}(\tanh (a+b x))^{4+n} \, dx}{b^4 (1+n) (2+n) (3+n) (4+n)}\\ &=\frac {x^4 \coth ^{-1}(\tanh (a+b x))^{1+n}}{b (1+n)}-\frac {4 x^3 \coth ^{-1}(\tanh (a+b x))^{2+n}}{b^2 (1+n) (2+n)}+\frac {12 x^2 \coth ^{-1}(\tanh (a+b x))^{3+n}}{b^3 (1+n) (2+n) (3+n)}-\frac {24 x \coth ^{-1}(\tanh (a+b x))^{4+n}}{b^4 (1+n) (2+n) (3+n) (4+n)}+\frac {24 \text {Subst}\left (\int x^{4+n} \, dx,x,\coth ^{-1}(\tanh (a+b x))\right )}{b^5 (1+n) (2+n) (3+n) (4+n)}\\ &=\frac {x^4 \coth ^{-1}(\tanh (a+b x))^{1+n}}{b (1+n)}-\frac {4 x^3 \coth ^{-1}(\tanh (a+b x))^{2+n}}{b^2 (1+n) (2+n)}+\frac {12 x^2 \coth ^{-1}(\tanh (a+b x))^{3+n}}{b^3 (1+n) (2+n) (3+n)}-\frac {24 x \coth ^{-1}(\tanh (a+b x))^{4+n}}{b^4 (1+n) (2+n) (3+n) (4+n)}+\frac {24 \coth ^{-1}(\tanh (a+b x))^{5+n}}{b^5 (1+n) (2+n) (3+n) (4+n) (5+n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.07, size = 146, normalized size = 0.88 \begin {gather*} \frac {\coth ^{-1}(\tanh (a+b x))^{1+n} \left (b^4 \left (120+154 n+71 n^2+14 n^3+n^4\right ) x^4-4 b^3 \left (60+47 n+12 n^2+n^3\right ) x^3 \coth ^{-1}(\tanh (a+b x))+12 b^2 \left (20+9 n+n^2\right ) x^2 \coth ^{-1}(\tanh (a+b x))^2-24 b (5+n) x \coth ^{-1}(\tanh (a+b x))^3+24 \coth ^{-1}(\tanh (a+b x))^4\right )}{b^5 (1+n) (2+n) (3+n) (4+n) (5+n)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] result has leaf size over 500,000. Avoiding possible recursion issues.
time = 20.53, size = 504228, normalized size = 3055.93
method | result | size |
risch | \(\text {Expression too large to display}\) | \(504228\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains complex when optimal does not.
time = 0.55, size = 380, normalized size = 2.30 \begin {gather*} \frac {{\left (4 \, {\left (n^{4} + 10 \, n^{3} + 35 \, n^{2} + 50 \, n + 24\right )} b^{5} x^{5} - 3 i \, \pi ^{5} + 30 \, \pi ^{4} a + 120 i \, \pi ^{3} a^{2} - 240 \, \pi ^{2} a^{3} - 240 i \, \pi a^{4} + 96 \, a^{5} - 2 \, {\left (i \, \pi {\left (n^{4} + 6 \, n^{3} + 11 \, n^{2} + 6 \, n\right )} b^{4} - 2 \, {\left (n^{4} + 6 \, n^{3} + 11 \, n^{2} + 6 \, n\right )} a b^{4}\right )} x^{4} + 4 \, {\left (\pi ^{2} {\left (n^{3} + 3 \, n^{2} + 2 \, n\right )} b^{3} + 4 i \, \pi {\left (n^{3} + 3 \, n^{2} + 2 \, n\right )} a b^{3} - 4 \, {\left (n^{3} + 3 \, n^{2} + 2 \, n\right )} a^{2} b^{3}\right )} x^{3} - 6 \, {\left (-i \, \pi ^{3} {\left (n^{2} + n\right )} b^{2} + 6 \, \pi ^{2} {\left (n^{2} + n\right )} a b^{2} + 12 i \, \pi {\left (n^{2} + n\right )} a^{2} b^{2} - 8 \, {\left (n^{2} + n\right )} a^{3} b^{2}\right )} x^{2} - 6 \, {\left (\pi ^{4} b n + 8 i \, \pi ^{3} a b n - 24 \, \pi ^{2} a^{2} b n - 32 i \, \pi a^{3} b n + 16 \, a^{4} b n\right )} x\right )} {\left (\cosh \left (-n \log \left (-i \, \pi + 2 \, b x + 2 \, a\right )\right ) - \sinh \left (-n \log \left (-i \, \pi + 2 \, b x + 2 \, a\right )\right )\right )}}{{\left (2^{n + 2} n^{5} + 15 \cdot 2^{n + 2} n^{4} + 85 \cdot 2^{n + 2} n^{3} + 225 \cdot 2^{n + 2} n^{2} + 137 \cdot 2^{n + 3} n + 15 \cdot 2^{n + 5}\right )} b^{5}} \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. 583 vs.
\(2 (165) = 330\).
time = 0.40, size = 583, normalized size = 3.53 \begin {gather*} \frac {2 \, {\left (2 \, {\left (b^{5} n^{4} + 10 \, b^{5} n^{3} + 35 \, b^{5} n^{2} + 50 \, b^{5} n + 24 \, b^{5}\right )} x^{5} + 15 \, \pi ^{4} a - 120 \, \pi ^{2} a^{3} + 48 \, a^{5} + 2 \, {\left (a b^{4} n^{4} + 6 \, a b^{4} n^{3} + 11 \, a b^{4} n^{2} + 6 \, a b^{4} n\right )} x^{4} - 2 \, {\left (4 \, a^{2} b^{3} n^{3} + 12 \, a^{2} b^{3} n^{2} + 8 \, a^{2} b^{3} n - \pi ^{2} {\left (b^{3} n^{3} + 3 \, b^{3} n^{2} + 2 \, b^{3} n\right )}\right )} x^{3} + 6 \, {\left (4 \, a^{3} b^{2} n^{2} + 4 \, a^{3} b^{2} n - 3 \, \pi ^{2} {\left (a b^{2} n^{2} + a b^{2} n\right )}\right )} x^{2} - 3 \, {\left (\pi ^{4} b n - 24 \, \pi ^{2} a^{2} b n + 16 \, a^{4} b n\right )} x\right )} {\left (b^{2} x^{2} + 2 \, a b x + \frac {1}{4} \, \pi ^{2} + a^{2}\right )}^{\frac {1}{2} \, n} \cos \left (2 \, n \arctan \left (-\frac {2 \, b x}{\pi } - \frac {2 \, a}{\pi } + \frac {\sqrt {4 \, b^{2} x^{2} + 8 \, a b x + \pi ^{2} + 4 \, a^{2}}}{\pi }\right )\right ) - {\left (2 \, \pi {\left (b^{4} n^{4} + 6 \, b^{4} n^{3} + 11 \, b^{4} n^{2} + 6 \, b^{4} n\right )} x^{4} + 3 \, \pi ^{5} - 120 \, \pi ^{3} a^{2} + 240 \, \pi a^{4} - 16 \, \pi {\left (a b^{3} n^{3} + 3 \, a b^{3} n^{2} + 2 \, a b^{3} n\right )} x^{3} - 6 \, {\left (\pi ^{3} {\left (b^{2} n^{2} + b^{2} n\right )} - 12 \, \pi {\left (a^{2} b^{2} n^{2} + a^{2} b^{2} n\right )}\right )} x^{2} + 48 \, {\left (\pi ^{3} a b n - 4 \, \pi a^{3} b n\right )} x\right )} {\left (b^{2} x^{2} + 2 \, a b x + \frac {1}{4} \, \pi ^{2} + a^{2}\right )}^{\frac {1}{2} \, n} \sin \left (2 \, n \arctan \left (-\frac {2 \, b x}{\pi } - \frac {2 \, a}{\pi } + \frac {\sqrt {4 \, b^{2} x^{2} + 8 \, a b x + \pi ^{2} + 4 \, a^{2}}}{\pi }\right )\right )}{4 \, {\left (b^{5} n^{5} + 15 \, b^{5} n^{4} + 85 \, b^{5} n^{3} + 225 \, b^{5} n^{2} + 274 \, b^{5} n + 120 \, b^{5}\right )}} \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*} \begin {cases} \frac {x^{5} \operatorname {acoth}^{n}{\left (\tanh {\left (a \right )} \right )}}{5} & \text {for}\: b = 0 \\- \frac {x^{4}}{4 b \operatorname {acoth}^{4}{\left (\tanh {\left (a + b x \right )} \right )}} - \frac {x^{3}}{3 b^{2} \operatorname {acoth}^{3}{\left (\tanh {\left (a + b x \right )} \right )}} - \frac {x^{2}}{2 b^{3} \operatorname {acoth}^{2}{\left (\tanh {\left (a + b x \right )} \right )}} - \frac {x}{b^{4} \operatorname {acoth}{\left (\tanh {\left (a + b x \right )} \right )}} + \frac {\log {\left (\operatorname {acoth}{\left (\tanh {\left (a + b x \right )} \right )} \right )}}{b^{5}} & \text {for}\: n = -5 \\\int \frac {x^{4}}{\operatorname {acoth}^{4}{\left (\tanh {\left (a + b x \right )} \right )}}\, dx & \text {for}\: n = -4 \\\int \frac {x^{4}}{\operatorname {acoth}^{3}{\left (\tanh {\left (a + b x \right )} \right )}}\, dx & \text {for}\: n = -3 \\\int \frac {x^{4}}{\operatorname {acoth}^{2}{\left (\tanh {\left (a + b x \right )} \right )}}\, dx & \text {for}\: n = -2 \\\int \frac {x^{4}}{\operatorname {acoth}{\left (\tanh {\left (a + b x \right )} \right )}}\, dx & \text {for}\: n = -1 \\\frac {b^{4} n^{4} x^{4} \operatorname {acoth}{\left (\tanh {\left (a + b x \right )} \right )} \operatorname {acoth}^{n}{\left (\tanh {\left (a + b x \right )} \right )}}{b^{5} n^{5} + 15 b^{5} n^{4} + 85 b^{5} n^{3} + 225 b^{5} n^{2} + 274 b^{5} n + 120 b^{5}} + \frac {14 b^{4} n^{3} x^{4} \operatorname {acoth}{\left (\tanh {\left (a + b x \right )} \right )} \operatorname {acoth}^{n}{\left (\tanh {\left (a + b x \right )} \right )}}{b^{5} n^{5} + 15 b^{5} n^{4} + 85 b^{5} n^{3} + 225 b^{5} n^{2} + 274 b^{5} n + 120 b^{5}} + \frac {71 b^{4} n^{2} x^{4} \operatorname {acoth}{\left (\tanh {\left (a + b x \right )} \right )} \operatorname {acoth}^{n}{\left (\tanh {\left (a + b x \right )} \right )}}{b^{5} n^{5} + 15 b^{5} n^{4} + 85 b^{5} n^{3} + 225 b^{5} n^{2} + 274 b^{5} n + 120 b^{5}} + \frac {154 b^{4} n x^{4} \operatorname {acoth}{\left (\tanh {\left (a + b x \right )} \right )} \operatorname {acoth}^{n}{\left (\tanh {\left (a + b x \right )} \right )}}{b^{5} n^{5} + 15 b^{5} n^{4} + 85 b^{5} n^{3} + 225 b^{5} n^{2} + 274 b^{5} n + 120 b^{5}} + \frac {120 b^{4} x^{4} \operatorname {acoth}{\left (\tanh {\left (a + b x \right )} \right )} \operatorname {acoth}^{n}{\left (\tanh {\left (a + b x \right )} \right )}}{b^{5} n^{5} + 15 b^{5} n^{4} + 85 b^{5} n^{3} + 225 b^{5} n^{2} + 274 b^{5} n + 120 b^{5}} - \frac {4 b^{3} n^{3} x^{3} \operatorname {acoth}^{2}{\left (\tanh {\left (a + b x \right )} \right )} \operatorname {acoth}^{n}{\left (\tanh {\left (a + b x \right )} \right )}}{b^{5} n^{5} + 15 b^{5} n^{4} + 85 b^{5} n^{3} + 225 b^{5} n^{2} + 274 b^{5} n + 120 b^{5}} - \frac {48 b^{3} n^{2} x^{3} \operatorname {acoth}^{2}{\left (\tanh {\left (a + b x \right )} \right )} \operatorname {acoth}^{n}{\left (\tanh {\left (a + b x \right )} \right )}}{b^{5} n^{5} + 15 b^{5} n^{4} + 85 b^{5} n^{3} + 225 b^{5} n^{2} + 274 b^{5} n + 120 b^{5}} - \frac {188 b^{3} n x^{3} \operatorname {acoth}^{2}{\left (\tanh {\left (a + b x \right )} \right )} \operatorname {acoth}^{n}{\left (\tanh {\left (a + b x \right )} \right )}}{b^{5} n^{5} + 15 b^{5} n^{4} + 85 b^{5} n^{3} + 225 b^{5} n^{2} + 274 b^{5} n + 120 b^{5}} - \frac {240 b^{3} x^{3} \operatorname {acoth}^{2}{\left (\tanh {\left (a + b x \right )} \right )} \operatorname {acoth}^{n}{\left (\tanh {\left (a + b x \right )} \right )}}{b^{5} n^{5} + 15 b^{5} n^{4} + 85 b^{5} n^{3} + 225 b^{5} n^{2} + 274 b^{5} n + 120 b^{5}} + \frac {12 b^{2} n^{2} x^{2} \operatorname {acoth}^{3}{\left (\tanh {\left (a + b x \right )} \right )} \operatorname {acoth}^{n}{\left (\tanh {\left (a + b x \right )} \right )}}{b^{5} n^{5} + 15 b^{5} n^{4} + 85 b^{5} n^{3} + 225 b^{5} n^{2} + 274 b^{5} n + 120 b^{5}} + \frac {108 b^{2} n x^{2} \operatorname {acoth}^{3}{\left (\tanh {\left (a + b x \right )} \right )} \operatorname {acoth}^{n}{\left (\tanh {\left (a + b x \right )} \right )}}{b^{5} n^{5} + 15 b^{5} n^{4} + 85 b^{5} n^{3} + 225 b^{5} n^{2} + 274 b^{5} n + 120 b^{5}} + \frac {240 b^{2} x^{2} \operatorname {acoth}^{3}{\left (\tanh {\left (a + b x \right )} \right )} \operatorname {acoth}^{n}{\left (\tanh {\left (a + b x \right )} \right )}}{b^{5} n^{5} + 15 b^{5} n^{4} + 85 b^{5} n^{3} + 225 b^{5} n^{2} + 274 b^{5} n + 120 b^{5}} - \frac {24 b n x \operatorname {acoth}^{4}{\left (\tanh {\left (a + b x \right )} \right )} \operatorname {acoth}^{n}{\left (\tanh {\left (a + b x \right )} \right )}}{b^{5} n^{5} + 15 b^{5} n^{4} + 85 b^{5} n^{3} + 225 b^{5} n^{2} + 274 b^{5} n + 120 b^{5}} - \frac {120 b x \operatorname {acoth}^{4}{\left (\tanh {\left (a + b x \right )} \right )} \operatorname {acoth}^{n}{\left (\tanh {\left (a + b x \right )} \right )}}{b^{5} n^{5} + 15 b^{5} n^{4} + 85 b^{5} n^{3} + 225 b^{5} n^{2} + 274 b^{5} n + 120 b^{5}} + \frac {24 \operatorname {acoth}^{5}{\left (\tanh {\left (a + b x \right )} \right )} \operatorname {acoth}^{n}{\left (\tanh {\left (a + b x \right )} \right )}}{b^{5} n^{5} + 15 b^{5} n^{4} + 85 b^{5} n^{3} + 225 b^{5} n^{2} + 274 b^{5} n + 120 b^{5}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.19, size = 546, normalized size = 3.31 \begin {gather*} -{\left (\frac {\ln \left (\frac {2\,{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}-1}\right )}{2}-\frac {\ln \left (-\frac {2}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}-1}\right )}{2}\right )}^n\,\left (\frac {3\,{\left (\ln \left (-\frac {2}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}-1}\right )-\ln \left (\frac {2\,{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}-1}\right )+2\,b\,x\right )}^5}{4\,b^5\,\left (n^5+15\,n^4+85\,n^3+225\,n^2+274\,n+120\right )}-\frac {x^5\,\left (n^4+10\,n^3+35\,n^2+50\,n+24\right )}{n^5+15\,n^4+85\,n^3+225\,n^2+274\,n+120}+\frac {3\,n\,x\,{\left (\ln \left (-\frac {2}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}-1}\right )-\ln \left (\frac {2\,{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}-1}\right )+2\,b\,x\right )}^4}{2\,b^4\,\left (n^5+15\,n^4+85\,n^3+225\,n^2+274\,n+120\right )}+\frac {n\,x^4\,\left (\ln \left (-\frac {2}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}-1}\right )-\ln \left (\frac {2\,{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}-1}\right )+2\,b\,x\right )\,\left (n^3+6\,n^2+11\,n+6\right )}{2\,b\,\left (n^5+15\,n^4+85\,n^3+225\,n^2+274\,n+120\right )}+\frac {3\,n\,x^2\,\left (n+1\right )\,{\left (\ln \left (-\frac {2}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}-1}\right )-\ln \left (\frac {2\,{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}-1}\right )+2\,b\,x\right )}^3}{2\,b^3\,\left (n^5+15\,n^4+85\,n^3+225\,n^2+274\,n+120\right )}+\frac {n\,x^3\,{\left (\ln \left (-\frac {2}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}-1}\right )-\ln \left (\frac {2\,{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}-1}\right )+2\,b\,x\right )}^2\,\left (n^2+3\,n+2\right )}{b^2\,\left (n^5+15\,n^4+85\,n^3+225\,n^2+274\,n+120\right )}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________