3.186 \(\int \frac {\tanh ^3(a+b \log (c x^n))}{x} \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 43, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {3473, 3475} \[ \frac {\log \left (\cosh \left (a+b \log \left (c x^n\right )\right )\right )}{b n}-\frac {\tanh ^2\left (a+b \log \left (c x^n\right )\right )}{2 b n} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

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 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.15, size = 43, normalized size = 1.00 \[ \frac {\log \left (\cosh \left (a+b \log \left (c x^n\right )\right )\right )}{b n}-\frac {\tanh ^2\left (a+b \log \left (c x^n\right )\right )}{2 b n} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [B]  time = 0.64, size = 566, normalized size = 13.16 \[ -\frac {b n \cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{4} \log \relax (x) + 4 \, b n \cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right ) \log \relax (x) \sinh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{3} + b n \log \relax (x) \sinh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{4} + 2 \, {\left (b n \log \relax (x) - 1\right )} \cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{2} + b n \log \relax (x) + 2 \, {\left (3 \, b n \cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{2} \log \relax (x) + b n \log \relax (x) - 1\right )} \sinh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{2} - {\left (\cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{4} + 4 \, \cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right ) \sinh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{3} + \sinh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{4} + 2 \, {\left (3 \, \cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{2} + 1\right )} \sinh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{2} + 2 \, \cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{2} + 4 \, {\left (\cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{3} + \cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right )\right )} \sinh \left (b n \log \relax (x) + b \log \relax (c) + a\right ) + 1\right )} \log \left (\frac {2 \, \cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right )}{\cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right ) - \sinh \left (b n \log \relax (x) + b \log \relax (c) + a\right )}\right ) + 4 \, {\left (b n \cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{3} \log \relax (x) + {\left (b n \log \relax (x) - 1\right )} \cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right )\right )} \sinh \left (b n \log \relax (x) + b \log \relax (c) + a\right )}{b n \cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{4} + 4 \, b n \cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right ) \sinh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{3} + b n \sinh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{4} + 2 \, b n \cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{2} + 2 \, {\left (3 \, b n \cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{2} + b n\right )} \sinh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{2} + b n + 4 \, {\left (b n \cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{3} + b n \cosh \left (b n \log \relax (x) + b \log \relax (c) + a\right )\right )} \sinh \left (b n \log \relax (x) + b \log \relax (c) + a\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [B]  time = 0.36, size = 127, normalized size = 2.95 \[ \frac {\log \left (\sqrt {2 \, x^{2 \, b n} {\left | c \right |}^{2 \, b} \cos \left (\pi b \mathrm {sgn}\relax (c) - \pi b\right ) e^{\left (2 \, a\right )} + x^{4 \, b n} {\left | c \right |}^{4 \, b} e^{\left (4 \, a\right )} + 1}\right )}{b n} - \frac {3 \, c^{4 \, b} x^{4 \, b n} e^{\left (4 \, a\right )} + 2 \, c^{2 \, b} x^{2 \, b n} e^{\left (2 \, a\right )} + 3}{2 \, {\left (c^{2 \, b} x^{2 \, b n} e^{\left (2 \, a\right )} + 1\right )}^{2} b n} - \log \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(sqrt(2*x^(2*b*n)*abs(c)^(2*b)*cos(pi*b*sgn(c) - pi*b)*e^(2*a) + x^(4*b*n)*abs(c)^(4*b)*e^(4*a) + 1))/(b*n)
 - 1/2*(3*c^(4*b)*x^(4*b*n)*e^(4*a) + 2*c^(2*b)*x^(2*b*n)*e^(2*a) + 3)/((c^(2*b)*x^(2*b*n)*e^(2*a) + 1)^2*b*n)
 - log(x)

________________________________________________________________________________________

maple [A]  time = 0.02, size = 67, normalized size = 1.56 \[ -\frac {\tanh ^{2}\left (a +b \ln \left (c \,x^{n}\right )\right )}{2 b n}-\frac {\ln \left (\tanh \left (a +b \ln \left (c \,x^{n}\right )\right )-1\right )}{2 n b}-\frac {\ln \left (\tanh \left (a +b \ln \left (c \,x^{n}\right )\right )+1\right )}{2 n b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(a+b*ln(c*x^n))^3/x,x)

[Out]

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

________________________________________________________________________________________

maxima [B]  time = 0.51, size = 304, normalized size = 7.07 \[ \frac {4 \, c^{2 \, b} e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + 3}{4 \, {\left (b c^{4 \, b} n e^{\left (4 \, b \log \left (x^{n}\right ) + 4 \, a\right )} + 2 \, b c^{2 \, b} n e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + b n\right )}} - \frac {2 \, c^{2 \, b} e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + 3}{4 \, {\left (b c^{4 \, b} n e^{\left (4 \, b \log \left (x^{n}\right ) + 4 \, a\right )} + 2 \, b c^{2 \, b} n e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + b n\right )}} + \frac {3 \, {\left (2 \, c^{2 \, b} e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + 1\right )}}{4 \, {\left (b c^{4 \, b} n e^{\left (4 \, b \log \left (x^{n}\right ) + 4 \, a\right )} + 2 \, b c^{2 \, b} n e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + b n\right )}} - \frac {3}{4 \, {\left (b c^{4 \, b} n e^{\left (4 \, b \log \left (x^{n}\right ) + 4 \, a\right )} + 2 \, b c^{2 \, b} n e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + b n\right )}} + \frac {\log \left (\frac {{\left (c^{2 \, b} e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + 1\right )} e^{\left (-2 \, a\right )}}{c^{2 \, b}}\right )}{b n} - \log \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 1.07, size = 94, normalized size = 2.19 \[ \frac {2}{b\,n+b\,n\,{\mathrm {e}}^{2\,a}\,{\left (c\,x^n\right )}^{2\,b}}-\ln \relax (x)-\frac {2}{b\,n+2\,b\,n\,{\mathrm {e}}^{2\,a}\,{\left (c\,x^n\right )}^{2\,b}+b\,n\,{\mathrm {e}}^{4\,a}\,{\left (c\,x^n\right )}^{4\,b}}+\frac {\ln \left ({\mathrm {e}}^{2\,a}\,{\left (c\,x^n\right )}^{2\,b}+1\right )}{b\,n} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 3.71, size = 75, normalized size = 1.74 \[ \begin {cases} \log {\relax (x )} \tanh ^{3}{\relax (a )} & \text {for}\: b = 0 \wedge n = 0 \\\log {\relax (x )} \tanh ^{3}{\left (a + b \log {\relax (c )} \right )} & \text {for}\: n = 0 \\\log {\relax (x )} \tanh ^{3}{\relax (a )} & \text {for}\: b = 0 \\\log {\relax (x )} - \frac {\log {\left (\tanh {\left (a + b n \log {\relax (x )} + b \log {\relax (c )} \right )} + 1 \right )}}{b n} - \frac {\tanh ^{2}{\left (a + b n \log {\relax (x )} + b \log {\relax (c )} \right )}}{2 b n} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Piecewise((log(x)*tanh(a)**3, Eq(b, 0) & Eq(n, 0)), (log(x)*tanh(a + b*log(c))**3, Eq(n, 0)), (log(x)*tanh(a)*
*3, Eq(b, 0)), (log(x) - log(tanh(a + b*n*log(x) + b*log(c)) + 1)/(b*n) - tanh(a + b*n*log(x) + b*log(c))**2/(
2*b*n), True))

________________________________________________________________________________________