Integrand size = 21, antiderivative size = 54 \[ \int \tanh ^4(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=(a+b) x-\frac {(a+b) \tanh (c+d x)}{d}-\frac {(a+b) \tanh ^3(c+d x)}{3 d}-\frac {b \tanh ^5(c+d x)}{5 d} \] Output:
(a+b)*x-(a+b)*tanh(d*x+c)/d-1/3*(a+b)*tanh(d*x+c)^3/d-1/5*b*tanh(d*x+c)^5/ d
Time = 0.04 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.80 \[ \int \tanh ^4(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {a \text {arctanh}(\tanh (c+d x))}{d}+\frac {b \text {arctanh}(\tanh (c+d x))}{d}-\frac {a \tanh (c+d x)}{d}-\frac {b \tanh (c+d x)}{d}-\frac {a \tanh ^3(c+d x)}{3 d}-\frac {b \tanh ^3(c+d x)}{3 d}-\frac {b \tanh ^5(c+d x)}{5 d} \] Input:
Integrate[Tanh[c + d*x]^4*(a + b*Tanh[c + d*x]^2),x]
Output:
(a*ArcTanh[Tanh[c + d*x]])/d + (b*ArcTanh[Tanh[c + d*x]])/d - (a*Tanh[c + d*x])/d - (b*Tanh[c + d*x])/d - (a*Tanh[c + d*x]^3)/(3*d) - (b*Tanh[c + d* x]^3)/(3*d) - (b*Tanh[c + d*x]^5)/(5*d)
Time = 0.62 (sec) , antiderivative size = 49, normalized size of antiderivative = 0.91, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {3042, 4114, 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 \tanh ^4(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \tan (i c+i d x)^4 \left (a-b \tan (i c+i d x)^2\right )dx\) |
\(\Big \downarrow \) 4114 |
\(\displaystyle (a+b) \int \tanh ^4(c+d x)dx-\frac {b \tanh ^5(c+d x)}{5 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {b \tanh ^5(c+d x)}{5 d}+(a+b) \int \tan (i c+i d x)^4dx\) |
\(\Big \downarrow \) 3954 |
\(\displaystyle (a+b) \left (-\int -\tanh ^2(c+d x)dx-\frac {\tanh ^3(c+d x)}{3 d}\right )-\frac {b \tanh ^5(c+d x)}{5 d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle (a+b) \left (\int \tanh ^2(c+d x)dx-\frac {\tanh ^3(c+d x)}{3 d}\right )-\frac {b \tanh ^5(c+d x)}{5 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {b \tanh ^5(c+d x)}{5 d}+(a+b) \left (-\frac {\tanh ^3(c+d x)}{3 d}+\int -\tan (i c+i d x)^2dx\right )\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\frac {b \tanh ^5(c+d x)}{5 d}+(a+b) \left (-\frac {\tanh ^3(c+d x)}{3 d}-\int \tan (i c+i d x)^2dx\right )\) |
\(\Big \downarrow \) 3954 |
\(\displaystyle (a+b) \left (\int 1dx-\frac {\tanh ^3(c+d x)}{3 d}-\frac {\tanh (c+d x)}{d}\right )-\frac {b \tanh ^5(c+d x)}{5 d}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle (a+b) \left (-\frac {\tanh ^3(c+d x)}{3 d}-\frac {\tanh (c+d x)}{d}+x\right )-\frac {b \tanh ^5(c+d x)}{5 d}\) |
Input:
Int[Tanh[c + d*x]^4*(a + b*Tanh[c + d*x]^2),x]
Output:
-1/5*(b*Tanh[c + d*x]^5)/d + (a + b)*(x - Tanh[c + d*x]/d - Tanh[c + d*x]^ 3/(3*d))
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]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[C*((a + b*Tan[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Simp[(A - C) Int[(a + b*Tan[e + f*x])^m, x], x] /; FreeQ[{a , b, e, f, A, C, m}, x] && NeQ[A*b^2 + a^2*C, 0] && !LeQ[m, -1]
Time = 0.30 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.26
method | result | size |
parallelrisch | \(-\frac {3 \tanh \left (d x +c \right )^{5} b +5 \tanh \left (d x +c \right )^{3} a +5 b \tanh \left (d x +c \right )^{3}-15 d x a -15 d x b +15 a \tanh \left (d x +c \right )+15 b \tanh \left (d x +c \right )}{15 d}\) | \(68\) |
derivativedivides | \(\frac {-\frac {\tanh \left (d x +c \right )^{5} b}{5}-\frac {\tanh \left (d x +c \right )^{3} a}{3}-\frac {b \tanh \left (d x +c \right )^{3}}{3}-a \tanh \left (d x +c \right )-b \tanh \left (d x +c \right )-\frac {\left (a +b \right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}+\frac {\left (a +b \right ) \ln \left (\tanh \left (d x +c \right )+1\right )}{2}}{d}\) | \(85\) |
default | \(\frac {-\frac {\tanh \left (d x +c \right )^{5} b}{5}-\frac {\tanh \left (d x +c \right )^{3} a}{3}-\frac {b \tanh \left (d x +c \right )^{3}}{3}-a \tanh \left (d x +c \right )-b \tanh \left (d x +c \right )-\frac {\left (a +b \right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}+\frac {\left (a +b \right ) \ln \left (\tanh \left (d x +c \right )+1\right )}{2}}{d}\) | \(85\) |
parts | \(\frac {a \left (-\frac {\tanh \left (d x +c \right )^{3}}{3}-\tanh \left (d x +c \right )-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2}+\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2}\right )}{d}+\frac {b \left (-\frac {\tanh \left (d x +c \right )^{5}}{5}-\frac {\tanh \left (d x +c \right )^{3}}{3}-\tanh \left (d x +c \right )-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2}+\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2}\right )}{d}\) | \(104\) |
risch | \(a x +b x +\frac {4 \,{\mathrm e}^{8 d x +8 c} a +6 \,{\mathrm e}^{8 d x +8 c} b +12 \,{\mathrm e}^{6 d x +6 c} a +12 \,{\mathrm e}^{6 d x +6 c} b +\frac {44 \,{\mathrm e}^{4 d x +4 c} a}{3}+\frac {56 b \,{\mathrm e}^{4 d x +4 c}}{3}+\frac {28 \,{\mathrm e}^{2 d x +2 c} a}{3}+\frac {28 \,{\mathrm e}^{2 d x +2 c} b}{3}+\frac {8 a}{3}+\frac {46 b}{15}}{d \left ({\mathrm e}^{2 d x +2 c}+1\right )^{5}}\) | \(129\) |
Input:
int(tanh(d*x+c)^4*(a+tanh(d*x+c)^2*b),x,method=_RETURNVERBOSE)
Output:
-1/15*(3*tanh(d*x+c)^5*b+5*tanh(d*x+c)^3*a+5*b*tanh(d*x+c)^3-15*d*x*a-15*d *x*b+15*a*tanh(d*x+c)+15*b*tanh(d*x+c))/d
Leaf count of result is larger than twice the leaf count of optimal. 339 vs. \(2 (50) = 100\).
Time = 0.09 (sec) , antiderivative size = 339, normalized size of antiderivative = 6.28 \[ \int \tanh ^4(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {{\left (15 \, {\left (a + b\right )} d x + 20 \, a + 23 \, b\right )} \cosh \left (d x + c\right )^{5} + 5 \, {\left (15 \, {\left (a + b\right )} d x + 20 \, a + 23 \, b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{4} - {\left (20 \, a + 23 \, b\right )} \sinh \left (d x + c\right )^{5} + 5 \, {\left (15 \, {\left (a + b\right )} d x + 20 \, a + 23 \, b\right )} \cosh \left (d x + c\right )^{3} - 5 \, {\left (2 \, {\left (20 \, a + 23 \, b\right )} \cosh \left (d x + c\right )^{2} + 8 \, a + 5 \, b\right )} \sinh \left (d x + c\right )^{3} + 5 \, {\left (2 \, {\left (15 \, {\left (a + b\right )} d x + 20 \, a + 23 \, b\right )} \cosh \left (d x + c\right )^{3} + 3 \, {\left (15 \, {\left (a + b\right )} d x + 20 \, a + 23 \, b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )^{2} + 10 \, {\left (15 \, {\left (a + b\right )} d x + 20 \, a + 23 \, b\right )} \cosh \left (d x + c\right ) - 5 \, {\left ({\left (20 \, a + 23 \, b\right )} \cosh \left (d x + c\right )^{4} + 3 \, {\left (8 \, a + 5 \, b\right )} \cosh \left (d x + c\right )^{2} + 4 \, a + 10 \, b\right )} \sinh \left (d x + c\right )}{15 \, {\left (d \cosh \left (d x + c\right )^{5} + 5 \, d \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{4} + 5 \, d \cosh \left (d x + c\right )^{3} + 5 \, {\left (2 \, d \cosh \left (d x + c\right )^{3} + 3 \, d \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )^{2} + 10 \, d \cosh \left (d x + c\right )\right )}} \] Input:
integrate(tanh(d*x+c)^4*(a+b*tanh(d*x+c)^2),x, algorithm="fricas")
Output:
1/15*((15*(a + b)*d*x + 20*a + 23*b)*cosh(d*x + c)^5 + 5*(15*(a + b)*d*x + 20*a + 23*b)*cosh(d*x + c)*sinh(d*x + c)^4 - (20*a + 23*b)*sinh(d*x + c)^ 5 + 5*(15*(a + b)*d*x + 20*a + 23*b)*cosh(d*x + c)^3 - 5*(2*(20*a + 23*b)* cosh(d*x + c)^2 + 8*a + 5*b)*sinh(d*x + c)^3 + 5*(2*(15*(a + b)*d*x + 20*a + 23*b)*cosh(d*x + c)^3 + 3*(15*(a + b)*d*x + 20*a + 23*b)*cosh(d*x + c)) *sinh(d*x + c)^2 + 10*(15*(a + b)*d*x + 20*a + 23*b)*cosh(d*x + c) - 5*((2 0*a + 23*b)*cosh(d*x + c)^4 + 3*(8*a + 5*b)*cosh(d*x + c)^2 + 4*a + 10*b)* sinh(d*x + c))/(d*cosh(d*x + c)^5 + 5*d*cosh(d*x + c)*sinh(d*x + c)^4 + 5* d*cosh(d*x + c)^3 + 5*(2*d*cosh(d*x + c)^3 + 3*d*cosh(d*x + c))*sinh(d*x + c)^2 + 10*d*cosh(d*x + c))
Time = 0.14 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.52 \[ \int \tanh ^4(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\begin {cases} a x - \frac {a \tanh ^{3}{\left (c + d x \right )}}{3 d} - \frac {a \tanh {\left (c + d x \right )}}{d} + b x - \frac {b \tanh ^{5}{\left (c + d x \right )}}{5 d} - \frac {b \tanh ^{3}{\left (c + d x \right )}}{3 d} - \frac {b \tanh {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \tanh ^{2}{\left (c \right )}\right ) \tanh ^{4}{\left (c \right )} & \text {otherwise} \end {cases} \] Input:
integrate(tanh(d*x+c)**4*(a+b*tanh(d*x+c)**2),x)
Output:
Piecewise((a*x - a*tanh(c + d*x)**3/(3*d) - a*tanh(c + d*x)/d + b*x - b*ta nh(c + d*x)**5/(5*d) - b*tanh(c + d*x)**3/(3*d) - b*tanh(c + d*x)/d, Ne(d, 0)), (x*(a + b*tanh(c)**2)*tanh(c)**4, True))
Leaf count of result is larger than twice the leaf count of optimal. 199 vs. \(2 (50) = 100\).
Time = 0.04 (sec) , antiderivative size = 199, normalized size of antiderivative = 3.69 \[ \int \tanh ^4(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {1}{15} \, b {\left (15 \, x + \frac {15 \, c}{d} - \frac {2 \, {\left (70 \, e^{\left (-2 \, d x - 2 \, c\right )} + 140 \, e^{\left (-4 \, d x - 4 \, c\right )} + 90 \, e^{\left (-6 \, d x - 6 \, c\right )} + 45 \, e^{\left (-8 \, d x - 8 \, c\right )} + 23\right )}}{d {\left (5 \, e^{\left (-2 \, d x - 2 \, c\right )} + 10 \, e^{\left (-4 \, d x - 4 \, c\right )} + 10 \, e^{\left (-6 \, d x - 6 \, c\right )} + 5 \, e^{\left (-8 \, d x - 8 \, c\right )} + e^{\left (-10 \, d x - 10 \, c\right )} + 1\right )}}\right )} + \frac {1}{3} \, a {\left (3 \, x + \frac {3 \, c}{d} - \frac {4 \, {\left (3 \, e^{\left (-2 \, d x - 2 \, c\right )} + 3 \, e^{\left (-4 \, d x - 4 \, c\right )} + 2\right )}}{d {\left (3 \, e^{\left (-2 \, d x - 2 \, c\right )} + 3 \, e^{\left (-4 \, d x - 4 \, c\right )} + e^{\left (-6 \, d x - 6 \, c\right )} + 1\right )}}\right )} \] Input:
integrate(tanh(d*x+c)^4*(a+b*tanh(d*x+c)^2),x, algorithm="maxima")
Output:
1/15*b*(15*x + 15*c/d - 2*(70*e^(-2*d*x - 2*c) + 140*e^(-4*d*x - 4*c) + 90 *e^(-6*d*x - 6*c) + 45*e^(-8*d*x - 8*c) + 23)/(d*(5*e^(-2*d*x - 2*c) + 10* e^(-4*d*x - 4*c) + 10*e^(-6*d*x - 6*c) + 5*e^(-8*d*x - 8*c) + e^(-10*d*x - 10*c) + 1))) + 1/3*a*(3*x + 3*c/d - 4*(3*e^(-2*d*x - 2*c) + 3*e^(-4*d*x - 4*c) + 2)/(d*(3*e^(-2*d*x - 2*c) + 3*e^(-4*d*x - 4*c) + e^(-6*d*x - 6*c) + 1)))
Leaf count of result is larger than twice the leaf count of optimal. 134 vs. \(2 (50) = 100\).
Time = 0.16 (sec) , antiderivative size = 134, normalized size of antiderivative = 2.48 \[ \int \tanh ^4(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {15 \, {\left (d x + c\right )} {\left (a + b\right )} + \frac {2 \, {\left (30 \, a e^{\left (8 \, d x + 8 \, c\right )} + 45 \, b e^{\left (8 \, d x + 8 \, c\right )} + 90 \, a e^{\left (6 \, d x + 6 \, c\right )} + 90 \, b e^{\left (6 \, d x + 6 \, c\right )} + 110 \, a e^{\left (4 \, d x + 4 \, c\right )} + 140 \, b e^{\left (4 \, d x + 4 \, c\right )} + 70 \, a e^{\left (2 \, d x + 2 \, c\right )} + 70 \, b e^{\left (2 \, d x + 2 \, c\right )} + 20 \, a + 23 \, b\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{5}}}{15 \, d} \] Input:
integrate(tanh(d*x+c)^4*(a+b*tanh(d*x+c)^2),x, algorithm="giac")
Output:
1/15*(15*(d*x + c)*(a + b) + 2*(30*a*e^(8*d*x + 8*c) + 45*b*e^(8*d*x + 8*c ) + 90*a*e^(6*d*x + 6*c) + 90*b*e^(6*d*x + 6*c) + 110*a*e^(4*d*x + 4*c) + 140*b*e^(4*d*x + 4*c) + 70*a*e^(2*d*x + 2*c) + 70*b*e^(2*d*x + 2*c) + 20*a + 23*b)/(e^(2*d*x + 2*c) + 1)^5)/d
Time = 0.13 (sec) , antiderivative size = 50, normalized size of antiderivative = 0.93 \[ \int \tanh ^4(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=x\,\left (a+b\right )-\frac {{\mathrm {tanh}\left (c+d\,x\right )}^3\,\left (a+b\right )}{3\,d}-\frac {b\,{\mathrm {tanh}\left (c+d\,x\right )}^5}{5\,d}-\frac {\mathrm {tanh}\left (c+d\,x\right )\,\left (a+b\right )}{d} \] Input:
int(tanh(c + d*x)^4*(a + b*tanh(c + d*x)^2),x)
Output:
x*(a + b) - (tanh(c + d*x)^3*(a + b))/(3*d) - (b*tanh(c + d*x)^5)/(5*d) - (tanh(c + d*x)*(a + b))/d
Time = 0.31 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.24 \[ \int \tanh ^4(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {-3 \tanh \left (d x +c \right )^{5} b -5 \tanh \left (d x +c \right )^{3} a -5 \tanh \left (d x +c \right )^{3} b -15 \tanh \left (d x +c \right ) a -15 \tanh \left (d x +c \right ) b +15 a d x +15 b d x}{15 d} \] Input:
int(tanh(d*x+c)^4*(a+b*tanh(d*x+c)^2),x)
Output:
( - 3*tanh(c + d*x)**5*b - 5*tanh(c + d*x)**3*a - 5*tanh(c + d*x)**3*b - 1 5*tanh(c + d*x)*a - 15*tanh(c + d*x)*b + 15*a*d*x + 15*b*d*x)/(15*d)