\(\int x^m \coth ^{-1}(\tanh (a+b x)) \, dx\) [193]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [C] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 11, antiderivative size = 37 \[ \int x^m \coth ^{-1}(\tanh (a+b x)) \, dx=-\frac {b x^{2+m}}{2+3 m+m^2}+\frac {x^{1+m} \coth ^{-1}(\tanh (a+b x))}{1+m} \]

[Out]

-b*x^(2+m)/(m^2+3*m+2)+x^(1+m)*arccoth(tanh(b*x+a))/(1+m)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {2199, 30} \[ \int x^m \coth ^{-1}(\tanh (a+b x)) \, dx=\frac {x^{m+1} \coth ^{-1}(\tanh (a+b x))}{m+1}-\frac {b x^{m+2}}{m^2+3 m+2} \]

[In]

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

[Out]

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

Rule 30

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

Rule 2199

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*} \text {integral}& = \frac {x^{1+m} \coth ^{-1}(\tanh (a+b x))}{1+m}-\frac {b \int x^{1+m} \, dx}{1+m} \\ & = -\frac {b x^{2+m}}{2+3 m+m^2}+\frac {x^{1+m} \coth ^{-1}(\tanh (a+b x))}{1+m} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.92 \[ \int x^m \coth ^{-1}(\tanh (a+b x)) \, dx=x^m \left (\frac {b x^2}{2+m}+\frac {x \left (-b x+\coth ^{-1}(\tanh (a+b x))\right )}{1+m}\right ) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.15 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.32

method result size
parallelrisch \(-\frac {-x \,x^{m} \operatorname {arccoth}\left (\tanh \left (b x +a \right )\right ) m +b \,x^{2} x^{m}-2 \,\operatorname {arccoth}\left (\tanh \left (b x +a \right )\right ) x \,x^{m}}{\left (1+m \right ) \left (2+m \right )}\) \(49\)
risch \(\frac {x \,x^{m} \ln \left ({\mathrm e}^{b x +a}\right )}{1+m}-\frac {x \left (4 b x +i \pi \operatorname {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )^{3} m +2 i \pi \,\operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right ) \operatorname {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right ) \operatorname {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )-2 i \pi \,\operatorname {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right ) \operatorname {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )^{2}+2 i \pi m -i \pi \,\operatorname {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right ) \operatorname {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )^{2} m +2 i \pi \operatorname {csgn}\left (i {\mathrm e}^{b x +a}\right )^{2} \operatorname {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )+2 i \pi \operatorname {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )^{3}-2 i \pi \,\operatorname {csgn}\left (i {\mathrm e}^{b x +a}\right ) \operatorname {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )^{2} m +i \pi \operatorname {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )^{3} m +4 i \pi \operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right )^{3}-2 i \pi \,\operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right ) \operatorname {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )^{2}+i \pi \operatorname {csgn}\left (i {\mathrm e}^{b x +a}\right )^{2} \operatorname {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right ) m -4 i \pi \,\operatorname {csgn}\left (i {\mathrm e}^{b x +a}\right ) \operatorname {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )^{2}-2 i \pi \operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right )^{2} m +2 i \pi \operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right )^{3} m +2 i \pi \operatorname {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )^{3}+i \pi \,\operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right ) \operatorname {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right ) \operatorname {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right ) m -i \pi \,\operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right ) \operatorname {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )^{2} m +4 i \pi -4 i \pi \operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right )^{2}\right ) x^{m}}{4 \left (1+m \right ) \left (2+m \right )}\) \(676\)

[In]

int(x^m*arccoth(tanh(b*x+a)),x,method=_RETURNVERBOSE)

[Out]

-(-x*x^m*arccoth(tanh(b*x+a))*m+b*x^2*x^m-2*arccoth(tanh(b*x+a))*x*x^m)/(1+m)/(2+m)

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.25 (sec) , antiderivative size = 81, normalized size of antiderivative = 2.19 \[ \int x^m \coth ^{-1}(\tanh (a+b x)) \, dx=\frac {{\left (i \, \pi {\left (m + 2\right )} x + 2 \, {\left (b m + b\right )} x^{2} + 2 \, {\left (a m + 2 \, a\right )} x\right )} \cosh \left (m \log \left (x\right )\right ) + {\left (i \, \pi {\left (m + 2\right )} x + 2 \, {\left (b m + b\right )} x^{2} + 2 \, {\left (a m + 2 \, a\right )} x\right )} \sinh \left (m \log \left (x\right )\right )}{2 \, {\left (m^{2} + 3 \, m + 2\right )}} \]

[In]

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

[Out]

1/2*((I*pi*(m + 2)*x + 2*(b*m + b)*x^2 + 2*(a*m + 2*a)*x)*cosh(m*log(x)) + (I*pi*(m + 2)*x + 2*(b*m + b)*x^2 +
 2*(a*m + 2*a)*x)*sinh(m*log(x)))/(m^2 + 3*m + 2)

Sympy [F]

\[ \int x^m \coth ^{-1}(\tanh (a+b x)) \, dx=\begin {cases} b \log {\left (x \right )} - \frac {\operatorname {acoth}{\left (\tanh {\left (a + b x \right )} \right )}}{x} & \text {for}\: m = -2 \\\int \frac {\operatorname {acoth}{\left (\tanh {\left (a + b x \right )} \right )}}{x}\, dx & \text {for}\: m = -1 \\- \frac {b x^{2} x^{m}}{m^{2} + 3 m + 2} + \frac {m x x^{m} \operatorname {acoth}{\left (\tanh {\left (a + b x \right )} \right )}}{m^{2} + 3 m + 2} + \frac {2 x x^{m} \operatorname {acoth}{\left (\tanh {\left (a + b x \right )} \right )}}{m^{2} + 3 m + 2} & \text {otherwise} \end {cases} \]

[In]

integrate(x**m*acoth(tanh(b*x+a)),x)

[Out]

Piecewise((b*log(x) - acoth(tanh(a + b*x))/x, Eq(m, -2)), (Integral(acoth(tanh(a + b*x))/x, x), Eq(m, -1)), (-
b*x**2*x**m/(m**2 + 3*m + 2) + m*x*x**m*acoth(tanh(a + b*x))/(m**2 + 3*m + 2) + 2*x*x**m*acoth(tanh(a + b*x))/
(m**2 + 3*m + 2), True))

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.03 \[ \int x^m \coth ^{-1}(\tanh (a+b x)) \, dx=-\frac {b x^{2} x^{m}}{{\left (m + 2\right )} {\left (m + 1\right )}} + \frac {x^{m + 1} \operatorname {arcoth}\left (\tanh \left (b x + a\right )\right )}{m + 1} \]

[In]

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

[Out]

-b*x^2*x^m/((m + 2)*(m + 1)) + x^(m + 1)*arccoth(tanh(b*x + a))/(m + 1)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 90 vs. \(2 (37) = 74\).

Time = 0.28 (sec) , antiderivative size = 90, normalized size of antiderivative = 2.43 \[ \int x^m \coth ^{-1}(\tanh (a+b x)) \, dx=\frac {x^{m + 1} \log \left (-\frac {\frac {e^{\left (2 \, b x + 2 \, a\right )} + 1}{e^{\left (2 \, b x + 2 \, a\right )} - 1} + 1}{\frac {e^{\left (2 \, b x + 2 \, a\right )} + 1}{e^{\left (2 \, b x + 2 \, a\right )} - 1} - 1}\right )}{2 \, {\left (m + 1\right )}} - \frac {b x^{m + 2}}{{\left (m + 2\right )} {\left (m + 1\right )}} \]

[In]

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

[Out]

1/2*x^(m + 1)*log(-((e^(2*b*x + 2*a) + 1)/(e^(2*b*x + 2*a) - 1) + 1)/((e^(2*b*x + 2*a) + 1)/(e^(2*b*x + 2*a) -
 1) - 1))/(m + 1) - b*x^(m + 2)/((m + 2)*(m + 1))

Mupad [B] (verification not implemented)

Time = 0.00 (sec) , antiderivative size = 96, normalized size of antiderivative = 2.59 \[ \int x^m \coth ^{-1}(\tanh (a+b x)) \, dx=\frac {2\,b\,x^m\,x^2\,\left (m+1\right )}{2\,m^2+6\,m+4}-\frac {x\,x^m\,\left (m+2\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 )}{2\,m^2+6\,m+4} \]

[In]

int(x^m*acoth(tanh(a + b*x)),x)

[Out]

(2*b*x^m*x^2*(m + 1))/(6*m + 2*m^2 + 4) - (x*x^m*(m + 2)*(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))/(6*m + 2*m^2 + 4)