3.269 \(\int x \tanh ^{-1}(\tanh (a+b x))^n \, dx\)

Optimal. Leaf size=48 \[ \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)} \]

[Out]

x*arctanh(tanh(b*x+a))^(1+n)/b/(1+n)-arctanh(tanh(b*x+a))^(2+n)/b^2/(1+n)/(2+n)

________________________________________________________________________________________

Rubi [A]  time = 0.02, 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 = {2168, 2157, 30} \[ \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)} \]

Antiderivative was successfully verified.

[In]

Int[x*ArcTanh[Tanh[a + b*x]]^n,x]

[Out]

(x*ArcTanh[Tanh[a + b*x]]^(1 + n))/(b*(1 + n)) - ArcTanh[Tanh[a + b*x]]^(2 + n)/(b^2*(1 + n)*(2 + n))

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2157

Int[(u_)^(m_.), x_Symbol] :> With[{c = Simplify[D[u, x]]}, Dist[1/c, Subst[Int[x^m, x], x, u], x]] /; FreeQ[m,
 x] && PiecewiseLinearQ[u, x]

Rule 2168

Int[(u_)^(m_)*(v_)^(n_.), x_Symbol] :> With[{a = Simplify[D[u, x]], b = Simplify[D[v, x]]}, Simp[(u^(m + 1)*v^
n)/(a*(m + 1)), x] - Dist[(b*n)/(a*(m + 1)), Int[u^(m + 1)*v^(n - 1), x], x] /; NeQ[b*u - a*v, 0]] /; FreeQ[{m
, n}, x] && PiecewiseLinearQ[u, v, x] && NeQ[m, -1] && ((LtQ[m, -1] && GtQ[n, 0] &&  !(ILtQ[m + n, -2] && (Fra
ctionQ[m] || GeQ[2*n + m + 1, 0]))) || (IGtQ[n, 0] && IGtQ[m, 0] && LeQ[n, m]) || (IGtQ[n, 0] &&  !IntegerQ[m]
) || (ILtQ[m, 0] &&  !IntegerQ[n]))

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 {\operatorname {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.05, size = 41, normalized size = 0.85 \[ \frac {\left (b (n+2) x-\tanh ^{-1}(\tanh (a+b x))\right ) \tanh ^{-1}(\tanh (a+b x))^{n+1}}{b^2 (n+1) (n+2)} \]

Antiderivative was successfully verified.

[In]

Integrate[x*ArcTanh[Tanh[a + b*x]]^n,x]

[Out]

((b*(2 + n)*x - ArcTanh[Tanh[a + b*x]])*ArcTanh[Tanh[a + b*x]]^(1 + n))/(b^2*(1 + n)*(2 + n))

________________________________________________________________________________________

fricas [A]  time = 0.56, size = 91, normalized size = 1.90 \[ \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}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*arctanh(tanh(b*x+a))^n,x, algorithm="fricas")

[Out]

((a*b*n*x + (b^2*n + b^2)*x^2 - a^2)*cosh(n*log(b*x + a)) + (a*b*n*x + (b^2*n + b^2)*x^2 - a^2)*sinh(n*log(b*x
 + a)))/(b^2*n^2 + 3*b^2*n + 2*b^2)

________________________________________________________________________________________

giac [A]  time = 0.14, size = 76, normalized size = 1.58 \[ \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}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*arctanh(tanh(b*x+a))^n,x, algorithm="giac")

[Out]

((b*x + a)^n*b^2*n*x^2 + (b*x + a)^n*a*b*n*x + (b*x + a)^n*b^2*x^2 - (b*x + a)^n*a^2)/(b^2*n^2 + 3*b^2*n + 2*b
^2)

________________________________________________________________________________________

maple [B]  time = 0.10, size = 175, normalized size = 3.65 \[ \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 )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*arctanh(tanh(b*x+a))^n,x)

[Out]

1/(2+n)*x^2*exp(n*ln(arctanh(tanh(b*x+a))))+n*(arctanh(tanh(b*x+a))-b*x)/b/(n^2+3*n+2)*x*exp(n*ln(arctanh(tanh
(b*x+a))))-1/b^2/(n^2+3*n+2)*exp(n*ln(arctanh(tanh(b*x+a))))*a^2-2/b^2/(n^2+3*n+2)*exp(n*ln(arctanh(tanh(b*x+a
))))*a*(arctanh(tanh(b*x+a))-b*x-a)-1/b^2/(n^2+3*n+2)*exp(n*ln(arctanh(tanh(b*x+a))))*(arctanh(tanh(b*x+a))-b*
x-a)^2

________________________________________________________________________________________

maxima [A]  time = 0.54, size = 42, normalized size = 0.88 \[ \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}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*arctanh(tanh(b*x+a))^n,x, algorithm="maxima")

[Out]

(b^2*(n + 1)*x^2 + a*b*n*x - a^2)*(b*x + a)^n/((n^2 + 3*n + 2)*b^2)

________________________________________________________________________________________

mupad [B]  time = 1.23, size = 205, normalized size = 4.27 \[ -{\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 ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*atanh(tanh(a + b*x))^n,x)

[Out]

-(log((2*exp(2*a)*exp(2*b*x))/(exp(2*a)*exp(2*b*x) + 1))/2 - log(2/(exp(2*a)*exp(2*b*x) + 1))/2)^n*((log(2/(ex
p(2*a)*exp(2*b*x) + 1)) - log((2*exp(2*a)*exp(2*b*x))/(exp(2*a)*exp(2*b*x) + 1)) + 2*b*x)^2/(4*b^2*(3*n + n^2
+ 2)) - (x^2*(n + 1))/(3*n + n^2 + 2) + (n*x*(log(2/(exp(2*a)*exp(2*b*x) + 1)) - log((2*exp(2*a)*exp(2*b*x))/(
exp(2*a)*exp(2*b*x) + 1)) + 2*b*x))/(2*b*(3*n + n^2 + 2)))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \begin {cases} \frac {x^{2} \operatorname {atanh}^{n}{\left (\tanh {\relax (a )} \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} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*atanh(tanh(b*x+a))**n,x)

[Out]

Piecewise((x**2*atanh(tanh(a))**n/2, Eq(b, 0)), (-x/(b*atanh(tanh(a + b*x))) + log(atanh(tanh(a + b*x)))/b**2,
 Eq(n, -2)), (Integral(x/atanh(tanh(a + b*x)), x), Eq(n, -1)), (b*n*x*atanh(tanh(a + b*x))*atanh(tanh(a + b*x)
)**n/(b**2*n**2 + 3*b**2*n + 2*b**2) + 2*b*x*atanh(tanh(a + b*x))*atanh(tanh(a + b*x))**n/(b**2*n**2 + 3*b**2*
n + 2*b**2) - atanh(tanh(a + b*x))**2*atanh(tanh(a + b*x))**n/(b**2*n**2 + 3*b**2*n + 2*b**2), True))

________________________________________________________________________________________