Optimal. Leaf size=48 \[ \frac {x \tanh ^{-1}(\tanh (a+b x))^{1+n}}{b (1+n)}-\frac {\tanh ^{-1}(\tanh (a+b x))^{2+n}}{b^2 (1+n) (2+n)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.01, antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {2199, 2188, 30}
\begin {gather*} \frac {x \tanh ^{-1}(\tanh (a+b x))^{n+1}}{b (n+1)}-\frac {\tanh ^{-1}(\tanh (a+b x))^{n+2}}{b^2 (n+1) (n+2)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 2188
Rule 2199
Rubi steps
\begin {align*} \int x \tanh ^{-1}(\tanh (a+b x))^n \, dx &=\frac {x \tanh ^{-1}(\tanh (a+b x))^{1+n}}{b (1+n)}-\frac {\int \tanh ^{-1}(\tanh (a+b x))^{1+n} \, dx}{b (1+n)}\\ &=\frac {x \tanh ^{-1}(\tanh (a+b x))^{1+n}}{b (1+n)}-\frac {\text {Subst}\left (\int x^{1+n} \, dx,x,\tanh ^{-1}(\tanh (a+b x))\right )}{b^2 (1+n)}\\ &=\frac {x \tanh ^{-1}(\tanh (a+b x))^{1+n}}{b (1+n)}-\frac {\tanh ^{-1}(\tanh (a+b x))^{2+n}}{b^2 (1+n) (2+n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 41, normalized size = 0.85 \begin {gather*} \frac {\left (b (2+n) x-\tanh ^{-1}(\tanh (a+b x))\right ) \tanh ^{-1}(\tanh (a+b x))^{1+n}}{b^2 (1+n) (2+n)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(174\) vs.
\(2(48)=96\).
time = 0.40, size = 175, normalized size = 3.65
method | result | size |
default | \(\frac {x^{2} {\mathrm e}^{n \ln \left (\arctanh \left (\tanh \left (b x +a \right )\right )\right )}}{2+n}+\frac {n \left (\arctanh \left (\tanh \left (b x +a \right )\right )-b x \right ) x \,{\mathrm e}^{n \ln \left (\arctanh \left (\tanh \left (b x +a \right )\right )\right )}}{b \left (n^{2}+3 n +2\right )}-\frac {{\mathrm e}^{n \ln \left (\arctanh \left (\tanh \left (b x +a \right )\right )\right )} a^{2}}{b^{2} \left (n^{2}+3 n +2\right )}-\frac {2 \,{\mathrm e}^{n \ln \left (\arctanh \left (\tanh \left (b x +a \right )\right )\right )} a \left (\arctanh \left (\tanh \left (b x +a \right )\right )-b x -a \right )}{b^{2} \left (n^{2}+3 n +2\right )}-\frac {{\mathrm e}^{n \ln \left (\arctanh \left (\tanh \left (b x +a \right )\right )\right )} \left (\arctanh \left (\tanh \left (b x +a \right )\right )-b x -a \right )^{2}}{b^{2} \left (n^{2}+3 n +2\right )}\) | \(175\) |
risch | \(\frac {\left (\frac {1}{2}\right )^{n} \left (2 \ln \left ({\mathrm e}^{b x +a}\right )-\frac {i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right ) \left (-\mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )+\mathrm {csgn}\left (i {\mathrm e}^{b x +a}\right )\right )^{2}}{2}-\frac {i \pi \,\mathrm {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right ) \left (-\mathrm {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )+\mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )\right ) \left (-\mathrm {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )+\mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right )\right )}{2}\right )^{1+n} x}{2 b \left (1+n \right )}-\frac {\left (\frac {1}{2}\right )^{n} \left (2 \ln \left ({\mathrm e}^{b x +a}\right )-\frac {i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right ) \left (-\mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )+\mathrm {csgn}\left (i {\mathrm e}^{b x +a}\right )\right )^{2}}{2}-\frac {i \pi \,\mathrm {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right ) \left (-\mathrm {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )+\mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )\right ) \left (-\mathrm {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )+\mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right )\right )}{2}\right )^{2+n}}{4 b^{2} \left (1+n \right ) \left (2+n \right )}\) | \(388\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.54, size = 42, normalized size = 0.88 \begin {gather*} \frac {{\left (b^{2} {\left (n + 1\right )} x^{2} + a b n x - a^{2}\right )} {\left (b x + a\right )}^{n}}{{\left (n^{2} + 3 \, n + 2\right )} b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 91, normalized size = 1.90 \begin {gather*} \frac {{\left (a b n x + {\left (b^{2} n + b^{2}\right )} x^{2} - a^{2}\right )} \cosh \left (n \log \left (b x + a\right )\right ) + {\left (a b n x + {\left (b^{2} n + b^{2}\right )} x^{2} - a^{2}\right )} \sinh \left (n \log \left (b x + a\right )\right )}{b^{2} n^{2} + 3 \, b^{2} n + 2 \, b^{2}} \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^{2} \operatorname {atanh}^{n}{\left (\tanh {\left (a \right )} \right )}}{2} & \text {for}\: b = 0 \\- \frac {x}{b \operatorname {atanh}{\left (\tanh {\left (a + b x \right )} \right )}} + \frac {\log {\left (\operatorname {atanh}{\left (\tanh {\left (a + b x \right )} \right )} \right )}}{b^{2}} & \text {for}\: n = -2 \\\int \frac {x}{\operatorname {atanh}{\left (\tanh {\left (a + b x \right )} \right )}}\, dx & \text {for}\: n = -1 \\\frac {b n x \operatorname {atanh}{\left (\tanh {\left (a + b x \right )} \right )} \operatorname {atanh}^{n}{\left (\tanh {\left (a + b x \right )} \right )}}{b^{2} n^{2} + 3 b^{2} n + 2 b^{2}} + \frac {2 b x \operatorname {atanh}{\left (\tanh {\left (a + b x \right )} \right )} \operatorname {atanh}^{n}{\left (\tanh {\left (a + b x \right )} \right )}}{b^{2} n^{2} + 3 b^{2} n + 2 b^{2}} - \frac {\operatorname {atanh}^{2}{\left (\tanh {\left (a + b x \right )} \right )} \operatorname {atanh}^{n}{\left (\tanh {\left (a + b x \right )} \right )}}{b^{2} n^{2} + 3 b^{2} n + 2 b^{2}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.40, size = 76, normalized size = 1.58 \begin {gather*} \frac {{\left (b x + a\right )}^{n} b^{2} n x^{2} + {\left (b x + a\right )}^{n} a b n x + {\left (b x + a\right )}^{n} b^{2} x^{2} - {\left (b x + a\right )}^{n} a^{2}}{b^{2} n^{2} + 3 \, b^{2} n + 2 \, b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.23, size = 205, normalized size = 4.27 \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 {{\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}{4\,b^2\,\left (n^2+3\,n+2\right )}-\frac {x^2\,\left (n+1\right )}{n^2+3\,n+2}+\frac {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 )}{2\,b\,\left (n^2+3\,n+2\right )}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________