3.3 \(\int \tanh ^4(a+b x) \, dx\)

Optimal. Leaf size=28 \[ -\frac{\tanh ^3(a+b x)}{3 b}-\frac{\tanh (a+b x)}{b}+x \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.015812, antiderivative size = 28, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 8, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {3473, 8} \[ -\frac{\tanh ^3(a+b x)}{3 b}-\frac{\tanh (a+b x)}{b}+x \]

Antiderivative was successfully verified.

[In]

Int[Tanh[a + b*x]^4,x]

[Out]

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

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 \tanh ^4(a+b x) \, dx &=-\frac{\tanh ^3(a+b x)}{3 b}+\int \tanh ^2(a+b x) \, dx\\ &=-\frac{\tanh (a+b x)}{b}-\frac{\tanh ^3(a+b x)}{3 b}+\int 1 \, dx\\ &=x-\frac{\tanh (a+b x)}{b}-\frac{\tanh ^3(a+b x)}{3 b}\\ \end{align*}

Mathematica [A]  time = 0.0089919, size = 38, normalized size = 1.36 \[ -\frac{\tanh ^3(a+b x)}{3 b}+\frac{\tanh ^{-1}(\tanh (a+b x))}{b}-\frac{\tanh (a+b x)}{b} \]

Antiderivative was successfully verified.

[In]

Integrate[Tanh[a + b*x]^4,x]

[Out]

ArcTanh[Tanh[a + b*x]]/b - Tanh[a + b*x]/b - Tanh[a + b*x]^3/(3*b)

________________________________________________________________________________________

Maple [B]  time = 0.003, size = 54, normalized size = 1.9 \begin{align*} -{\frac{ \left ( \tanh \left ( bx+a \right ) \right ) ^{3}}{3\,b}}-{\frac{\tanh \left ( bx+a \right ) }{b}}-{\frac{\ln \left ( -1+\tanh \left ( bx+a \right ) \right ) }{2\,b}}+{\frac{\ln \left ( 1+\tanh \left ( bx+a \right ) \right ) }{2\,b}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(b*x+a)^4,x)

[Out]

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

________________________________________________________________________________________

Maxima [B]  time = 1.05514, size = 96, normalized size = 3.43 \begin{align*} x + \frac{a}{b} - \frac{4 \,{\left (3 \, e^{\left (-2 \, b x - 2 \, a\right )} + 3 \, e^{\left (-4 \, b x - 4 \, a\right )} + 2\right )}}{3 \, b{\left (3 \, e^{\left (-2 \, b x - 2 \, a\right )} + 3 \, e^{\left (-4 \, b x - 4 \, a\right )} + e^{\left (-6 \, b x - 6 \, a\right )} + 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + a/b - 4/3*(3*e^(-2*b*x - 2*a) + 3*e^(-4*b*x - 4*a) + 2)/(b*(3*e^(-2*b*x - 2*a) + 3*e^(-4*b*x - 4*a) + e^(-
6*b*x - 6*a) + 1))

________________________________________________________________________________________

Fricas [B]  time = 2.08288, size = 327, normalized size = 11.68 \begin{align*} \frac{{\left (3 \, b x + 4\right )} \cosh \left (b x + a\right )^{3} + 3 \,{\left (3 \, b x + 4\right )} \cosh \left (b x + a\right ) \sinh \left (b x + a\right )^{2} - 12 \, \cosh \left (b x + a\right )^{2} \sinh \left (b x + a\right ) - 4 \, \sinh \left (b x + a\right )^{3} + 3 \,{\left (3 \, b x + 4\right )} \cosh \left (b x + a\right )}{3 \,{\left (b \cosh \left (b x + a\right )^{3} + 3 \, b \cosh \left (b x + a\right ) \sinh \left (b x + a\right )^{2} + 3 \, b \cosh \left (b x + a\right )\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/3*((3*b*x + 4)*cosh(b*x + a)^3 + 3*(3*b*x + 4)*cosh(b*x + a)*sinh(b*x + a)^2 - 12*cosh(b*x + a)^2*sinh(b*x +
 a) - 4*sinh(b*x + a)^3 + 3*(3*b*x + 4)*cosh(b*x + a))/(b*cosh(b*x + a)^3 + 3*b*cosh(b*x + a)*sinh(b*x + a)^2
+ 3*b*cosh(b*x + a))

________________________________________________________________________________________

Sympy [A]  time = 0.342054, size = 27, normalized size = 0.96 \begin{align*} \begin{cases} x - \frac{\tanh ^{3}{\left (a + b x \right )}}{3 b} - \frac{\tanh{\left (a + b x \right )}}{b} & \text{for}\: b \neq 0 \\x \tanh ^{4}{\left (a \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(b*x+a)**4,x)

[Out]

Piecewise((x - tanh(a + b*x)**3/(3*b) - tanh(a + b*x)/b, Ne(b, 0)), (x*tanh(a)**4, True))

________________________________________________________________________________________

Giac [A]  time = 1.19181, size = 70, normalized size = 2.5 \begin{align*} \frac{b x + a}{b} + \frac{4 \,{\left (3 \, e^{\left (4 \, b x + 4 \, a\right )} + 3 \, e^{\left (2 \, b x + 2 \, a\right )} + 2\right )}}{3 \, b{\left (e^{\left (2 \, b x + 2 \, a\right )} + 1\right )}^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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