3.49 \(\int \frac{\tanh ^{-1}(\tanh (a+b x))^2}{x} \, dx\)

Optimal. Leaf size=49 \[ -b x \left (b x-\tanh ^{-1}(\tanh (a+b x))\right )+\frac{1}{2} \tanh ^{-1}(\tanh (a+b x))^2+\log (x) \left (b x-\tanh ^{-1}(\tanh (a+b x))\right )^2 \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.033532, antiderivative size = 49, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.231, Rules used = {2159, 2158, 29} \[ -b x \left (b x-\tanh ^{-1}(\tanh (a+b x))\right )+\frac{1}{2} \tanh ^{-1}(\tanh (a+b x))^2+\log (x) \left (b x-\tanh ^{-1}(\tanh (a+b x))\right )^2 \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2159

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]

Rule 2158

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 29

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

Rubi steps

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

Mathematica [A]  time = 0.0408171, size = 53, normalized size = 1.08 \[ \frac{1}{2} (a+b x)^2-(a+b x) \left (-2 \tanh ^{-1}(\tanh (a+b x))+a+2 b x\right )+\log (b x) \left (\tanh ^{-1}(\tanh (a+b x))-b x\right )^2 \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.036, size = 55, normalized size = 1.1 \begin{align*} \ln \left ( x \right ) \left ({\it Artanh} \left ( \tanh \left ( bx+a \right ) \right ) \right ) ^{2}+{b}^{2}{x}^{2}\ln \left ( x \right ) -{\frac{3\,{b}^{2}{x}^{2}}{2}}-2\,b{\it Artanh} \left ( \tanh \left ( bx+a \right ) \right ) \ln \left ( x \right ) x+2\,b{\it Artanh} \left ( \tanh \left ( bx+a \right ) \right ) x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 2.35913, size = 27, normalized size = 0.55 \begin{align*} \frac{1}{2} \, b^{2} x^{2} + 2 \, a b x + a^{2} \log \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.47833, size = 49, normalized size = 1. \begin{align*} \frac{1}{2} \, b^{2} x^{2} + 2 \, a b x + a^{2} \log \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\operatorname{atanh}^{2}{\left (\tanh{\left (a + b x \right )} \right )}}{x}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.12558, size = 28, normalized size = 0.57 \begin{align*} \frac{1}{2} \, b^{2} x^{2} + 2 \, a b x + a^{2} \log \left ({\left | x \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*b^2*x^2 + 2*a*b*x + a^2*log(abs(x))