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

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

Optimal result

Integrand size = 17, antiderivative size = 45 \[ \int \frac {\tanh ^4\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\log (x)-\frac {\tanh \left (a+b \log \left (c x^n\right )\right )}{b n}-\frac {\tanh ^3\left (a+b \log \left (c x^n\right )\right )}{3 b n} \] Output:

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

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.38 \[ \int \frac {\tanh ^4\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {\text {arctanh}\left (\tanh \left (a+b \log \left (c x^n\right )\right )\right )}{b n}-\frac {\tanh \left (a+b \log \left (c x^n\right )\right )}{b n}-\frac {\tanh ^3\left (a+b \log \left (c x^n\right )\right )}{3 b n} \] Input:

Integrate[Tanh[a + b*Log[c*x^n]]^4/x,x]
 

Output:

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

Rubi [A] (verified)

Time = 0.33 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.04, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.471, Rules used = {3039, 3042, 3954, 25, 3042, 25, 3954, 24}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\tanh ^4\left (a+b \log \left (c x^n\right )\right )}{x} \, dx\)

\(\Big \downarrow \) 3039

\(\displaystyle \frac {\int \tanh ^4\left (a+b \log \left (c x^n\right )\right )d\log \left (c x^n\right )}{n}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int \tan \left (i a+i b \log \left (c x^n\right )\right )^4d\log \left (c x^n\right )}{n}\)

\(\Big \downarrow \) 3954

\(\displaystyle \frac {-\int -\tanh ^2\left (a+b \log \left (c x^n\right )\right )d\log \left (c x^n\right )-\frac {\tanh ^3\left (a+b \log \left (c x^n\right )\right )}{3 b}}{n}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\int \tanh ^2\left (a+b \log \left (c x^n\right )\right )d\log \left (c x^n\right )-\frac {\tanh ^3\left (a+b \log \left (c x^n\right )\right )}{3 b}}{n}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {-\frac {\tanh ^3\left (a+b \log \left (c x^n\right )\right )}{3 b}+\int -\tan \left (i a+i b \log \left (c x^n\right )\right )^2d\log \left (c x^n\right )}{n}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {-\frac {\tanh ^3\left (a+b \log \left (c x^n\right )\right )}{3 b}-\int \tan \left (i a+i b \log \left (c x^n\right )\right )^2d\log \left (c x^n\right )}{n}\)

\(\Big \downarrow \) 3954

\(\displaystyle \frac {\int 1d\log \left (c x^n\right )-\frac {\tanh ^3\left (a+b \log \left (c x^n\right )\right )}{3 b}-\frac {\tanh \left (a+b \log \left (c x^n\right )\right )}{b}}{n}\)

\(\Big \downarrow \) 24

\(\displaystyle \frac {-\frac {\tanh ^3\left (a+b \log \left (c x^n\right )\right )}{3 b}-\frac {\tanh \left (a+b \log \left (c x^n\right )\right )}{b}+\log \left (c x^n\right )}{n}\)

Input:

Int[Tanh[a + b*Log[c*x^n]]^4/x,x]
 

Output:

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

Defintions of rubi rules used

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

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 3039
Int[u_, x_Symbol] :> With[{lst = FunctionOfLog[Cancel[x*u], x]}, Simp[1/lst 
[[3]]   Subst[Int[lst[[1]], x], x, Log[lst[[2]]]], x] /;  !FalseQ[lst]] /; 
NonsumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

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

Time = 0.83 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.93

method result size
parallelrisch \(-\frac {-3 \ln \left (x \right ) b n +{\tanh \left (a +b \ln \left (c \,x^{n}\right )\right )}^{3}+3 \tanh \left (a +b \ln \left (c \,x^{n}\right )\right )}{3 n b}\) \(42\)
derivativedivides \(\frac {-\frac {{\tanh \left (a +b \ln \left (c \,x^{n}\right )\right )}^{3}}{3}-\tanh \left (a +b \ln \left (c \,x^{n}\right )\right )-\frac {\ln \left (\tanh \left (a +b \ln \left (c \,x^{n}\right )\right )-1\right )}{2}+\frac {\ln \left (\tanh \left (a +b \ln \left (c \,x^{n}\right )\right )+1\right )}{2}}{n b}\) \(69\)
default \(\frac {-\frac {{\tanh \left (a +b \ln \left (c \,x^{n}\right )\right )}^{3}}{3}-\tanh \left (a +b \ln \left (c \,x^{n}\right )\right )-\frac {\ln \left (\tanh \left (a +b \ln \left (c \,x^{n}\right )\right )-1\right )}{2}+\frac {\ln \left (\tanh \left (a +b \ln \left (c \,x^{n}\right )\right )+1\right )}{2}}{n b}\) \(69\)
risch \(\ln \left (x \right )+\frac {4 \left (x^{n}\right )^{4 b} c^{4 b} {\mathrm e}^{4 a} {\mathrm e}^{-2 i b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}} {\mathrm e}^{2 i b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )} {\mathrm e}^{2 i b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}} {\mathrm e}^{-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 )}+4 \left (x^{n}\right )^{2 b} c^{2 b} {\mathrm e}^{2 a} {\mathrm e}^{i b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}} {\mathrm e}^{-i b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )} {\mathrm e}^{-i b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}} {\mathrm e}^{i b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )}+\frac {8}{3}}{b n {\left (\left (x^{n}\right )^{2 b} c^{2 b} {\mathrm e}^{2 a} {\mathrm e}^{i b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}} {\mathrm e}^{-i b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )} {\mathrm e}^{-i b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}} {\mathrm e}^{i b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )}+1\right )}^{3}}\) \(329\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 194 vs. \(2 (43) = 86\).

Time = 0.09 (sec) , antiderivative size = 194, normalized size of antiderivative = 4.31 \[ \int \frac {\tanh ^4\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {{\left (3 \, b n \log \left (x\right ) + 4\right )} \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{3} + 3 \, {\left (3 \, b n \log \left (x\right ) + 4\right )} \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) \sinh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{2} - 12 \, \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{2} \sinh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) - 4 \, \sinh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{3} + 3 \, {\left (3 \, b n \log \left (x\right ) + 4\right )} \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )}{3 \, {\left (b n \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{3} + 3 \, b n \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) \sinh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{2} + 3 \, b n \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )\right )}} \] Input:

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

Output:

1/3*((3*b*n*log(x) + 4)*cosh(b*n*log(x) + b*log(c) + a)^3 + 3*(3*b*n*log(x 
) + 4)*cosh(b*n*log(x) + b*log(c) + a)*sinh(b*n*log(x) + b*log(c) + a)^2 - 
 12*cosh(b*n*log(x) + b*log(c) + a)^2*sinh(b*n*log(x) + b*log(c) + a) - 4* 
sinh(b*n*log(x) + b*log(c) + a)^3 + 3*(3*b*n*log(x) + 4)*cosh(b*n*log(x) + 
 b*log(c) + a))/(b*n*cosh(b*n*log(x) + b*log(c) + a)^3 + 3*b*n*cosh(b*n*lo 
g(x) + b*log(c) + a)*sinh(b*n*log(x) + b*log(c) + a)^2 + 3*b*n*cosh(b*n*lo 
g(x) + b*log(c) + a))
 

Sympy [A] (verification not implemented)

Time = 1.67 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.44 \[ \int \frac {\tanh ^4\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\begin {cases} \log {\left (x \right )} \tanh ^{4}{\left (a \right )} & \text {for}\: b = 0 \wedge \left (b = 0 \vee n = 0\right ) \\\log {\left (x \right )} \tanh ^{4}{\left (a + b \log {\left (c \right )} \right )} & \text {for}\: n = 0 \\\frac {\log {\left (c x^{n} \right )}}{n} - \frac {\tanh ^{3}{\left (a + b \log {\left (c x^{n} \right )} \right )}}{3 b n} - \frac {\tanh {\left (a + b \log {\left (c x^{n} \right )} \right )}}{b n} & \text {otherwise} \end {cases} \] Input:

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

Output:

Piecewise((log(x)*tanh(a)**4, Eq(b, 0) & (Eq(b, 0) | Eq(n, 0))), (log(x)*t 
anh(a + b*log(c))**4, Eq(n, 0)), (log(c*x**n)/n - tanh(a + b*log(c*x**n))* 
*3/(3*b*n) - tanh(a + b*log(c*x**n))/(b*n), True))
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 494 vs. \(2 (43) = 86\).

Time = 0.13 (sec) , antiderivative size = 494, normalized size of antiderivative = 10.98 \[ \int \frac {\tanh ^4\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {18 \, c^{4 \, b} e^{\left (4 \, b \log \left (x^{n}\right ) + 4 \, a\right )} + 27 \, c^{2 \, b} e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + 11}{12 \, {\left (b c^{6 \, b} n e^{\left (6 \, b \log \left (x^{n}\right ) + 6 \, a\right )} + 3 \, b c^{4 \, b} n e^{\left (4 \, b \log \left (x^{n}\right ) + 4 \, a\right )} + 3 \, b c^{2 \, b} n e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + b n\right )}} + \frac {6 \, c^{4 \, b} e^{\left (4 \, b \log \left (x^{n}\right ) + 4 \, a\right )} + 15 \, c^{2 \, b} e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + 11}{12 \, {\left (b c^{6 \, b} n e^{\left (6 \, b \log \left (x^{n}\right ) + 6 \, a\right )} + 3 \, b c^{4 \, b} n e^{\left (4 \, b \log \left (x^{n}\right ) + 4 \, a\right )} + 3 \, b c^{2 \, b} n e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + b n\right )}} + \frac {2 \, {\left (3 \, c^{4 \, b} e^{\left (4 \, b \log \left (x^{n}\right ) + 4 \, a\right )} + 3 \, c^{2 \, b} e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + 1\right )}}{3 \, {\left (b c^{6 \, b} n e^{\left (6 \, b \log \left (x^{n}\right ) + 6 \, a\right )} + 3 \, b c^{4 \, b} n e^{\left (4 \, b \log \left (x^{n}\right ) + 4 \, a\right )} + 3 \, b c^{2 \, b} n e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + b n\right )}} - \frac {3 \, c^{2 \, b} e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + 1}{2 \, {\left (b c^{6 \, b} n e^{\left (6 \, b \log \left (x^{n}\right ) + 6 \, a\right )} + 3 \, b c^{4 \, b} n e^{\left (4 \, b \log \left (x^{n}\right ) + 4 \, a\right )} + 3 \, b c^{2 \, b} n e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + b n\right )}} + \frac {2}{3 \, {\left (b c^{6 \, b} n e^{\left (6 \, b \log \left (x^{n}\right ) + 6 \, a\right )} + 3 \, b c^{4 \, b} n e^{\left (4 \, b \log \left (x^{n}\right ) + 4 \, a\right )} + 3 \, b c^{2 \, b} n e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + b n\right )}} + \log \left (x\right ) \] Input:

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

Output:

1/12*(18*c^(4*b)*e^(4*b*log(x^n) + 4*a) + 27*c^(2*b)*e^(2*b*log(x^n) + 2*a 
) + 11)/(b*c^(6*b)*n*e^(6*b*log(x^n) + 6*a) + 3*b*c^(4*b)*n*e^(4*b*log(x^n 
) + 4*a) + 3*b*c^(2*b)*n*e^(2*b*log(x^n) + 2*a) + b*n) + 1/12*(6*c^(4*b)*e 
^(4*b*log(x^n) + 4*a) + 15*c^(2*b)*e^(2*b*log(x^n) + 2*a) + 11)/(b*c^(6*b) 
*n*e^(6*b*log(x^n) + 6*a) + 3*b*c^(4*b)*n*e^(4*b*log(x^n) + 4*a) + 3*b*c^( 
2*b)*n*e^(2*b*log(x^n) + 2*a) + b*n) + 2/3*(3*c^(4*b)*e^(4*b*log(x^n) + 4* 
a) + 3*c^(2*b)*e^(2*b*log(x^n) + 2*a) + 1)/(b*c^(6*b)*n*e^(6*b*log(x^n) + 
6*a) + 3*b*c^(4*b)*n*e^(4*b*log(x^n) + 4*a) + 3*b*c^(2*b)*n*e^(2*b*log(x^n 
) + 2*a) + b*n) - 1/2*(3*c^(2*b)*e^(2*b*log(x^n) + 2*a) + 1)/(b*c^(6*b)*n* 
e^(6*b*log(x^n) + 6*a) + 3*b*c^(4*b)*n*e^(4*b*log(x^n) + 4*a) + 3*b*c^(2*b 
)*n*e^(2*b*log(x^n) + 2*a) + b*n) + 2/3/(b*c^(6*b)*n*e^(6*b*log(x^n) + 6*a 
) + 3*b*c^(4*b)*n*e^(4*b*log(x^n) + 4*a) + 3*b*c^(2*b)*n*e^(2*b*log(x^n) + 
 2*a) + b*n) + log(x)
 

Giac [A] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.73 \[ \int \frac {\tanh ^4\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {\log \left (x^{b n}\right )}{b n} + \frac {4 \, {\left (3 \, c^{4 \, b} x^{4 \, b n} e^{\left (4 \, a\right )} + 3 \, c^{2 \, b} x^{2 \, b n} e^{\left (2 \, a\right )} + 2\right )}}{3 \, {\left (c^{2 \, b} x^{2 \, b n} e^{\left (2 \, a\right )} + 1\right )}^{3} b n} \] Input:

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

Output:

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

Mupad [B] (verification not implemented)

Time = 2.30 (sec) , antiderivative size = 162, normalized size of antiderivative = 3.60 \[ \int \frac {\tanh ^4\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\ln \left (x\right )+\frac {\frac {4}{3\,b\,n}+\frac {4\,{\mathrm {e}}^{4\,a}\,{\left (c\,x^n\right )}^{4\,b}}{3\,b\,n}}{3\,{\mathrm {e}}^{2\,a}\,{\left (c\,x^n\right )}^{2\,b}+3\,{\mathrm {e}}^{4\,a}\,{\left (c\,x^n\right )}^{4\,b}+{\mathrm {e}}^{6\,a}\,{\left (c\,x^n\right )}^{6\,b}+1}+\frac {4}{3\,b\,n\,\left ({\mathrm {e}}^{2\,a}\,{\left (c\,x^n\right )}^{2\,b}+1\right )}+\frac {4\,{\mathrm {e}}^{2\,a}\,{\left (c\,x^n\right )}^{2\,b}}{3\,b\,n\,\left (2\,{\mathrm {e}}^{2\,a}\,{\left (c\,x^n\right )}^{2\,b}+{\mathrm {e}}^{4\,a}\,{\left (c\,x^n\right )}^{4\,b}+1\right )} \] Input:

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

Output:

log(x) + (4/(3*b*n) + (4*exp(4*a)*(c*x^n)^(4*b))/(3*b*n))/(3*exp(2*a)*(c*x 
^n)^(2*b) + 3*exp(4*a)*(c*x^n)^(4*b) + exp(6*a)*(c*x^n)^(6*b) + 1) + 4/(3* 
b*n*(exp(2*a)*(c*x^n)^(2*b) + 1)) + (4*exp(2*a)*(c*x^n)^(2*b))/(3*b*n*(2*e 
xp(2*a)*(c*x^n)^(2*b) + exp(4*a)*(c*x^n)^(4*b) + 1))
 

Reduce [B] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.02 \[ \int \frac {\tanh ^4\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {3 \,\mathrm {log}\left (x^{n} c \right ) b -{\tanh \left (\mathrm {log}\left (x^{n} c \right ) b +a \right )}^{3}-3 \tanh \left (\mathrm {log}\left (x^{n} c \right ) b +a \right )}{3 b n} \] Input:

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

Output:

(3*log(x**n*c)*b - tanh(log(x**n*c)*b + a)**3 - 3*tanh(log(x**n*c)*b + a)) 
/(3*b*n)