\(\int \frac {\coth ^{-1}(\tanh (a+b x))^2}{x} \, dx\) [141]

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

Optimal result

Integrand size = 13, antiderivative size = 49 \[ \int \frac {\coth ^{-1}(\tanh (a+b x))^2}{x} \, dx=-b x \left (b x-\coth ^{-1}(\tanh (a+b x))\right )+\frac {1}{2} \coth ^{-1}(\tanh (a+b x))^2+\left (b x-\coth ^{-1}(\tanh (a+b x))\right )^2 \log (x) \]

[Out]

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

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {2190, 2189, 29} \[ \int \frac {\coth ^{-1}(\tanh (a+b x))^2}{x} \, dx=-b x \left (b x-\coth ^{-1}(\tanh (a+b x))\right )+\frac {1}{2} \coth ^{-1}(\tanh (a+b x))^2+\log (x) \left (b x-\coth ^{-1}(\tanh (a+b x))\right )^2 \]

[In]

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

[Out]

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

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 2189

Int[(v_)/(u_), x_Symbol] :> With[{a = Simplify[D[u, x]], b = Simplify[D[v, x]]}, Simp[b*(x/a), x] - Dist[(b*u
- a*v)/a, Int[1/u, x], x] /; NeQ[b*u - a*v, 0]] /; PiecewiseLinearQ[u, v, x]

Rule 2190

Int[(v_)^(n_)/(u_), x_Symbol] :> With[{a = Simplify[D[u, x]], b = Simplify[D[v, x]]}, Simp[v^n/(a*n), x] - Dis
t[(b*u - a*v)/a, Int[v^(n - 1)/u, x], x] /; NeQ[b*u - a*v, 0]] /; PiecewiseLinearQ[u, v, x] && GtQ[n, 0] && Ne
Q[n, 1]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} \coth ^{-1}(\tanh (a+b x))^2-\left (b x-\coth ^{-1}(\tanh (a+b x))\right ) \int \frac {\coth ^{-1}(\tanh (a+b x))}{x} \, dx \\ & = -b x \left (b x-\coth ^{-1}(\tanh (a+b x))\right )+\frac {1}{2} \coth ^{-1}(\tanh (a+b x))^2-\left (\left (b x-\coth ^{-1}(\tanh (a+b x))\right ) \left (-b x+\coth ^{-1}(\tanh (a+b x))\right )\right ) \int \frac {1}{x} \, dx \\ & = -b x \left (b x-\coth ^{-1}(\tanh (a+b x))\right )+\frac {1}{2} \coth ^{-1}(\tanh (a+b x))^2+\left (b x-\coth ^{-1}(\tanh (a+b x))\right )^2 \log (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.08 \[ \int \frac {\coth ^{-1}(\tanh (a+b x))^2}{x} \, dx=\frac {1}{2} (a+b x)^2-(a+b x) \left (a+2 b x-2 \coth ^{-1}(\tanh (a+b x))\right )+\left (-b x+\coth ^{-1}(\tanh (a+b x))\right )^2 \log (b x) \]

[In]

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

[Out]

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

Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 3.

Time = 0.18 (sec) , antiderivative size = 664, normalized size of antiderivative = 13.55

method result size
risch \(\ln \left (x \right ) \ln \left ({\mathrm e}^{b x +a}\right )^{2}+b^{2} \ln \left (x \right ) x^{2}-\frac {3 b^{2} x^{2}}{2}-2 b \ln \left ({\mathrm e}^{b x +a}\right ) \ln \left (x \right ) x +2 b \ln \left ({\mathrm e}^{b x +a}\right ) x -\frac {\pi ^{2} {\left (\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 )-\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}+2 \operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right )^{3}-2 \operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right )^{2}+\operatorname {csgn}\left (i {\mathrm e}^{b x +a}\right )^{2} \operatorname {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )-2 \,\operatorname {csgn}\left (i {\mathrm e}^{b x +a}\right ) \operatorname {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )^{2}+\operatorname {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )^{3}-\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}+\operatorname {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )^{3}+2\right )}^{2} \ln \left (x \right )}{16}-\frac {i \pi \left (\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 )-\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}+2 \operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right )^{3}-2 \operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right )^{2}+\operatorname {csgn}\left (i {\mathrm e}^{b x +a}\right )^{2} \operatorname {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )-2 \,\operatorname {csgn}\left (i {\mathrm e}^{b x +a}\right ) \operatorname {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )^{2}+\operatorname {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )^{3}-\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}+\operatorname {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )^{3}+2\right ) \left (\ln \left (x \right ) \ln \left ({\mathrm e}^{b x +a}\right )-b \left (x \ln \left (x \right )-x \right )\right )}{2}\) \(664\)

[In]

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

[Out]

ln(x)*ln(exp(b*x+a))^2+b^2*ln(x)*x^2-3/2*b^2*x^2-2*b*ln(exp(b*x+a))*ln(x)*x+2*b*ln(exp(b*x+a))*x-1/16*Pi^2*(cs
gn(I/(exp(2*b*x+2*a)+1))*csgn(I*exp(2*b*x+2*a))*csgn(I*exp(2*b*x+2*a)/(exp(2*b*x+2*a)+1))-csgn(I/(exp(2*b*x+2*
a)+1))*csgn(I*exp(2*b*x+2*a)/(exp(2*b*x+2*a)+1))^2+2*csgn(I/(exp(2*b*x+2*a)+1))^3-2*csgn(I/(exp(2*b*x+2*a)+1))
^2+csgn(I*exp(b*x+a))^2*csgn(I*exp(2*b*x+2*a))-2*csgn(I*exp(b*x+a))*csgn(I*exp(2*b*x+2*a))^2+csgn(I*exp(2*b*x+
2*a))^3-csgn(I*exp(2*b*x+2*a))*csgn(I*exp(2*b*x+2*a)/(exp(2*b*x+2*a)+1))^2+csgn(I*exp(2*b*x+2*a)/(exp(2*b*x+2*
a)+1))^3+2)^2*ln(x)-1/2*I*Pi*(csgn(I/(exp(2*b*x+2*a)+1))*csgn(I*exp(2*b*x+2*a))*csgn(I*exp(2*b*x+2*a)/(exp(2*b
*x+2*a)+1))-csgn(I/(exp(2*b*x+2*a)+1))*csgn(I*exp(2*b*x+2*a)/(exp(2*b*x+2*a)+1))^2+2*csgn(I/(exp(2*b*x+2*a)+1)
)^3-2*csgn(I/(exp(2*b*x+2*a)+1))^2+csgn(I*exp(b*x+a))^2*csgn(I*exp(2*b*x+2*a))-2*csgn(I*exp(b*x+a))*csgn(I*exp
(2*b*x+2*a))^2+csgn(I*exp(2*b*x+2*a))^3-csgn(I*exp(2*b*x+2*a))*csgn(I*exp(2*b*x+2*a)/(exp(2*b*x+2*a)+1))^2+csg
n(I*exp(2*b*x+2*a)/(exp(2*b*x+2*a)+1))^3+2)*(ln(x)*ln(exp(b*x+a))-b*(x*ln(x)-x))

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.25 (sec) , antiderivative size = 36, normalized size of antiderivative = 0.73 \[ \int \frac {\coth ^{-1}(\tanh (a+b x))^2}{x} \, dx=\frac {1}{2} \, b^{2} x^{2} + i \, \pi b x + 2 \, a b x - \frac {1}{4} \, {\left (\pi ^{2} - 4 i \, \pi a - 4 \, a^{2}\right )} \log \left (x\right ) \]

[In]

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

[Out]

1/2*b^2*x^2 + I*pi*b*x + 2*a*b*x - 1/4*(pi^2 - 4*I*pi*a - 4*a^2)*log(x)

Sympy [F]

\[ \int \frac {\coth ^{-1}(\tanh (a+b x))^2}{x} \, dx=\int \frac {\operatorname {acoth}^{2}{\left (\tanh {\left (a + b x \right )} \right )}}{x}\, dx \]

[In]

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

[Out]

Integral(acoth(tanh(a + b*x))**2/x, x)

Maxima [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.51 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.78 \[ \int \frac {\coth ^{-1}(\tanh (a+b x))^2}{x} \, dx=\frac {1}{2} \, b^{2} x^{2} - {\left (i \, \pi b - 2 \, a b\right )} x - \frac {1}{4} \, {\left (\pi ^{2} + 4 i \, \pi a - 4 \, a^{2}\right )} \log \left (x\right ) \]

[In]

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

[Out]

1/2*b^2*x^2 - (I*pi*b - 2*a*b)*x - 1/4*(pi^2 + 4*I*pi*a - 4*a^2)*log(x)

Giac [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.29 (sec) , antiderivative size = 37, normalized size of antiderivative = 0.76 \[ \int \frac {\coth ^{-1}(\tanh (a+b x))^2}{x} \, dx=\frac {1}{2} \, b^{2} x^{2} + {\left (i \, \pi b + 2 \, a b\right )} x - \frac {1}{4} \, {\left (\pi ^{2} - 4 i \, \pi a - 4 \, a^{2}\right )} \log \left (x\right ) \]

[In]

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

[Out]

1/2*b^2*x^2 + (I*pi*b + 2*a*b)*x - 1/4*(pi^2 - 4*I*pi*a - 4*a^2)*log(x)

Mupad [B] (verification not implemented)

Time = 0.30 (sec) , antiderivative size = 183, normalized size of antiderivative = 3.73 \[ \int \frac {\coth ^{-1}(\tanh (a+b x))^2}{x} \, dx=\ln \left (x\right )\,\left (\frac {{\left (2\,a-\ln \left (\frac {2\,{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}-1}\right )+\ln \left (-\frac {2}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}-1}\right )+2\,b\,x\right )}^2}{4}-a\,\left (2\,a-\ln \left (\frac {2\,{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}-1}\right )+\ln \left (-\frac {2}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}-1}\right )+2\,b\,x\right )+a^2\right )+\frac {b^2\,x^2}{2}-b\,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 ) \]

[In]

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

[Out]

log(x)*((2*a - log((2*exp(2*a)*exp(2*b*x))/(exp(2*a)*exp(2*b*x) - 1)) + log(-2/(exp(2*a)*exp(2*b*x) - 1)) + 2*
b*x)^2/4 - a*(2*a - log((2*exp(2*a)*exp(2*b*x))/(exp(2*a)*exp(2*b*x) - 1)) + log(-2/(exp(2*a)*exp(2*b*x) - 1))
 + 2*b*x) + a^2) + (b^2*x^2)/2 - b*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)