Integrand size = 21, antiderivative size = 49 \[ \int \tanh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {(a+b) \log (\cosh (c+d x))}{d}-\frac {(a+b) \tanh ^2(c+d x)}{2 d}-\frac {b \tanh ^4(c+d x)}{4 d} \] Output:
(a+b)*ln(cosh(d*x+c))/d-1/2*(a+b)*tanh(d*x+c)^2/d-1/4*b*tanh(d*x+c)^4/d
Time = 0.16 (sec) , antiderivative size = 46, normalized size of antiderivative = 0.94 \[ \int \tanh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {4 (a+b) \log (\cosh (c+d x))+2 (a+2 b) \text {sech}^2(c+d x)-b \text {sech}^4(c+d x)}{4 d} \] Input:
Integrate[Tanh[c + d*x]^3*(a + b*Tanh[c + d*x]^2),x]
Output:
(4*(a + b)*Log[Cosh[c + d*x]] + 2*(a + 2*b)*Sech[c + d*x]^2 - b*Sech[c + d *x]^4)/(4*d)
Result contains complex when optimal does not.
Time = 0.65 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.20, number of steps used = 11, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.524, Rules used = {3042, 26, 4114, 26, 3042, 26, 3954, 26, 3042, 26, 3956}
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 ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int i \tan (i c+i d x)^3 \left (a-b \tan (i c+i d x)^2\right )dx\) |
\(\Big \downarrow \) 26 |
\(\displaystyle i \int \tan (i c+i d x)^3 \left (a-b \tan (i c+i d x)^2\right )dx\) |
\(\Big \downarrow \) 4114 |
\(\displaystyle i \left ((a+b) \int -i \tanh ^3(c+d x)dx+\frac {i b \tanh ^4(c+d x)}{4 d}\right )\) |
\(\Big \downarrow \) 26 |
\(\displaystyle i \left (\frac {i b \tanh ^4(c+d x)}{4 d}-i (a+b) \int \tanh ^3(c+d x)dx\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle i \left (\frac {i b \tanh ^4(c+d x)}{4 d}-i (a+b) \int i \tan (i c+i d x)^3dx\right )\) |
\(\Big \downarrow \) 26 |
\(\displaystyle i \left ((a+b) \int \tan (i c+i d x)^3dx+\frac {i b \tanh ^4(c+d x)}{4 d}\right )\) |
\(\Big \downarrow \) 3954 |
\(\displaystyle i \left ((a+b) \left (\frac {i \tanh ^2(c+d x)}{2 d}-\int i \tanh (c+d x)dx\right )+\frac {i b \tanh ^4(c+d x)}{4 d}\right )\) |
\(\Big \downarrow \) 26 |
\(\displaystyle i \left ((a+b) \left (\frac {i \tanh ^2(c+d x)}{2 d}-i \int \tanh (c+d x)dx\right )+\frac {i b \tanh ^4(c+d x)}{4 d}\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle i \left ((a+b) \left (\frac {i \tanh ^2(c+d x)}{2 d}-i \int -i \tan (i c+i d x)dx\right )+\frac {i b \tanh ^4(c+d x)}{4 d}\right )\) |
\(\Big \downarrow \) 26 |
\(\displaystyle i \left ((a+b) \left (\frac {i \tanh ^2(c+d x)}{2 d}-\int \tan (i c+i d x)dx\right )+\frac {i b \tanh ^4(c+d x)}{4 d}\right )\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle i \left ((a+b) \left (\frac {i \tanh ^2(c+d x)}{2 d}-\frac {i \log (\cosh (c+d x))}{d}\right )+\frac {i b \tanh ^4(c+d x)}{4 d}\right )\) |
Input:
Int[Tanh[c + d*x]^3*(a + b*Tanh[c + d*x]^2),x]
Output:
I*(((I/4)*b*Tanh[c + d*x]^4)/d + (a + b)*(((-I)*Log[Cosh[c + d*x]])/d + (( I/2)*Tanh[c + d*x]^2)/d))
Int[(Complex[0, a_])*(Fx_), x_Symbol] :> Simp[(Complex[Identity[0], a]) I nt[Fx, x], x] /; FreeQ[a, x] && EqQ[a^2, 1]
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[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d *x], x]]/d, x] /; FreeQ[{c, d}, x]
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.26 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.45
method | result | size |
derivativedivides | \(\frac {-\frac {\tanh \left (d x +c \right )^{4} b}{4}-\frac {a \tanh \left (d x +c \right )^{2}}{2}-\frac {\tanh \left (d x +c \right )^{2} b}{2}-\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}\) | \(71\) |
default | \(\frac {-\frac {\tanh \left (d x +c \right )^{4} b}{4}-\frac {a \tanh \left (d x +c \right )^{2}}{2}-\frac {\tanh \left (d x +c \right )^{2} b}{2}-\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}\) | \(71\) |
parallelrisch | \(-\frac {\tanh \left (d x +c \right )^{4} b +4 d x a +4 d x b +2 a \tanh \left (d x +c \right )^{2}+2 \tanh \left (d x +c \right )^{2} b +4 \ln \left (1-\tanh \left (d x +c \right )\right ) a +4 \ln \left (1-\tanh \left (d x +c \right )\right ) b}{4 d}\) | \(77\) |
parts | \(\frac {a \left (-\frac {\tanh \left (d x +c \right )^{2}}{2}-\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 )^{4}}{4}-\frac {\tanh \left (d x +c \right )^{2}}{2}-\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}\) | \(88\) |
risch | \(-a x -b x -\frac {2 a c}{d}-\frac {2 b c}{d}+\frac {2 \,{\mathrm e}^{2 d x +2 c} \left ({\mathrm e}^{4 d x +4 c} a +2 b \,{\mathrm e}^{4 d x +4 c}+2 \,{\mathrm e}^{2 d x +2 c} a +2 \,{\mathrm e}^{2 d x +2 c} b +a +2 b \right )}{d \left ({\mathrm e}^{2 d x +2 c}+1\right )^{4}}+\frac {\ln \left ({\mathrm e}^{2 d x +2 c}+1\right ) a}{d}+\frac {\ln \left ({\mathrm e}^{2 d x +2 c}+1\right ) b}{d}\) | \(137\) |
Input:
int(tanh(d*x+c)^3*(a+tanh(d*x+c)^2*b),x,method=_RETURNVERBOSE)
Output:
1/d*(-1/4*tanh(d*x+c)^4*b-1/2*a*tanh(d*x+c)^2-1/2*tanh(d*x+c)^2*b-1/2*(a+b )*ln(tanh(d*x+c)-1)+1/2*(-a-b)*ln(tanh(d*x+c)+1))
Leaf count of result is larger than twice the leaf count of optimal. 1205 vs. \(2 (45) = 90\).
Time = 0.10 (sec) , antiderivative size = 1205, normalized size of antiderivative = 24.59 \[ \int \tanh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\text {Too large to display} \] Input:
integrate(tanh(d*x+c)^3*(a+b*tanh(d*x+c)^2),x, algorithm="fricas")
Output:
-((a + b)*d*x*cosh(d*x + c)^8 + 8*(a + b)*d*x*cosh(d*x + c)*sinh(d*x + c)^ 7 + (a + b)*d*x*sinh(d*x + c)^8 + 2*(2*(a + b)*d*x - a - 2*b)*cosh(d*x + c )^6 + 2*(14*(a + b)*d*x*cosh(d*x + c)^2 + 2*(a + b)*d*x - a - 2*b)*sinh(d* x + c)^6 + 4*(14*(a + b)*d*x*cosh(d*x + c)^3 + 3*(2*(a + b)*d*x - a - 2*b) *cosh(d*x + c))*sinh(d*x + c)^5 + 2*(3*(a + b)*d*x - 2*a - 2*b)*cosh(d*x + c)^4 + 2*(35*(a + b)*d*x*cosh(d*x + c)^4 + 3*(a + b)*d*x + 15*(2*(a + b)* d*x - a - 2*b)*cosh(d*x + c)^2 - 2*a - 2*b)*sinh(d*x + c)^4 + 8*(7*(a + b) *d*x*cosh(d*x + c)^5 + 5*(2*(a + b)*d*x - a - 2*b)*cosh(d*x + c)^3 + (3*(a + b)*d*x - 2*a - 2*b)*cosh(d*x + c))*sinh(d*x + c)^3 + (a + b)*d*x + 2*(2 *(a + b)*d*x - a - 2*b)*cosh(d*x + c)^2 + 2*(14*(a + b)*d*x*cosh(d*x + c)^ 6 + 15*(2*(a + b)*d*x - a - 2*b)*cosh(d*x + c)^4 + 2*(a + b)*d*x + 6*(3*(a + b)*d*x - 2*a - 2*b)*cosh(d*x + c)^2 - a - 2*b)*sinh(d*x + c)^2 - ((a + b)*cosh(d*x + c)^8 + 8*(a + b)*cosh(d*x + c)*sinh(d*x + c)^7 + (a + b)*sin h(d*x + c)^8 + 4*(a + b)*cosh(d*x + c)^6 + 4*(7*(a + b)*cosh(d*x + c)^2 + a + b)*sinh(d*x + c)^6 + 8*(7*(a + b)*cosh(d*x + c)^3 + 3*(a + b)*cosh(d*x + c))*sinh(d*x + c)^5 + 6*(a + b)*cosh(d*x + c)^4 + 2*(35*(a + b)*cosh(d* x + c)^4 + 30*(a + b)*cosh(d*x + c)^2 + 3*a + 3*b)*sinh(d*x + c)^4 + 8*(7* (a + b)*cosh(d*x + c)^5 + 10*(a + b)*cosh(d*x + c)^3 + 3*(a + b)*cosh(d*x + c))*sinh(d*x + c)^3 + 4*(a + b)*cosh(d*x + c)^2 + 4*(7*(a + b)*cosh(d*x + c)^6 + 15*(a + b)*cosh(d*x + c)^4 + 9*(a + b)*cosh(d*x + c)^2 + a + b...
Leaf count of result is larger than twice the leaf count of optimal. 88 vs. \(2 (42) = 84\).
Time = 0.14 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.80 \[ \int \tanh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\begin {cases} a x - \frac {a \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {a \tanh ^{2}{\left (c + d x \right )}}{2 d} + b x - \frac {b \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {b \tanh ^{4}{\left (c + d x \right )}}{4 d} - \frac {b \tanh ^{2}{\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \left (a + b \tanh ^{2}{\left (c \right )}\right ) \tanh ^{3}{\left (c \right )} & \text {otherwise} \end {cases} \] Input:
integrate(tanh(d*x+c)**3*(a+b*tanh(d*x+c)**2),x)
Output:
Piecewise((a*x - a*log(tanh(c + d*x) + 1)/d - a*tanh(c + d*x)**2/(2*d) + b *x - b*log(tanh(c + d*x) + 1)/d - b*tanh(c + d*x)**4/(4*d) - b*tanh(c + d* x)**2/(2*d), Ne(d, 0)), (x*(a + b*tanh(c)**2)*tanh(c)**3, True))
Leaf count of result is larger than twice the leaf count of optimal. 168 vs. \(2 (45) = 90\).
Time = 0.12 (sec) , antiderivative size = 168, normalized size of antiderivative = 3.43 \[ \int \tanh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=b {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {4 \, {\left (e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + e^{\left (-6 \, d x - 6 \, c\right )}\right )}}{d {\left (4 \, e^{\left (-2 \, d x - 2 \, c\right )} + 6 \, e^{\left (-4 \, d x - 4 \, c\right )} + 4 \, e^{\left (-6 \, d x - 6 \, c\right )} + e^{\left (-8 \, d x - 8 \, c\right )} + 1\right )}}\right )} + a {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {2 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d {\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + 1\right )}}\right )} \] Input:
integrate(tanh(d*x+c)^3*(a+b*tanh(d*x+c)^2),x, algorithm="maxima")
Output:
b*(x + c/d + log(e^(-2*d*x - 2*c) + 1)/d + 4*(e^(-2*d*x - 2*c) + e^(-4*d*x - 4*c) + e^(-6*d*x - 6*c))/(d*(4*e^(-2*d*x - 2*c) + 6*e^(-4*d*x - 4*c) + 4*e^(-6*d*x - 6*c) + e^(-8*d*x - 8*c) + 1))) + a*(x + c/d + log(e^(-2*d*x - 2*c) + 1)/d + 2*e^(-2*d*x - 2*c)/(d*(2*e^(-2*d*x - 2*c) + e^(-4*d*x - 4* c) + 1)))
Leaf count of result is larger than twice the leaf count of optimal. 92 vs. \(2 (45) = 90\).
Time = 0.15 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.88 \[ \int \tanh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=-\frac {{\left (d x + c\right )} {\left (a + b\right )} - {\left (a + b\right )} \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) - \frac {2 \, {\left ({\left (a + 2 \, b\right )} e^{\left (6 \, d x + 6 \, c\right )} + 2 \, {\left (a + b\right )} e^{\left (4 \, d x + 4 \, c\right )} + {\left (a + 2 \, b\right )} e^{\left (2 \, d x + 2 \, c\right )}\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{4}}}{d} \] Input:
integrate(tanh(d*x+c)^3*(a+b*tanh(d*x+c)^2),x, algorithm="giac")
Output:
-((d*x + c)*(a + b) - (a + b)*log(e^(2*d*x + 2*c) + 1) - 2*((a + 2*b)*e^(6 *d*x + 6*c) + 2*(a + b)*e^(4*d*x + 4*c) + (a + 2*b)*e^(2*d*x + 2*c))/(e^(2 *d*x + 2*c) + 1)^4)/d
Time = 2.39 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.08 \[ \int \tanh ^3(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 )}^2\,\left (a+b\right )}{2\,d}-\frac {b\,{\mathrm {tanh}\left (c+d\,x\right )}^4}{4\,d}-\frac {\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )\,\left (a+b\right )}{d} \] Input:
int(tanh(c + d*x)^3*(a + b*tanh(c + d*x)^2),x)
Output:
x*(a + b) - (tanh(c + d*x)^2*(a + b))/(2*d) - (b*tanh(c + d*x)^4)/(4*d) - (log(tanh(c + d*x) + 1)*(a + b))/d
Time = 0.24 (sec) , antiderivative size = 484, normalized size of antiderivative = 9.88 \[ \int \tanh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {-a -2 b +2 \,\mathrm {log}\left (e^{2 d x +2 c}+1\right ) b +8 e^{2 d x +2 c} \mathrm {log}\left (e^{2 d x +2 c}+1\right ) b -2 b d x +12 e^{4 d x +4 c} \mathrm {log}\left (e^{2 d x +2 c}+1\right ) a +8 e^{2 d x +2 c} \mathrm {log}\left (e^{2 d x +2 c}+1\right ) a +2 e^{8 d x +8 c} \mathrm {log}\left (e^{2 d x +2 c}+1\right ) a +8 e^{6 d x +6 c} \mathrm {log}\left (e^{2 d x +2 c}+1\right ) a -2 e^{8 d x +8 c} a d x -2 e^{8 d x +8 c} b d x -8 e^{2 d x +2 c} a d x -8 e^{2 d x +2 c} b d x -8 e^{6 d x +6 c} a d x -8 e^{6 d x +6 c} b d x -12 e^{4 d x +4 c} a d x -12 e^{4 d x +4 c} b d x -4 e^{4 d x +4 c} b +2 e^{4 d x +4 c} a -2 a d x -e^{8 d x +8 c} a -2 e^{8 d x +8 c} b +2 \,\mathrm {log}\left (e^{2 d x +2 c}+1\right ) a +2 e^{8 d x +8 c} \mathrm {log}\left (e^{2 d x +2 c}+1\right ) b +8 e^{6 d x +6 c} \mathrm {log}\left (e^{2 d x +2 c}+1\right ) b +12 e^{4 d x +4 c} \mathrm {log}\left (e^{2 d x +2 c}+1\right ) b}{2 d \left (e^{8 d x +8 c}+4 e^{6 d x +6 c}+6 e^{4 d x +4 c}+4 e^{2 d x +2 c}+1\right )} \] Input:
int(tanh(d*x+c)^3*(a+b*tanh(d*x+c)^2),x)
Output:
(2*e**(8*c + 8*d*x)*log(e**(2*c + 2*d*x) + 1)*a + 2*e**(8*c + 8*d*x)*log(e **(2*c + 2*d*x) + 1)*b - 2*e**(8*c + 8*d*x)*a*d*x - e**(8*c + 8*d*x)*a - 2 *e**(8*c + 8*d*x)*b*d*x - 2*e**(8*c + 8*d*x)*b + 8*e**(6*c + 6*d*x)*log(e* *(2*c + 2*d*x) + 1)*a + 8*e**(6*c + 6*d*x)*log(e**(2*c + 2*d*x) + 1)*b - 8 *e**(6*c + 6*d*x)*a*d*x - 8*e**(6*c + 6*d*x)*b*d*x + 12*e**(4*c + 4*d*x)*l og(e**(2*c + 2*d*x) + 1)*a + 12*e**(4*c + 4*d*x)*log(e**(2*c + 2*d*x) + 1) *b - 12*e**(4*c + 4*d*x)*a*d*x + 2*e**(4*c + 4*d*x)*a - 12*e**(4*c + 4*d*x )*b*d*x - 4*e**(4*c + 4*d*x)*b + 8*e**(2*c + 2*d*x)*log(e**(2*c + 2*d*x) + 1)*a + 8*e**(2*c + 2*d*x)*log(e**(2*c + 2*d*x) + 1)*b - 8*e**(2*c + 2*d*x )*a*d*x - 8*e**(2*c + 2*d*x)*b*d*x + 2*log(e**(2*c + 2*d*x) + 1)*a + 2*log (e**(2*c + 2*d*x) + 1)*b - 2*a*d*x - a - 2*b*d*x - 2*b)/(2*d*(e**(8*c + 8* d*x) + 4*e**(6*c + 6*d*x) + 6*e**(4*c + 4*d*x) + 4*e**(2*c + 2*d*x) + 1))