Integrand size = 12, antiderivative size = 56 \[ \int (a+a \tanh (c+d x))^3 \, dx=4 a^3 x+\frac {4 a^3 \log (\cosh (c+d x))}{d}-\frac {2 a^3 \tanh (c+d x)}{d}-\frac {a (a+a \tanh (c+d x))^2}{2 d} \] Output:
4*a^3*x+4*a^3*ln(cosh(d*x+c))/d-2*a^3*tanh(d*x+c)/d-1/2*a*(a+a*tanh(d*x+c) )^2/d
Time = 0.15 (sec) , antiderivative size = 40, normalized size of antiderivative = 0.71 \[ \int (a+a \tanh (c+d x))^3 \, dx=-\frac {a^3 \left (8 \log (1-\tanh (c+d x))+6 \tanh (c+d x)+\tanh ^2(c+d x)\right )}{2 d} \] Input:
Integrate[(a + a*Tanh[c + d*x])^3,x]
Output:
-1/2*(a^3*(8*Log[1 - Tanh[c + d*x]] + 6*Tanh[c + d*x] + Tanh[c + d*x]^2))/ d
Time = 0.36 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.07, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.667, Rules used = {3042, 3959, 3042, 3958, 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 (a \tanh (c+d x)+a)^3 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a-i a \tan (i c+i d x))^3dx\) |
\(\Big \downarrow \) 3959 |
\(\displaystyle 2 a \int (\tanh (c+d x) a+a)^2dx-\frac {a (a \tanh (c+d x)+a)^2}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {a (a \tanh (c+d x)+a)^2}{2 d}+2 a \int (a-i a \tan (i c+i d x))^2dx\) |
\(\Big \downarrow \) 3958 |
\(\displaystyle -\frac {a (a \tanh (c+d x)+a)^2}{2 d}+2 a \left (-2 i a^2 \int i \tanh (c+d x)dx-\frac {a^2 \tanh (c+d x)}{d}+2 a^2 x\right )\) |
\(\Big \downarrow \) 26 |
\(\displaystyle 2 a \left (2 a^2 \int \tanh (c+d x)dx-\frac {a^2 \tanh (c+d x)}{d}+2 a^2 x\right )-\frac {a (a \tanh (c+d x)+a)^2}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {a (a \tanh (c+d x)+a)^2}{2 d}+2 a \left (2 a^2 \int -i \tan (i c+i d x)dx-\frac {a^2 \tanh (c+d x)}{d}+2 a^2 x\right )\) |
\(\Big \downarrow \) 26 |
\(\displaystyle -\frac {a (a \tanh (c+d x)+a)^2}{2 d}+2 a \left (-2 i a^2 \int \tan (i c+i d x)dx-\frac {a^2 \tanh (c+d x)}{d}+2 a^2 x\right )\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle 2 a \left (-\frac {a^2 \tanh (c+d x)}{d}+\frac {2 a^2 \log (\cosh (c+d x))}{d}+2 a^2 x\right )-\frac {a (a \tanh (c+d x)+a)^2}{2 d}\) |
Input:
Int[(a + a*Tanh[c + d*x])^3,x]
Output:
-1/2*(a*(a + a*Tanh[c + d*x])^2)/d + 2*a*(2*a^2*x + (2*a^2*Log[Cosh[c + d* x]])/d - (a^2*Tanh[c + d*x])/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[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d *x], x]]/d, x] /; FreeQ[{c, d}, x]
Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^2, x_Symbol] :> Simp[(a^2 - b^2) *x, x] + (Simp[b^2*(Tan[c + d*x]/d), x] + Simp[2*a*b Int[Tan[c + d*x], x] , x]) /; FreeQ[{a, b, c, d}, x]
Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((a + b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] + Simp[2*a Int[(a + b*Tan[c + d* x])^(n - 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0] && GtQ[n , 1]
Time = 0.20 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.68
method | result | size |
derivativedivides | \(\frac {a^{3} \left (-\frac {\tanh \left (d x +c \right )^{2}}{2}-3 \tanh \left (d x +c \right )-4 \ln \left (\tanh \left (d x +c \right )-1\right )\right )}{d}\) | \(38\) |
default | \(\frac {a^{3} \left (-\frac {\tanh \left (d x +c \right )^{2}}{2}-3 \tanh \left (d x +c \right )-4 \ln \left (\tanh \left (d x +c \right )-1\right )\right )}{d}\) | \(38\) |
parallelrisch | \(-\frac {\tanh \left (d x +c \right )^{2} a^{3}+8 \ln \left (1-\tanh \left (d x +c \right )\right ) a^{3}+6 a^{3} \tanh \left (d x +c \right )}{2 d}\) | \(46\) |
risch | \(-\frac {8 a^{3} c}{d}+\frac {2 a^{3} \left (4 \,{\mathrm e}^{2 d x +2 c}+3\right )}{d \left ({\mathrm e}^{2 d x +2 c}+1\right )^{2}}+\frac {4 a^{3} \ln \left ({\mathrm e}^{2 d x +2 c}+1\right )}{d}\) | \(65\) |
parts | \(a^{3} x +\frac {a^{3} \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 {3 a^{3} \ln \left (\cosh \left (d x +c \right )\right )}{d}+\frac {3 a^{3} \left (-\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}\) | \(101\) |
Input:
int((a+a*tanh(d*x+c))^3,x,method=_RETURNVERBOSE)
Output:
1/d*a^3*(-1/2*tanh(d*x+c)^2-3*tanh(d*x+c)-4*ln(tanh(d*x+c)-1))
Leaf count of result is larger than twice the leaf count of optimal. 299 vs. \(2 (54) = 108\).
Time = 0.09 (sec) , antiderivative size = 299, normalized size of antiderivative = 5.34 \[ \int (a+a \tanh (c+d x))^3 \, dx=\frac {2 \, {\left (4 \, a^{3} \cosh \left (d x + c\right )^{2} + 8 \, a^{3} \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + 4 \, a^{3} \sinh \left (d x + c\right )^{2} + 3 \, a^{3} + 2 \, {\left (a^{3} \cosh \left (d x + c\right )^{4} + 4 \, a^{3} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + a^{3} \sinh \left (d x + c\right )^{4} + 2 \, a^{3} \cosh \left (d x + c\right )^{2} + a^{3} + 2 \, {\left (3 \, a^{3} \cosh \left (d x + c\right )^{2} + a^{3}\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left (a^{3} \cosh \left (d x + c\right )^{3} + a^{3} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )\right )} \log \left (\frac {2 \, \cosh \left (d x + c\right )}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right )\right )}}{d \cosh \left (d x + c\right )^{4} + 4 \, d \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + d \sinh \left (d x + c\right )^{4} + 2 \, d \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, d \cosh \left (d x + c\right )^{2} + d\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left (d \cosh \left (d x + c\right )^{3} + d \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + d} \] Input:
integrate((a+a*tanh(d*x+c))^3,x, algorithm="fricas")
Output:
2*(4*a^3*cosh(d*x + c)^2 + 8*a^3*cosh(d*x + c)*sinh(d*x + c) + 4*a^3*sinh( d*x + c)^2 + 3*a^3 + 2*(a^3*cosh(d*x + c)^4 + 4*a^3*cosh(d*x + c)*sinh(d*x + c)^3 + a^3*sinh(d*x + c)^4 + 2*a^3*cosh(d*x + c)^2 + a^3 + 2*(3*a^3*cos h(d*x + c)^2 + a^3)*sinh(d*x + c)^2 + 4*(a^3*cosh(d*x + c)^3 + a^3*cosh(d* x + c))*sinh(d*x + c))*log(2*cosh(d*x + c)/(cosh(d*x + c) - sinh(d*x + c)) ))/(d*cosh(d*x + c)^4 + 4*d*cosh(d*x + c)*sinh(d*x + c)^3 + d*sinh(d*x + c )^4 + 2*d*cosh(d*x + c)^2 + 2*(3*d*cosh(d*x + c)^2 + d)*sinh(d*x + c)^2 + 4*(d*cosh(d*x + c)^3 + d*cosh(d*x + c))*sinh(d*x + c) + d)
Time = 0.11 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.09 \[ \int (a+a \tanh (c+d x))^3 \, dx=\begin {cases} 8 a^{3} x - \frac {4 a^{3} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {a^{3} \tanh ^{2}{\left (c + d x \right )}}{2 d} - \frac {3 a^{3} \tanh {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a \tanh {\left (c \right )} + a\right )^{3} & \text {otherwise} \end {cases} \] Input:
integrate((a+a*tanh(d*x+c))**3,x)
Output:
Piecewise((8*a**3*x - 4*a**3*log(tanh(c + d*x) + 1)/d - a**3*tanh(c + d*x) **2/(2*d) - 3*a**3*tanh(c + d*x)/d, Ne(d, 0)), (x*(a*tanh(c) + a)**3, True ))
Leaf count of result is larger than twice the leaf count of optimal. 116 vs. \(2 (54) = 108\).
Time = 0.13 (sec) , antiderivative size = 116, normalized size of antiderivative = 2.07 \[ \int (a+a \tanh (c+d x))^3 \, dx=a^{3} {\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 )} + 3 \, a^{3} {\left (x + \frac {c}{d} - \frac {2}{d {\left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}}\right )} + a^{3} x + \frac {3 \, a^{3} \log \left (\cosh \left (d x + c\right )\right )}{d} \] Input:
integrate((a+a*tanh(d*x+c))^3,x, algorithm="maxima")
Output:
a^3*(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))) + 3*a^3*(x + c/d - 2/(d*(e^(-2*d*x - 2*c) + 1))) + a^3*x + 3*a^3*log(cosh(d*x + c))/d
Time = 0.13 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.02 \[ \int (a+a \tanh (c+d x))^3 \, dx=\frac {2 \, {\left (2 \, a^{3} \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) + \frac {4 \, a^{3} e^{\left (2 \, d x + 2 \, c\right )} + 3 \, a^{3}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{2}}\right )}}{d} \] Input:
integrate((a+a*tanh(d*x+c))^3,x, algorithm="giac")
Output:
2*(2*a^3*log(e^(2*d*x + 2*c) + 1) + (4*a^3*e^(2*d*x + 2*c) + 3*a^3)/(e^(2* d*x + 2*c) + 1)^2)/d
Time = 1.96 (sec) , antiderivative size = 43, normalized size of antiderivative = 0.77 \[ \int (a+a \tanh (c+d x))^3 \, dx=8\,a^3\,x-\frac {a^3\,\left (8\,\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )+6\,\mathrm {tanh}\left (c+d\,x\right )+{\mathrm {tanh}\left (c+d\,x\right )}^2\right )}{2\,d} \] Input:
int((a + a*tanh(c + d*x))^3,x)
Output:
8*a^3*x - (a^3*(8*log(tanh(c + d*x) + 1) + 6*tanh(c + d*x) + tanh(c + d*x) ^2))/(2*d)
Time = 0.27 (sec) , antiderivative size = 113, normalized size of antiderivative = 2.02 \[ \int (a+a \tanh (c+d x))^3 \, dx=\frac {2 a^{3} \left (2 e^{4 d x +4 c} \mathrm {log}\left (e^{2 d x +2 c}+1\right )-2 e^{4 d x +4 c}+4 e^{2 d x +2 c} \mathrm {log}\left (e^{2 d x +2 c}+1\right )+2 \,\mathrm {log}\left (e^{2 d x +2 c}+1\right )+1\right )}{d \left (e^{4 d x +4 c}+2 e^{2 d x +2 c}+1\right )} \] Input:
int((a+a*tanh(d*x+c))^3,x)
Output:
(2*a**3*(2*e**(4*c + 4*d*x)*log(e**(2*c + 2*d*x) + 1) - 2*e**(4*c + 4*d*x) + 4*e**(2*c + 2*d*x)*log(e**(2*c + 2*d*x) + 1) + 2*log(e**(2*c + 2*d*x) + 1) + 1))/(d*(e**(4*c + 4*d*x) + 2*e**(2*c + 2*d*x) + 1))