3.157 \(\int \frac{\tanh ^2(a+2 \log (x))}{x} \, dx\)

Optimal. Leaf size=14 \[ \log (x)-\frac{1}{2} \tanh (a+2 \log (x)) \]

[Out]

Log[x] - Tanh[a + 2*Log[x]]/2

________________________________________________________________________________________

Rubi [A]  time = 0.023689, antiderivative size = 14, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.154, Rules used = {3473, 8} \[ \log (x)-\frac{1}{2} \tanh (a+2 \log (x)) \]

Antiderivative was successfully verified.

[In]

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

[Out]

Log[x] - Tanh[a + 2*Log[x]]/2

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

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

Mathematica [A]  time = 0.0377657, size = 24, normalized size = 1.71 \[ \frac{1}{2} \tanh ^{-1}(\tanh (a+2 \log (x)))-\frac{1}{2} \tanh (a+2 \log (x)) \]

Antiderivative was successfully verified.

[In]

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

[Out]

ArcTanh[Tanh[a + 2*Log[x]]]/2 - Tanh[a + 2*Log[x]]/2

________________________________________________________________________________________

Maple [B]  time = 0.003, size = 35, normalized size = 2.5 \begin{align*} -{\frac{\tanh \left ( a+2\,\ln \left ( x \right ) \right ) }{2}}-{\frac{\ln \left ( \tanh \left ( a+2\,\ln \left ( x \right ) \right ) -1 \right ) }{4}}+{\frac{\ln \left ( \tanh \left ( a+2\,\ln \left ( x \right ) \right ) +1 \right ) }{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*tanh(a+2*ln(x))-1/4*ln(tanh(a+2*ln(x))-1)+1/4*ln(tanh(a+2*ln(x))+1)

________________________________________________________________________________________

Maxima [A]  time = 1.1484, size = 28, normalized size = 2. \begin{align*} \frac{1}{2} \, a - \frac{1}{e^{\left (-2 \, a - 4 \, \log \left (x\right )\right )} + 1} + \log \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B]  time = 1.97699, size = 68, normalized size = 4.86 \begin{align*} \frac{{\left (x^{4} e^{\left (2 \, a\right )} + 1\right )} \log \left (x\right ) + 1}{x^{4} e^{\left (2 \, a\right )} + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

((x^4*e^(2*a) + 1)*log(x) + 1)/(x^4*e^(2*a) + 1)

________________________________________________________________________________________

Sympy [A]  time = 0.499783, size = 12, normalized size = 0.86 \begin{align*} \log{\left (x \right )} - \frac{\tanh{\left (a + 2 \log{\left (x \right )} \right )}}{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(a+2*ln(x))**2/x,x)

[Out]

log(x) - tanh(a + 2*log(x))/2

________________________________________________________________________________________

Giac [A]  time = 1.4718, size = 26, normalized size = 1.86 \begin{align*} \frac{1}{x^{4} e^{\left (2 \, a\right )} + 1} + \frac{1}{4} \, \log \left (x^{4}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/(x^4*e^(2*a) + 1) + 1/4*log(x^4)