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

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

Optimal result

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

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3554, 8} \[ \int \frac {\tanh ^2(a+2 \log (x))}{x} \, dx=\log (x)-\frac {1}{2} \tanh (a+2 \log (x)) \]

[In]

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

[Out]

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

Rule 8

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

Rule 3554

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]

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

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.71 \[ \int \frac {\tanh ^2(a+2 \log (x))}{x} \, dx=\frac {1}{2} \text {arctanh}(\tanh (a+2 \log (x)))-\frac {1}{2} \tanh (a+2 \log (x)) \]

[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 [A] (verified)

Time = 0.04 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.93

method result size
parallelrisch \(\ln \left (x \right )-\frac {\tanh \left (a +2 \ln \left (x \right )\right )}{2}\) \(13\)
risch \(\frac {1}{1+{\mathrm e}^{2 a} x^{4}}+\ln \left (x \right )\) \(16\)
derivativedivides \(-\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}\) \(35\)
default \(-\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}\) \(35\)

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 28 vs. \(2 (12) = 24\).

Time = 0.24 (sec) , antiderivative size = 28, normalized size of antiderivative = 2.00 \[ \int \frac {\tanh ^2(a+2 \log (x))}{x} \, dx=\frac {{\left (x^{4} e^{\left (2 \, a\right )} + 1\right )} \log \left (x\right ) + 1}{x^{4} e^{\left (2 \, a\right )} + 1} \]

[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] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.86 \[ \int \frac {\tanh ^2(a+2 \log (x))}{x} \, dx=\log {\left (x \right )} - \frac {\tanh {\left (a + 2 \log {\left (x \right )} \right )}}{2} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.50 \[ \int \frac {\tanh ^2(a+2 \log (x))}{x} \, dx=\frac {1}{2} \, a - \frac {1}{e^{\left (-2 \, a - 4 \, \log \left (x\right )\right )} + 1} + \log \left (x\right ) \]

[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)

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.36 \[ \int \frac {\tanh ^2(a+2 \log (x))}{x} \, dx=\frac {1}{x^{4} e^{\left (2 \, a\right )} + 1} + \frac {1}{4} \, \log \left (x^{4}\right ) \]

[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)

Mupad [B] (verification not implemented)

Time = 1.69 (sec) , antiderivative size = 28, normalized size of antiderivative = 2.00 \[ \int \frac {\tanh ^2(a+2 \log (x))}{x} \, dx=\ln \left (x\right )-\frac {x^4\,{\mathrm {e}}^{2\,a}-1}{2\,\left ({\mathrm {e}}^{2\,a}\,x^4+1\right )} \]

[In]

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

[Out]

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