\(\int (c+d x) (a+b \tanh (e+f x))^3 \, dx\) [65]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [C] (verification not implemented)
Sympy [F]
Maxima [A] (verification not implemented)
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 18, antiderivative size = 259 \[ \int (c+d x) (a+b \tanh (e+f x))^3 \, dx=\frac {b^3 d x}{2 f}+\frac {a^3 (c+d x)^2}{2 d}-\frac {3 a^2 b (c+d x)^2}{2 d}+\frac {3 a b^2 (c+d x)^2}{2 d}-\frac {b^3 (c+d x)^2}{2 d}+\frac {3 a^2 b (c+d x) \log \left (1+e^{2 (e+f x)}\right )}{f}+\frac {b^3 (c+d x) \log \left (1+e^{2 (e+f x)}\right )}{f}+\frac {3 a b^2 d \log (\cosh (e+f x))}{f^2}+\frac {3 a^2 b d \operatorname {PolyLog}\left (2,-e^{2 (e+f x)}\right )}{2 f^2}+\frac {b^3 d \operatorname {PolyLog}\left (2,-e^{2 (e+f x)}\right )}{2 f^2}-\frac {b^3 d \tanh (e+f x)}{2 f^2}-\frac {3 a b^2 (c+d x) \tanh (e+f x)}{f}-\frac {b^3 (c+d x) \tanh ^2(e+f x)}{2 f} \] Output:

1/2*b^3*d*x/f+1/2*a^3*(d*x+c)^2/d-3/2*a^2*b*(d*x+c)^2/d+3/2*a*b^2*(d*x+c)^ 
2/d-1/2*b^3*(d*x+c)^2/d+3*a^2*b*(d*x+c)*ln(1+exp(2*f*x+2*e))/f+b^3*(d*x+c) 
*ln(1+exp(2*f*x+2*e))/f+3*a*b^2*d*ln(cosh(f*x+e))/f^2+3/2*a^2*b*d*polylog( 
2,-exp(2*f*x+2*e))/f^2+1/2*b^3*d*polylog(2,-exp(2*f*x+2*e))/f^2-1/2*b^3*d* 
tanh(f*x+e)/f^2-3*a*b^2*(d*x+c)*tanh(f*x+e)/f-1/2*b^3*(d*x+c)*tanh(f*x+e)^ 
2/f
 

Mathematica [A] (verified)

Time = 7.42 (sec) , antiderivative size = 303, normalized size of antiderivative = 1.17 \[ \int (c+d x) (a+b \tanh (e+f x))^3 \, dx=\frac {\cosh (e+f x) \left (b^3 f (c+d x)-a \left (a^2+3 b^2\right ) (e+f x) (-2 c f+d (e-f x)) \cosh ^2(e+f x)+b \cosh ^2(e+f x) \left (\frac {3 a^2 f^2 (c+d x)^2}{d}+\frac {b^2 f^2 (c+d x)^2}{d}-6 a b d (e+f x)+4 \left (3 a^2+b^2\right ) (d e-c f) (e+f x)+2 \left (3 a^2+b^2\right ) d (e+f x) \log \left (1+e^{-2 (e+f x)}\right )+6 a b d \log \left (1+e^{2 (e+f x)}\right )-2 \left (3 a^2+b^2\right ) (d e-c f) \log \left (1+e^{2 (e+f x)}\right )-\left (3 a^2+b^2\right ) d \operatorname {PolyLog}\left (2,-e^{-2 (e+f x)}\right )\right )-\frac {1}{2} b^2 (b d+6 a f (c+d x)) \sinh (2 (e+f x))\right ) (a+b \tanh (e+f x))^3}{2 f^2 (a \cosh (e+f x)+b \sinh (e+f x))^3} \] Input:

Integrate[(c + d*x)*(a + b*Tanh[e + f*x])^3,x]
 

Output:

(Cosh[e + f*x]*(b^3*f*(c + d*x) - a*(a^2 + 3*b^2)*(e + f*x)*(-2*c*f + d*(e 
 - f*x))*Cosh[e + f*x]^2 + b*Cosh[e + f*x]^2*((3*a^2*f^2*(c + d*x)^2)/d + 
(b^2*f^2*(c + d*x)^2)/d - 6*a*b*d*(e + f*x) + 4*(3*a^2 + b^2)*(d*e - c*f)* 
(e + f*x) + 2*(3*a^2 + b^2)*d*(e + f*x)*Log[1 + E^(-2*(e + f*x))] + 6*a*b* 
d*Log[1 + E^(2*(e + f*x))] - 2*(3*a^2 + b^2)*(d*e - c*f)*Log[1 + E^(2*(e + 
 f*x))] - (3*a^2 + b^2)*d*PolyLog[2, -E^(-2*(e + f*x))]) - (b^2*(b*d + 6*a 
*f*(c + d*x))*Sinh[2*(e + f*x)])/2)*(a + b*Tanh[e + f*x])^3)/(2*f^2*(a*Cos 
h[e + f*x] + b*Sinh[e + f*x])^3)
 

Rubi [A] (verified)

Time = 0.69 (sec) , antiderivative size = 259, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3042, 4205, 2009}

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 (c+d x) (a+b \tanh (e+f x))^3 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (c+d x) (a-i b \tan (i e+i f x))^3dx\)

\(\Big \downarrow \) 4205

\(\displaystyle \int \left (a^3 (c+d x)+3 a^2 b (c+d x) \tanh (e+f x)+3 a b^2 (c+d x) \tanh ^2(e+f x)+b^3 (c+d x) \tanh ^3(e+f x)\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {a^3 (c+d x)^2}{2 d}+\frac {3 a^2 b (c+d x) \log \left (e^{2 (e+f x)}+1\right )}{f}-\frac {3 a^2 b (c+d x)^2}{2 d}+\frac {3 a^2 b d \operatorname {PolyLog}\left (2,-e^{2 (e+f x)}\right )}{2 f^2}-\frac {3 a b^2 (c+d x) \tanh (e+f x)}{f}+\frac {3 a b^2 (c+d x)^2}{2 d}+\frac {3 a b^2 d \log (\cosh (e+f x))}{f^2}+\frac {b^3 (c+d x) \log \left (e^{2 (e+f x)}+1\right )}{f}-\frac {b^3 (c+d x) \tanh ^2(e+f x)}{2 f}-\frac {b^3 (c+d x)^2}{2 d}+\frac {b^3 d \operatorname {PolyLog}\left (2,-e^{2 (e+f x)}\right )}{2 f^2}-\frac {b^3 d \tanh (e+f x)}{2 f^2}+\frac {b^3 d x}{2 f}\)

Input:

Int[(c + d*x)*(a + b*Tanh[e + f*x])^3,x]
 

Output:

(b^3*d*x)/(2*f) + (a^3*(c + d*x)^2)/(2*d) - (3*a^2*b*(c + d*x)^2)/(2*d) + 
(3*a*b^2*(c + d*x)^2)/(2*d) - (b^3*(c + d*x)^2)/(2*d) + (3*a^2*b*(c + d*x) 
*Log[1 + E^(2*(e + f*x))])/f + (b^3*(c + d*x)*Log[1 + E^(2*(e + f*x))])/f 
+ (3*a*b^2*d*Log[Cosh[e + f*x]])/f^2 + (3*a^2*b*d*PolyLog[2, -E^(2*(e + f* 
x))])/(2*f^2) + (b^3*d*PolyLog[2, -E^(2*(e + f*x))])/(2*f^2) - (b^3*d*Tanh 
[e + f*x])/(2*f^2) - (3*a*b^2*(c + d*x)*Tanh[e + f*x])/f - (b^3*(c + d*x)* 
Tanh[e + f*x]^2)/(2*f)
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4205
Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.) 
, x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, (a + b*Tan[e + f*x])^n, x], 
 x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[m, 0] && IGtQ[n, 0]
 
Maple [A] (verified)

Time = 1.24 (sec) , antiderivative size = 459, normalized size of antiderivative = 1.77

method result size
risch \(\frac {3 a^{2} b d \operatorname {polylog}\left (2, -{\mathrm e}^{2 f x +2 e}\right )}{2 f^{2}}+\frac {b^{3} d \operatorname {polylog}\left (2, -{\mathrm e}^{2 f x +2 e}\right )}{2 f^{2}}-\frac {b^{3} d \,e^{2}}{f^{2}}-\frac {2 b^{3} c \ln \left ({\mathrm e}^{f x +e}\right )}{f}+\frac {b^{3} c \ln \left (1+{\mathrm e}^{2 f x +2 e}\right )}{f}-\frac {3 a^{2} b d \,x^{2}}{2}+\frac {3 a \,b^{2} d \,x^{2}}{2}+3 a^{2} b c x +3 a \,b^{2} c x +\frac {b^{2} \left (6 a d f x \,{\mathrm e}^{2 f x +2 e}+2 b d f x \,{\mathrm e}^{2 f x +2 e}+6 a c f \,{\mathrm e}^{2 f x +2 e}+2 b c f \,{\mathrm e}^{2 f x +2 e}+6 a d f x +b \,{\mathrm e}^{2 f x +2 e} d +6 a c f +b d \right )}{f^{2} \left (1+{\mathrm e}^{2 f x +2 e}\right )^{2}}-\frac {3 b d \,a^{2} e^{2}}{f^{2}}+\frac {b^{3} d \ln \left (1+{\mathrm e}^{2 f x +2 e}\right ) x}{f}-\frac {6 b^{2} a d \ln \left ({\mathrm e}^{f x +e}\right )}{f^{2}}+\frac {3 b^{2} a d \ln \left (1+{\mathrm e}^{2 f x +2 e}\right )}{f^{2}}-\frac {6 b \,a^{2} c \ln \left ({\mathrm e}^{f x +e}\right )}{f}+\frac {3 b \,a^{2} c \ln \left (1+{\mathrm e}^{2 f x +2 e}\right )}{f}+\frac {2 b^{3} e d \ln \left ({\mathrm e}^{f x +e}\right )}{f^{2}}-\frac {2 b^{3} d e x}{f}+\frac {6 b e d \,a^{2} \ln \left ({\mathrm e}^{f x +e}\right )}{f^{2}}+\frac {3 b d \,a^{2} \ln \left (1+{\mathrm e}^{2 f x +2 e}\right ) x}{f}-\frac {6 b d \,a^{2} e x}{f}+\frac {a^{3} d \,x^{2}}{2}-\frac {b^{3} d \,x^{2}}{2}+a^{3} c x +b^{3} c x\) \(459\)

Input:

int((d*x+c)*(a+b*tanh(f*x+e))^3,x,method=_RETURNVERBOSE)
 

Output:

3/2*a^2*b*d*polylog(2,-exp(2*f*x+2*e))/f^2+1/2*b^3*d*polylog(2,-exp(2*f*x+ 
2*e))/f^2-1/f^2*b^3*d*e^2-2/f*b^3*c*ln(exp(f*x+e))+1/f*b^3*c*ln(1+exp(2*f* 
x+2*e))-3/2*a^2*b*d*x^2+3/2*a*b^2*d*x^2+3*a^2*b*c*x+3*a*b^2*c*x+b^2*(6*a*d 
*f*x*exp(2*f*x+2*e)+2*b*d*f*x*exp(2*f*x+2*e)+6*a*c*f*exp(2*f*x+2*e)+2*b*c* 
f*exp(2*f*x+2*e)+6*a*d*f*x+b*exp(2*f*x+2*e)*d+6*a*c*f+b*d)/f^2/(1+exp(2*f* 
x+2*e))^2-3/f^2*b*d*a^2*e^2+1/f*b^3*d*ln(1+exp(2*f*x+2*e))*x-6/f^2*b^2*a*d 
*ln(exp(f*x+e))+3/f^2*b^2*a*d*ln(1+exp(2*f*x+2*e))-6/f*b*a^2*c*ln(exp(f*x+ 
e))+3/f*b*a^2*c*ln(1+exp(2*f*x+2*e))+2/f^2*b^3*e*d*ln(exp(f*x+e))-2/f*b^3* 
d*e*x+6/f^2*b*e*d*a^2*ln(exp(f*x+e))+3/f*b*d*a^2*ln(1+exp(2*f*x+2*e))*x-6/ 
f*b*d*a^2*e*x+1/2*a^3*d*x^2-1/2*b^3*d*x^2+a^3*c*x+b^3*c*x
 

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.14 (sec) , antiderivative size = 3262, normalized size of antiderivative = 12.59 \[ \int (c+d x) (a+b \tanh (e+f x))^3 \, dx=\text {Too large to display} \] Input:

integrate((d*x+c)*(a+b*tanh(f*x+e))^3,x, algorithm="fricas")
 

Output:

Too large to include
 

Sympy [F]

\[ \int (c+d x) (a+b \tanh (e+f x))^3 \, dx=\int \left (a + b \tanh {\left (e + f x \right )}\right )^{3} \left (c + d x\right )\, dx \] Input:

integrate((d*x+c)*(a+b*tanh(f*x+e))**3,x)
 

Output:

Integral((a + b*tanh(e + f*x))**3*(c + d*x), x)
 

Maxima [A] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 475, normalized size of antiderivative = 1.83 \[ \int (c+d x) (a+b \tanh (e+f x))^3 \, dx=\frac {1}{2} \, a^{3} d x^{2} + b^{3} c {\left (x + \frac {e}{f} + \frac {\log \left (e^{\left (-2 \, f x - 2 \, e\right )} + 1\right )}{f} + \frac {2 \, e^{\left (-2 \, f x - 2 \, e\right )}}{f {\left (2 \, e^{\left (-2 \, f x - 2 \, e\right )} + e^{\left (-4 \, f x - 4 \, e\right )} + 1\right )}}\right )} + a^{3} c x - \frac {6 \, a b^{2} d x}{f} + \frac {3 \, a^{2} b c \log \left (\cosh \left (f x + e\right )\right )}{f} - {\left (3 \, a^{2} b d + b^{3} d\right )} x^{2} + \frac {3 \, a b^{2} d \log \left (e^{\left (2 \, f x + 2 \, e\right )} + 1\right )}{f^{2}} + \frac {12 \, a b^{2} c f + 6 \, {\left (c f^{2} + 2 \, d f\right )} a b^{2} x + 2 \, b^{3} d + {\left (3 \, a^{2} b d f^{2} + 3 \, a b^{2} d f^{2} + b^{3} d f^{2}\right )} x^{2} + {\left (6 \, a b^{2} c f^{2} x e^{\left (4 \, e\right )} + {\left (3 \, a^{2} b d f^{2} e^{\left (4 \, e\right )} + 3 \, a b^{2} d f^{2} e^{\left (4 \, e\right )} + b^{3} d f^{2} e^{\left (4 \, e\right )}\right )} x^{2}\right )} e^{\left (4 \, f x\right )} + 2 \, {\left (6 \, a b^{2} c f e^{\left (2 \, e\right )} + b^{3} d e^{\left (2 \, e\right )} + {\left (3 \, a^{2} b d f^{2} e^{\left (2 \, e\right )} + 3 \, a b^{2} d f^{2} e^{\left (2 \, e\right )} + b^{3} d f^{2} e^{\left (2 \, e\right )}\right )} x^{2} + 2 \, {\left (b^{3} d f e^{\left (2 \, e\right )} + 3 \, {\left (c f^{2} e^{\left (2 \, e\right )} + d f e^{\left (2 \, e\right )}\right )} a b^{2}\right )} x\right )} e^{\left (2 \, f x\right )}}{2 \, {\left (f^{2} e^{\left (4 \, f x + 4 \, e\right )} + 2 \, f^{2} e^{\left (2 \, f x + 2 \, e\right )} + f^{2}\right )}} + \frac {{\left (3 \, a^{2} b d + b^{3} d\right )} {\left (2 \, f x \log \left (e^{\left (2 \, f x + 2 \, e\right )} + 1\right ) + {\rm Li}_2\left (-e^{\left (2 \, f x + 2 \, e\right )}\right )\right )}}{2 \, f^{2}} \] Input:

integrate((d*x+c)*(a+b*tanh(f*x+e))^3,x, algorithm="maxima")
 

Output:

1/2*a^3*d*x^2 + b^3*c*(x + e/f + log(e^(-2*f*x - 2*e) + 1)/f + 2*e^(-2*f*x 
 - 2*e)/(f*(2*e^(-2*f*x - 2*e) + e^(-4*f*x - 4*e) + 1))) + a^3*c*x - 6*a*b 
^2*d*x/f + 3*a^2*b*c*log(cosh(f*x + e))/f - (3*a^2*b*d + b^3*d)*x^2 + 3*a* 
b^2*d*log(e^(2*f*x + 2*e) + 1)/f^2 + 1/2*(12*a*b^2*c*f + 6*(c*f^2 + 2*d*f) 
*a*b^2*x + 2*b^3*d + (3*a^2*b*d*f^2 + 3*a*b^2*d*f^2 + b^3*d*f^2)*x^2 + (6* 
a*b^2*c*f^2*x*e^(4*e) + (3*a^2*b*d*f^2*e^(4*e) + 3*a*b^2*d*f^2*e^(4*e) + b 
^3*d*f^2*e^(4*e))*x^2)*e^(4*f*x) + 2*(6*a*b^2*c*f*e^(2*e) + b^3*d*e^(2*e) 
+ (3*a^2*b*d*f^2*e^(2*e) + 3*a*b^2*d*f^2*e^(2*e) + b^3*d*f^2*e^(2*e))*x^2 
+ 2*(b^3*d*f*e^(2*e) + 3*(c*f^2*e^(2*e) + d*f*e^(2*e))*a*b^2)*x)*e^(2*f*x) 
)/(f^2*e^(4*f*x + 4*e) + 2*f^2*e^(2*f*x + 2*e) + f^2) + 1/2*(3*a^2*b*d + b 
^3*d)*(2*f*x*log(e^(2*f*x + 2*e) + 1) + dilog(-e^(2*f*x + 2*e)))/f^2
 

Giac [F]

\[ \int (c+d x) (a+b \tanh (e+f x))^3 \, dx=\int { {\left (d x + c\right )} {\left (b \tanh \left (f x + e\right ) + a\right )}^{3} \,d x } \] Input:

integrate((d*x+c)*(a+b*tanh(f*x+e))^3,x, algorithm="giac")
 

Output:

integrate((d*x + c)*(b*tanh(f*x + e) + a)^3, x)
 

Mupad [F(-1)]

Timed out. \[ \int (c+d x) (a+b \tanh (e+f x))^3 \, dx=\int {\left (a+b\,\mathrm {tanh}\left (e+f\,x\right )\right )}^3\,\left (c+d\,x\right ) \,d x \] Input:

int((a + b*tanh(e + f*x))^3*(c + d*x),x)
 

Output:

int((a + b*tanh(e + f*x))^3*(c + d*x), x)
 

Reduce [F]

\[ \int (c+d x) (a+b \tanh (e+f x))^3 \, dx =\text {Too large to display} \] Input:

int((d*x+c)*(a+b*tanh(f*x+e))^3,x)
                                                                                    
                                                                                    
 

Output:

( - 48*e**(4*e + 4*f*x)*int(x/(e**(6*e + 6*f*x) + 3*e**(4*e + 4*f*x) + 3*e 
**(2*e + 2*f*x) + 1),x)*a**2*b*d*f**2 - 16*e**(4*e + 4*f*x)*int(x/(e**(6*e 
 + 6*f*x) + 3*e**(4*e + 4*f*x) + 3*e**(2*e + 2*f*x) + 1),x)*b**3*d*f**2 + 
24*e**(4*e + 4*f*x)*log(e**(2*e + 2*f*x) + 1)*a**2*b*c*f + 18*e**(4*e + 4* 
f*x)*log(e**(2*e + 2*f*x) + 1)*a**2*b*d + 24*e**(4*e + 4*f*x)*log(e**(2*e 
+ 2*f*x) + 1)*a*b**2*d + 8*e**(4*e + 4*f*x)*log(e**(2*e + 2*f*x) + 1)*b**3 
*c*f + 6*e**(4*e + 4*f*x)*log(e**(2*e + 2*f*x) + 1)*b**3*d + 8*e**(4*e + 4 
*f*x)*a**3*c*f**2*x + 4*e**(4*e + 4*f*x)*a**3*d*f**2*x**2 - 24*e**(4*e + 4 
*f*x)*a**2*b*c*f**2*x + 12*e**(4*e + 4*f*x)*a**2*b*d*f**2*x**2 - 36*e**(4* 
e + 4*f*x)*a**2*b*d*f*x + 3*e**(4*e + 4*f*x)*a**2*b*d + 24*e**(4*e + 4*f*x 
)*a*b**2*c*f**2*x - 24*e**(4*e + 4*f*x)*a*b**2*c*f + 12*e**(4*e + 4*f*x)*a 
*b**2*d*f**2*x**2 - 48*e**(4*e + 4*f*x)*a*b**2*d*f*x - 8*e**(4*e + 4*f*x)* 
b**3*c*f**2*x - 8*e**(4*e + 4*f*x)*b**3*c*f + 4*e**(4*e + 4*f*x)*b**3*d*f* 
*2*x**2 - 12*e**(4*e + 4*f*x)*b**3*d*f*x - 3*e**(4*e + 4*f*x)*b**3*d - 96* 
e**(2*e + 2*f*x)*int(x/(e**(6*e + 6*f*x) + 3*e**(4*e + 4*f*x) + 3*e**(2*e 
+ 2*f*x) + 1),x)*a**2*b*d*f**2 - 32*e**(2*e + 2*f*x)*int(x/(e**(6*e + 6*f* 
x) + 3*e**(4*e + 4*f*x) + 3*e**(2*e + 2*f*x) + 1),x)*b**3*d*f**2 + 48*e**( 
2*e + 2*f*x)*log(e**(2*e + 2*f*x) + 1)*a**2*b*c*f + 36*e**(2*e + 2*f*x)*lo 
g(e**(2*e + 2*f*x) + 1)*a**2*b*d + 48*e**(2*e + 2*f*x)*log(e**(2*e + 2*f*x 
) + 1)*a*b**2*d + 16*e**(2*e + 2*f*x)*log(e**(2*e + 2*f*x) + 1)*b**3*c*...