\(\int \frac {\tanh ^2(d (a+b \log (c x^n)))}{x} \, dx\) [183]

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

Optimal result

Integrand size = 19, antiderivative size = 28 \[ \int \frac {\tanh ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right )}{x} \, dx=\log (x)-\frac {\tanh \left (a d+b d \log \left (c x^n\right )\right )}{b d n} \]

[Out]

ln(x)-tanh(a*d+b*d*ln(c*x^n))/b/d/n

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 28, 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.105, Rules used = {3554, 8} \[ \int \frac {\tanh ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right )}{x} \, dx=\log (x)-\frac {\tanh \left (a d+b d \log \left (c x^n\right )\right )}{b d n} \]

[In]

Int[Tanh[d*(a + b*Log[c*x^n])]^2/x,x]

[Out]

Log[x] - Tanh[a*d + b*d*Log[c*x^n]]/(b*d*n)

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}& = \frac {\text {Subst}\left (\int \tanh ^2(d (a+b x)) \, dx,x,\log \left (c x^n\right )\right )}{n} \\ & = -\frac {\tanh \left (a d+b d \log \left (c x^n\right )\right )}{b d n}+\frac {\text {Subst}\left (\int 1 \, dx,x,\log \left (c x^n\right )\right )}{n} \\ & = \log (x)-\frac {\tanh \left (a d+b d \log \left (c x^n\right )\right )}{b d n} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.82 \[ \int \frac {\tanh ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right )}{x} \, dx=\frac {\text {arctanh}\left (\tanh \left (a d+b d \log \left (c x^n\right )\right )\right )}{b d n}-\frac {\tanh \left (a d+b d \log \left (c x^n\right )\right )}{b d n} \]

[In]

Integrate[Tanh[d*(a + b*Log[c*x^n])]^2/x,x]

[Out]

ArcTanh[Tanh[a*d + b*d*Log[c*x^n]]]/(b*d*n) - Tanh[a*d + b*d*Log[c*x^n]]/(b*d*n)

Maple [A] (verified)

Time = 0.10 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.18

method result size
parallelrisch \(-\frac {-\ln \left (x \right ) d b n +\tanh \left (d \left (a +b \ln \left (c \,x^{n}\right )\right )\right )}{d b n}\) \(33\)
derivativedivides \(\frac {-\tanh \left (d \left (a +b \ln \left (c \,x^{n}\right )\right )\right )-\frac {\ln \left (\tanh \left (d \left (a +b \ln \left (c \,x^{n}\right )\right )\right )-1\right )}{2}+\frac {\ln \left (\tanh \left (d \left (a +b \ln \left (c \,x^{n}\right )\right )\right )+1\right )}{2}}{n b d}\) \(63\)
default \(\frac {-\tanh \left (d \left (a +b \ln \left (c \,x^{n}\right )\right )\right )-\frac {\ln \left (\tanh \left (d \left (a +b \ln \left (c \,x^{n}\right )\right )\right )-1\right )}{2}+\frac {\ln \left (\tanh \left (d \left (a +b \ln \left (c \,x^{n}\right )\right )\right )+1\right )}{2}}{n b d}\) \(63\)
risch \(\ln \left (x \right )+\frac {2}{d b n \left (c^{2 b d} \left (x^{n}\right )^{2 b d} {\mathrm e}^{d \left (i b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}-i b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )-i b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}+i b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )+2 a \right )}+1\right )}\) \(125\)

[In]

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

[Out]

-(-ln(x)*d*b*n+tanh(d*(a+b*ln(c*x^n))))/d/b/n

Fricas [B] (verification not implemented)

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

Time = 0.25 (sec) , antiderivative size = 72, normalized size of antiderivative = 2.57 \[ \int \frac {\tanh ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right )}{x} \, dx=\frac {{\left (b d n \log \left (x\right ) + 1\right )} \cosh \left (b d n \log \left (x\right ) + b d \log \left (c\right ) + a d\right ) - \sinh \left (b d n \log \left (x\right ) + b d \log \left (c\right ) + a d\right )}{b d n \cosh \left (b d n \log \left (x\right ) + b d \log \left (c\right ) + a d\right )} \]

[In]

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

[Out]

((b*d*n*log(x) + 1)*cosh(b*d*n*log(x) + b*d*log(c) + a*d) - sinh(b*d*n*log(x) + b*d*log(c) + a*d))/(b*d*n*cosh
(b*d*n*log(x) + b*d*log(c) + a*d))

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 70 vs. \(2 (22) = 44\).

Time = 2.50 (sec) , antiderivative size = 70, normalized size of antiderivative = 2.50 \[ \int \frac {\tanh ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right )}{x} \, dx=- \frac {\log {\left (\tanh {\left (a d + b d \log {\left (c x^{n} \right )} \right )} - 1 \right )}}{2 b d n} + \frac {\log {\left (\tanh {\left (a d + b d \log {\left (c x^{n} \right )} \right )} + 1 \right )}}{2 b d n} - \frac {\tanh {\left (a d + b d \log {\left (c x^{n} \right )} \right )}}{b d n} \]

[In]

integrate(tanh(d*(a+b*ln(c*x**n)))**2/x,x)

[Out]

-log(tanh(a*d + b*d*log(c*x**n)) - 1)/(2*b*d*n) + log(tanh(a*d + b*d*log(c*x**n)) + 1)/(2*b*d*n) - tanh(a*d +
b*d*log(c*x**n))/(b*d*n)

Maxima [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.29 \[ \int \frac {\tanh ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right )}{x} \, dx=\frac {2}{b c^{2 \, b d} d n e^{\left (2 \, b d \log \left (x^{n}\right ) + 2 \, a d\right )} + b d n} + \log \left (x\right ) \]

[In]

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

[Out]

2/(b*c^(2*b*d)*d*n*e^(2*b*d*log(x^n) + 2*a*d) + b*d*n) + log(x)

Giac [A] (verification not implemented)

none

Time = 0.36 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.32 \[ \int \frac {\tanh ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right )}{x} \, dx=\frac {2}{{\left (c^{2 \, b d} x^{2 \, b d n} e^{\left (2 \, a d\right )} + 1\right )} b d n} + \log \left (x\right ) \]

[In]

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

[Out]

2/((c^(2*b*d)*x^(2*b*d*n)*e^(2*a*d) + 1)*b*d*n) + log(x)

Mupad [B] (verification not implemented)

Time = 1.69 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.21 \[ \int \frac {\tanh ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right )}{x} \, dx=\ln \left (x\right )+\frac {2}{b\,d\,n\,\left ({\mathrm {e}}^{2\,a\,d}\,{\left (c\,x^n\right )}^{2\,b\,d}+1\right )} \]

[In]

int(tanh(d*(a + b*log(c*x^n)))^2/x,x)

[Out]

log(x) + 2/(b*d*n*(exp(2*a*d)*(c*x^n)^(2*b*d) + 1))