Integrand size = 12, antiderivative size = 69 \[ \int (a+b \tanh (c+d x))^3 \, dx=a \left (a^2+3 b^2\right ) x+\frac {b \left (3 a^2+b^2\right ) \log (\cosh (c+d x))}{d}-\frac {2 a b^2 \tanh (c+d x)}{d}-\frac {b (a+b \tanh (c+d x))^2}{2 d} \]
a*(a^2+3*b^2)*x+b*(3*a^2+b^2)*ln(cosh(d*x+c))/d-2*a*b^2*tanh(d*x+c)/d-1/2* b*(a+b*tanh(d*x+c))^2/d
Time = 0.24 (sec) , antiderivative size = 67, normalized size of antiderivative = 0.97 \[ \int (a+b \tanh (c+d x))^3 \, dx=-\frac {(a+b)^3 \log (1-\tanh (c+d x))-(a-b)^3 \log (1+\tanh (c+d x))+6 a b^2 \tanh (c+d x)+b^3 \tanh ^2(c+d x)}{2 d} \]
-1/2*((a + b)^3*Log[1 - Tanh[c + d*x]] - (a - b)^3*Log[1 + Tanh[c + d*x]] + 6*a*b^2*Tanh[c + d*x] + b^3*Tanh[c + d*x]^2)/d
Time = 0.40 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.667, Rules used = {3042, 3963, 3042, 4008, 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+b \tanh (c+d x))^3 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a-i b \tan (i c+i d x))^3dx\) |
\(\Big \downarrow \) 3963 |
\(\displaystyle \int (a+b \tanh (c+d x)) \left (a^2+2 b \tanh (c+d x) a+b^2\right )dx-\frac {b (a+b \tanh (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {b (a+b \tanh (c+d x))^2}{2 d}+\int (a-i b \tan (i c+i d x)) \left (a^2-2 i b \tan (i c+i d x) a+b^2\right )dx\) |
\(\Big \downarrow \) 4008 |
\(\displaystyle -i b \left (3 a^2+b^2\right ) \int i \tanh (c+d x)dx+a x \left (a^2+3 b^2\right )-\frac {2 a b^2 \tanh (c+d x)}{d}-\frac {b (a+b \tanh (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 26 |
\(\displaystyle b \left (3 a^2+b^2\right ) \int \tanh (c+d x)dx+a x \left (a^2+3 b^2\right )-\frac {2 a b^2 \tanh (c+d x)}{d}-\frac {b (a+b \tanh (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle b \left (3 a^2+b^2\right ) \int -i \tan (i c+i d x)dx+a x \left (a^2+3 b^2\right )-\frac {2 a b^2 \tanh (c+d x)}{d}-\frac {b (a+b \tanh (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 26 |
\(\displaystyle -i b \left (3 a^2+b^2\right ) \int \tan (i c+i d x)dx+a x \left (a^2+3 b^2\right )-\frac {2 a b^2 \tanh (c+d x)}{d}-\frac {b (a+b \tanh (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle \frac {b \left (3 a^2+b^2\right ) \log (\cosh (c+d x))}{d}+a x \left (a^2+3 b^2\right )-\frac {2 a b^2 \tanh (c+d x)}{d}-\frac {b (a+b \tanh (c+d x))^2}{2 d}\) |
a*(a^2 + 3*b^2)*x + (b*(3*a^2 + b^2)*Log[Cosh[c + d*x]])/d - (2*a*b^2*Tanh [c + d*x])/d - (b*(a + b*Tanh[c + d*x])^2)/(2*d)
3.1.59.3.1 Defintions of rubi rules used
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_)])^(n_), x_Symbol] :> Simp[b*((a + b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] + Int[(a^2 - b^2 + 2*a*b*Tan[c + d *x])*(a + b*Tan[c + d*x])^(n - 2), x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0] && GtQ[n, 1]
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.) *(x_)]), x_Symbol] :> Simp[(a*c - b*d)*x, x] + (Simp[b*d*(Tan[e + f*x]/f), x] + Simp[(b*c + a*d) Int[Tan[e + f*x], x], x]) /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]
Time = 0.04 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.35
method | result | size |
derivativedivides | \(\frac {-\frac {b^{3} \tanh \left (d x +c \right )^{2}}{2}-3 a \,b^{2} \tanh \left (d x +c \right )-\frac {\left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}+\frac {\left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right ) \ln \left (\tanh \left (d x +c \right )+1\right )}{2}}{d}\) | \(93\) |
default | \(\frac {-\frac {b^{3} \tanh \left (d x +c \right )^{2}}{2}-3 a \,b^{2} \tanh \left (d x +c \right )-\frac {\left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}+\frac {\left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right ) \ln \left (\tanh \left (d x +c \right )+1\right )}{2}}{d}\) | \(93\) |
parallelrisch | \(-\frac {-2 a^{3} d x +6 a^{2} b d x -6 a \,b^{2} d x +2 b^{3} d x +b^{3} \tanh \left (d x +c \right )^{2}+6 \ln \left (1-\tanh \left (d x +c \right )\right ) a^{2} b +2 \ln \left (1-\tanh \left (d x +c \right )\right ) b^{3}+6 a \,b^{2} \tanh \left (d x +c \right )}{2 d}\) | \(94\) |
parts | \(a^{3} x +\frac {b^{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 \,b^{2} \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}+\frac {3 a^{2} b \ln \left (\cosh \left (d x +c \right )\right )}{d}\) | \(103\) |
risch | \(a^{3} x -3 b \,a^{2} x +3 a \,b^{2} x -b^{3} x -\frac {6 b c \,a^{2}}{d}-\frac {2 b^{3} c}{d}+\frac {2 b^{2} \left (3 \,{\mathrm e}^{2 d x +2 c} a +b \,{\mathrm e}^{2 d x +2 c}+3 a \right )}{d \left ({\mathrm e}^{2 d x +2 c}+1\right )^{2}}+\frac {3 b \ln \left ({\mathrm e}^{2 d x +2 c}+1\right ) a^{2}}{d}+\frac {b^{3} \ln \left ({\mathrm e}^{2 d x +2 c}+1\right )}{d}\) | \(134\) |
1/d*(-1/2*b^3*tanh(d*x+c)^2-3*a*b^2*tanh(d*x+c)-1/2*(a^3+3*a^2*b+3*a*b^2+b ^3)*ln(tanh(d*x+c)-1)+1/2*(a^3-3*a^2*b+3*a*b^2-b^3)*ln(tanh(d*x+c)+1))
Leaf count of result is larger than twice the leaf count of optimal. 646 vs. \(2 (67) = 134\).
Time = 0.26 (sec) , antiderivative size = 646, normalized size of antiderivative = 9.36 \[ \int (a+b \tanh (c+d x))^3 \, dx=\frac {{\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} d x \cosh \left (d x + c\right )^{4} + 4 \, {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} d x \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} d x \sinh \left (d x + c\right )^{4} + 6 \, a b^{2} + {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} d x + 2 \, {\left (3 \, a b^{2} + b^{3} + {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} d x\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} d x \cosh \left (d x + c\right )^{2} + 3 \, a b^{2} + b^{3} + {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} d x\right )} \sinh \left (d x + c\right )^{2} + {\left ({\left (3 \, a^{2} b + b^{3}\right )} \cosh \left (d x + c\right )^{4} + 4 \, {\left (3 \, a^{2} b + b^{3}\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (3 \, a^{2} b + b^{3}\right )} \sinh \left (d x + c\right )^{4} + 3 \, a^{2} b + b^{3} + 2 \, {\left (3 \, a^{2} b + b^{3}\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, a^{2} b + b^{3} + 3 \, {\left (3 \, a^{2} b + b^{3}\right )} \cosh \left (d x + c\right )^{2}\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left ({\left (3 \, a^{2} b + b^{3}\right )} \cosh \left (d x + c\right )^{3} + {\left (3 \, a^{2} b + b^{3}\right )} \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 ) + 4 \, {\left ({\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} d x \cosh \left (d x + c\right )^{3} + {\left (3 \, a b^{2} + b^{3} + {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} d x\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\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} \]
((a^3 - 3*a^2*b + 3*a*b^2 - b^3)*d*x*cosh(d*x + c)^4 + 4*(a^3 - 3*a^2*b + 3*a*b^2 - b^3)*d*x*cosh(d*x + c)*sinh(d*x + c)^3 + (a^3 - 3*a^2*b + 3*a*b^ 2 - b^3)*d*x*sinh(d*x + c)^4 + 6*a*b^2 + (a^3 - 3*a^2*b + 3*a*b^2 - b^3)*d *x + 2*(3*a*b^2 + b^3 + (a^3 - 3*a^2*b + 3*a*b^2 - b^3)*d*x)*cosh(d*x + c) ^2 + 2*(3*(a^3 - 3*a^2*b + 3*a*b^2 - b^3)*d*x*cosh(d*x + c)^2 + 3*a*b^2 + b^3 + (a^3 - 3*a^2*b + 3*a*b^2 - b^3)*d*x)*sinh(d*x + c)^2 + ((3*a^2*b + b ^3)*cosh(d*x + c)^4 + 4*(3*a^2*b + b^3)*cosh(d*x + c)*sinh(d*x + c)^3 + (3 *a^2*b + b^3)*sinh(d*x + c)^4 + 3*a^2*b + b^3 + 2*(3*a^2*b + b^3)*cosh(d*x + c)^2 + 2*(3*a^2*b + b^3 + 3*(3*a^2*b + b^3)*cosh(d*x + c)^2)*sinh(d*x + c)^2 + 4*((3*a^2*b + b^3)*cosh(d*x + c)^3 + (3*a^2*b + b^3)*cosh(d*x + c) )*sinh(d*x + c))*log(2*cosh(d*x + c)/(cosh(d*x + c) - sinh(d*x + c))) + 4* ((a^3 - 3*a^2*b + 3*a*b^2 - b^3)*d*x*cosh(d*x + c)^3 + (3*a*b^2 + b^3 + (a ^3 - 3*a^2*b + 3*a*b^2 - b^3)*d*x)*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*co sh(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.10 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.45 \[ \int (a+b \tanh (c+d x))^3 \, dx=\begin {cases} a^{3} x + 3 a^{2} b x - \frac {3 a^{2} b \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} + 3 a b^{2} x - \frac {3 a b^{2} \tanh {\left (c + d x \right )}}{d} + b^{3} x - \frac {b^{3} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {b^{3} \tanh ^{2}{\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \left (a + b \tanh {\left (c \right )}\right )^{3} & \text {otherwise} \end {cases} \]
Piecewise((a**3*x + 3*a**2*b*x - 3*a**2*b*log(tanh(c + d*x) + 1)/d + 3*a*b **2*x - 3*a*b**2*tanh(c + d*x)/d + b**3*x - b**3*log(tanh(c + d*x) + 1)/d - b**3*tanh(c + d*x)**2/(2*d), Ne(d, 0)), (x*(a + b*tanh(c))**3, True))
Time = 0.28 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.71 \[ \int (a+b \tanh (c+d x))^3 \, dx=b^{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 b^{2} {\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^{2} b \log \left (\cosh \left (d x + c\right )\right )}{d} \]
b^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*b^2*(x + c/d - 2/(d*(e^(-2*d* x - 2*c) + 1))) + a^3*x + 3*a^2*b*log(cosh(d*x + c))/d
Time = 0.28 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.41 \[ \int (a+b \tanh (c+d x))^3 \, dx=\frac {{\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} {\left (d x + c\right )} + {\left (3 \, a^{2} b + b^{3}\right )} \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) + \frac {2 \, {\left (3 \, a b^{2} + {\left (3 \, a b^{2} + b^{3}\right )} e^{\left (2 \, d x + 2 \, c\right )}\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{2}}}{d} \]
((a^3 - 3*a^2*b + 3*a*b^2 - b^3)*(d*x + c) + (3*a^2*b + b^3)*log(e^(2*d*x + 2*c) + 1) + 2*(3*a*b^2 + (3*a*b^2 + b^3)*e^(2*d*x + 2*c))/(e^(2*d*x + 2* c) + 1)^2)/d
Time = 1.66 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.12 \[ \int (a+b \tanh (c+d x))^3 \, dx=x\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )-\frac {\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )\,\left (3\,a^2\,b+b^3\right )}{d}-\frac {b^3\,{\mathrm {tanh}\left (c+d\,x\right )}^2}{2\,d}-\frac {3\,a\,b^2\,\mathrm {tanh}\left (c+d\,x\right )}{d} \]