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

Optimal. Leaf size=82 \[ -\frac{2 x \coth ^{-1}(\tanh (a+b x))^{n+2}}{b^2 (n+1) (n+2)}+\frac{2 \coth ^{-1}(\tanh (a+b x))^{n+3}}{b^3 (n+1) (n+2) (n+3)}+\frac{x^2 \coth ^{-1}(\tanh (a+b x))^{n+1}}{b (n+1)} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0461923, antiderivative size = 82, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.231, Rules used = {2168, 2157, 30} \[ -\frac{2 x \coth ^{-1}(\tanh (a+b x))^{n+2}}{b^2 (n+1) (n+2)}+\frac{2 \coth ^{-1}(\tanh (a+b x))^{n+3}}{b^3 (n+1) (n+2) (n+3)}+\frac{x^2 \coth ^{-1}(\tanh (a+b x))^{n+1}}{b (n+1)} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

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]))

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 30

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

Rubi steps

\begin{align*} \int x^2 \coth ^{-1}(\tanh (a+b x))^n \, dx &=\frac{x^2 \coth ^{-1}(\tanh (a+b x))^{1+n}}{b (1+n)}-\frac{2 \int x \coth ^{-1}(\tanh (a+b x))^{1+n} \, dx}{b (1+n)}\\ &=\frac{x^2 \coth ^{-1}(\tanh (a+b x))^{1+n}}{b (1+n)}-\frac{2 x \coth ^{-1}(\tanh (a+b x))^{2+n}}{b^2 (1+n) (2+n)}+\frac{2 \int \coth ^{-1}(\tanh (a+b x))^{2+n} \, dx}{b^2 (1+n) (2+n)}\\ &=\frac{x^2 \coth ^{-1}(\tanh (a+b x))^{1+n}}{b (1+n)}-\frac{2 x \coth ^{-1}(\tanh (a+b x))^{2+n}}{b^2 (1+n) (2+n)}+\frac{2 \operatorname{Subst}\left (\int x^{2+n} \, dx,x,\coth ^{-1}(\tanh (a+b x))\right )}{b^3 (1+n) (2+n)}\\ &=\frac{x^2 \coth ^{-1}(\tanh (a+b x))^{1+n}}{b (1+n)}-\frac{2 x \coth ^{-1}(\tanh (a+b x))^{2+n}}{b^2 (1+n) (2+n)}+\frac{2 \coth ^{-1}(\tanh (a+b x))^{3+n}}{b^3 (1+n) (2+n) (3+n)}\\ \end{align*}

Mathematica [A]  time = 0.0645757, size = 71, normalized size = 0.87 \[ \frac{\coth ^{-1}(\tanh (a+b x))^{n+1} \left (-2 b (n+3) x \coth ^{-1}(\tanh (a+b x))+2 \coth ^{-1}(\tanh (a+b x))^2+b^2 \left (n^2+5 n+6\right ) x^2\right )}{b^3 (n+1) (n+2) (n+3)} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(ArcCoth[Tanh[a + b*x]]^(1 + n)*(b^2*(6 + 5*n + n^2)*x^2 - 2*b*(3 + n)*x*ArcCoth[Tanh[a + b*x]] + 2*ArcCoth[Ta
nh[a + b*x]]^2))/(b^3*(1 + n)*(2 + n)*(3 + n))

________________________________________________________________________________________

Maple [C]  time = 18.674, size = 252344, normalized size = 3077.4 \begin{align*} \text{output too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

result too large to display

________________________________________________________________________________________

Maxima [C]  time = 1.79112, size = 223, normalized size = 2.72 \begin{align*} \frac{{\left (4 \,{\left (n^{2} + 3 \, n + 2\right )} b^{3} x^{3} + i \, \pi ^{3} - 6 \, \pi ^{2} a - 12 i \, \pi a^{2} + 8 \, a^{3} +{\left (-2 i \, \pi{\left (n^{2} + n\right )} b^{2} + 4 \,{\left (n^{2} + n\right )} a b^{2}\right )} x^{2} +{\left (2 \, \pi ^{2} b n + 8 i \, \pi a b n - 8 \, a^{2} 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^{3} + 3 \cdot 2^{n + 3} n^{2} + 11 \cdot 2^{n + 2} n + 3 \cdot 2^{n + 3}\right )} b^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(4*(n^2 + 3*n + 2)*b^3*x^3 + I*pi^3 - 6*pi^2*a - 12*I*pi*a^2 + 8*a^3 + (-2*I*pi*(n^2 + n)*b^2 + 4*(n^2 + n)*a*
b^2)*x^2 + (2*pi^2*b*n + 8*I*pi*a*b*n - 8*a^2*b*n)*x)*(cosh(-n*log(-I*pi + 2*b*x + 2*a)) - sinh(-n*log(-I*pi +
 2*b*x + 2*a)))/((2^(n + 2)*n^3 + 3*2^(n + 3)*n^2 + 11*2^(n + 2)*n + 3*2^(n + 3))*b^3)

________________________________________________________________________________________

Fricas [B]  time = 1.72839, size = 649, normalized size = 7.91 \begin{align*} \frac{2 \,{\left (2 \,{\left (b^{3} n^{2} + 3 \, b^{3} n + 2 \, b^{3}\right )} x^{3} - 3 \, \pi ^{2} a + 4 \, a^{3} + 2 \,{\left (a b^{2} n^{2} + a b^{2} n\right )} x^{2} +{\left (\pi ^{2} b n - 4 \, a^{2} 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 (8 \, \pi a b n x - 2 \, \pi{\left (b^{2} n^{2} + b^{2} n\right )} x^{2} + \pi ^{3} - 12 \, \pi a^{2}\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^{3} n^{3} + 6 \, b^{3} n^{2} + 11 \, b^{3} n + 6 \, b^{3}\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*(2*(2*(b^3*n^2 + 3*b^3*n + 2*b^3)*x^3 - 3*pi^2*a + 4*a^3 + 2*(a*b^2*n^2 + a*b^2*n)*x^2 + (pi^2*b*n - 4*a^2
*b*n)*x)*(b^2*x^2 + 2*a*b*x + 1/4*pi^2 + a^2)^(1/2*n)*cos(2*n*arctan(-2*b*x/pi - 2*a/pi + sqrt(4*b^2*x^2 + 8*a
*b*x + pi^2 + 4*a^2)/pi)) + (8*pi*a*b*n*x - 2*pi*(b^2*n^2 + b^2*n)*x^2 + pi^3 - 12*pi*a^2)*(b^2*x^2 + 2*a*b*x
+ 1/4*pi^2 + a^2)^(1/2*n)*sin(2*n*arctan(-2*b*x/pi - 2*a/pi + sqrt(4*b^2*x^2 + 8*a*b*x + pi^2 + 4*a^2)/pi)))/(
b^3*n^3 + 6*b^3*n^2 + 11*b^3*n + 6*b^3)

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: TypeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*acoth(tanh(b*x+a))**n,x)

[Out]

Exception raised: TypeError

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int x^{2} \operatorname{arcoth}\left (\tanh \left (b x + a\right )\right )^{n}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integrate(x^2*arccoth(tanh(b*x + a))^n, x)