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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 39, normalized size of antiderivative = 1.00, 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 = {2199, 2189, 29} \begin {gather*} -\frac {\tanh ^{-1}(\tanh (a+b x))^2}{x}-2 b \log (x) \left (b x-\tanh ^{-1}(\tanh (a+b x))\right )+2 b^2 x \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

2*b^2*x - ArcTanh[Tanh[a + b*x]]^2/x - 2*b*(b*x - ArcTanh[Tanh[a + b*x]])*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 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*} \int \frac {\tanh ^{-1}(\tanh (a+b x))^2}{x^2} \, dx &=-\frac {\tanh ^{-1}(\tanh (a+b x))^2}{x}+(2 b) \int \frac {\tanh ^{-1}(\tanh (a+b x))}{x} \, dx\\ &=2 b^2 x-\frac {\tanh ^{-1}(\tanh (a+b x))^2}{x}-\left (2 b \left (b x-\tanh ^{-1}(\tanh (a+b x))\right )\right ) \int \frac {1}{x} \, dx\\ &=2 b^2 x-\frac {\tanh ^{-1}(\tanh (a+b x))^2}{x}-2 b \left (b x-\tanh ^{-1}(\tanh (a+b x))\right ) \log (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 37, normalized size = 0.95 \begin {gather*} -\frac {\tanh ^{-1}(\tanh (a+b x))^2}{x}-2 b^2 x \log (x)+2 b \tanh ^{-1}(\tanh (a+b x)) (1+\log (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.10, size = 41, normalized size = 1.05

method result size
default \(-\frac {\arctanh \left (\tanh \left (b x +a \right )\right )^{2}}{x}+2 b \left (\ln \left (x \right ) \arctanh \left (\tanh \left (b x +a \right )\right )-b \left (x \ln \left (x \right )-x \right )\right )\) \(41\)
risch \(-\frac {\ln \left ({\mathrm e}^{b x +a}\right )^{2}}{x}+2 b^{2} x +\frac {i \pi \ln \left (x \right ) b \,\mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right ) \mathrm {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )^{2}}{2}-\frac {i \pi \ln \left ({\mathrm e}^{b x +a}\right ) \mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right ) \mathrm {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )^{2}}{2 x}+\frac {\pi ^{2} \left (\mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right ) \mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right ) \mathrm {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )-\mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right ) \mathrm {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )^{2}+\mathrm {csgn}\left (i {\mathrm e}^{b x +a}\right )^{2} \mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )-2 \,\mathrm {csgn}\left (i {\mathrm e}^{b x +a}\right ) \mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )^{2}+\mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )^{3}-\mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right ) \mathrm {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )^{2}+\mathrm {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )^{3}\right )^{2}}{16 x}-2 \ln \left (x \right ) x \,b^{2}+2 \ln \left (x \right ) \ln \left ({\mathrm e}^{b x +a}\right ) b +i \pi \ln \left (x \right ) b \,\mathrm {csgn}\left (i {\mathrm e}^{b x +a}\right ) \mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )^{2}+\frac {i \pi \ln \left ({\mathrm e}^{b x +a}\right ) \mathrm {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )^{3}}{2 x}+\frac {i \pi \ln \left ({\mathrm e}^{b x +a}\right ) \mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right ) \mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right ) \mathrm {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )}{2 x}-\frac {i \pi \ln \left ({\mathrm e}^{b x +a}\right ) \mathrm {csgn}\left (i {\mathrm e}^{b x +a}\right ) \mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )^{2}}{x}-\frac {i \pi \ln \left (x \right ) b \mathrm {csgn}\left (i {\mathrm e}^{b x +a}\right )^{2} \mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )}{2}+\frac {i \pi \ln \left (x \right ) b \,\mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right ) \mathrm {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )^{2}}{2}+\frac {i \pi \ln \left ({\mathrm e}^{b x +a}\right ) \mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )^{3}}{2 x}-\frac {i \pi \ln \left (x \right ) b \mathrm {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )^{3}}{2}-\frac {i \pi \ln \left (x \right ) b \mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )^{3}}{2}-\frac {i \pi \ln \left (x \right ) b \,\mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 b x +2 a}+1}\right ) \mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right ) \mathrm {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )}{2}-\frac {i \pi \ln \left ({\mathrm e}^{b x +a}\right ) \mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right ) \mathrm {csgn}\left (\frac {i {\mathrm e}^{2 b x +2 a}}{{\mathrm e}^{2 b x +2 a}+1}\right )^{2}}{2 x}+\frac {i \pi \ln \left ({\mathrm e}^{b x +a}\right ) \mathrm {csgn}\left (i {\mathrm e}^{b x +a}\right )^{2} \mathrm {csgn}\left (i {\mathrm e}^{2 b x +2 a}\right )}{2 x}\) \(913\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.32, size = 54, normalized size = 1.38 \begin {gather*} 2 \, b \operatorname {artanh}\left (\tanh \left (b x + a\right )\right ) \log \left (x\right ) - 2 \, {\left (b {\left (x + \frac {a}{b}\right )} \log \left (x\right ) - b {\left (x + \frac {a \log \left (x\right )}{b}\right )}\right )} b - \frac {\operatorname {artanh}\left (\tanh \left (b x + a\right )\right )^{2}}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.34, size = 24, normalized size = 0.62 \begin {gather*} \frac {b^{2} x^{2} + 2 \, a b x \log \left (x\right ) - a^{2}}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.39, size = 21, normalized size = 0.54 \begin {gather*} b^{2} x + 2 \, a b \log \left ({\left | x \right |}\right ) - \frac {a^{2}}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.19, size = 198, normalized size = 5.08 \begin {gather*} b\,\ln \left (\frac {{\mathrm {e}}^{2\,b\,x}}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}+1}\right )-\frac {{\ln \left (\frac {{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}+1}\right )}^2}{4\,x}-b\,\ln \left (\frac {1}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}+1}\right )-\frac {{\ln \left (\frac {1}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}+1}\right )}^2}{4\,x}+b\,\ln \left (\frac {{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}+1}\right )\,\ln \left (x\right )-2\,b^2\,x\,\ln \left (x\right )-b\,\ln \left (\frac {1}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}+1}\right )\,\ln \left (x\right )+\frac {\ln \left (\frac {1}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}+1}\right )\,\ln \left (\frac {{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}}{{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}+1}\right )}{2\,x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________