\(\int (c+d x)^3 (a+a \cos (e+f x)) \, dx\) [118]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (warning: unable to verify)
Fricas [A] (verification not implemented)
Sympy [B] (verification not implemented)
Maxima [B] (verification not implemented)
Giac [A] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 18, antiderivative size = 89 \[ \int (c+d x)^3 (a+a \cos (e+f x)) \, dx=\frac {a (c+d x)^4}{4 d}-\frac {6 a d^3 \cos (e+f x)}{f^4}+\frac {3 a d (c+d x)^2 \cos (e+f x)}{f^2}-\frac {6 a d^2 (c+d x) \sin (e+f x)}{f^3}+\frac {a (c+d x)^3 \sin (e+f x)}{f} \] Output:

1/4*a*(d*x+c)^4/d-6*a*d^3*cos(f*x+e)/f^4+3*a*d*(d*x+c)^2*cos(f*x+e)/f^2-6* 
a*d^2*(d*x+c)*sin(f*x+e)/f^3+a*(d*x+c)^3*sin(f*x+e)/f
 

Mathematica [A] (verified)

Time = 0.61 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.37 \[ \int (c+d x)^3 (a+a \cos (e+f x)) \, dx=a \left (\frac {1}{4} x \left (4 c^3+6 c^2 d x+4 c d^2 x^2+d^3 x^3\right )+\frac {3 d \left (c^2 f^2+2 c d f^2 x+d^2 \left (-2+f^2 x^2\right )\right ) \cos (e+f x)}{f^4}+\frac {(c+d x) \left (c^2 f^2+2 c d f^2 x+d^2 \left (-6+f^2 x^2\right )\right ) \sin (e+f x)}{f^3}\right ) \] Input:

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

Output:

a*((x*(4*c^3 + 6*c^2*d*x + 4*c*d^2*x^2 + d^3*x^3))/4 + (3*d*(c^2*f^2 + 2*c 
*d*f^2*x + d^2*(-2 + f^2*x^2))*Cos[e + f*x])/f^4 + ((c + d*x)*(c^2*f^2 + 2 
*c*d*f^2*x + d^2*(-6 + f^2*x^2))*Sin[e + f*x])/f^3)
 

Rubi [A] (verified)

Time = 0.34 (sec) , antiderivative size = 89, 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, 3798, 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)^3 (a \cos (e+f x)+a) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (c+d x)^3 \left (a \sin \left (e+f x+\frac {\pi }{2}\right )+a\right )dx\)

\(\Big \downarrow \) 3798

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

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {6 a d^2 (c+d x) \sin (e+f x)}{f^3}+\frac {3 a d (c+d x)^2 \cos (e+f x)}{f^2}+\frac {a (c+d x)^3 \sin (e+f x)}{f}+\frac {a (c+d x)^4}{4 d}-\frac {6 a d^3 \cos (e+f x)}{f^4}\)

Input:

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

Output:

(a*(c + d*x)^4)/(4*d) - (6*a*d^3*Cos[e + f*x])/f^4 + (3*a*d*(c + d*x)^2*Co 
s[e + f*x])/f^2 - (6*a*d^2*(c + d*x)*Sin[e + f*x])/f^3 + (a*(c + d*x)^3*Si 
n[e + f*x])/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 3798
Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.) 
, x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, (a + b*Sin[e + f*x])^n, x], 
 x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[n, 0] && (EqQ[n, 1] || IGtQ[ 
m, 0] || NeQ[a^2 - b^2, 0])
 
Maple [A] (warning: unable to verify)

Time = 1.51 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.17

method result size
parallelrisch \(\frac {a \left (\left (d x +c \right ) \left (\left (d x +c \right )^{2} f^{2}-6 d^{2}\right ) f \sin \left (f x +e \right )+3 \left (\left (d x +c \right )^{2} f^{2}-2 d^{2}\right ) d \cos \left (f x +e \right )+\left (\frac {d x}{2}+c \right ) x \left (\frac {1}{2} x^{2} d^{2}+c d x +c^{2}\right ) f^{4}-3 c^{2} d \,f^{2}+6 d^{3}\right )}{f^{4}}\) \(104\)
risch \(\frac {a \,d^{3} x^{4}}{4}+a c \,d^{2} x^{3}+\frac {3 a d \,c^{2} x^{2}}{2}+a \,c^{3} x +\frac {a \,c^{4}}{4 d}+\frac {3 a d \left (d^{2} x^{2} f^{2}+2 c d \,f^{2} x +c^{2} f^{2}-2 d^{2}\right ) \cos \left (f x +e \right )}{f^{4}}+\frac {a \left (d^{3} f^{2} x^{3}+3 c \,d^{2} f^{2} x^{2}+3 c^{2} d \,f^{2} x +c^{3} f^{2}-6 d^{3} x -6 c \,d^{2}\right ) \sin \left (f x +e \right )}{f^{3}}\) \(152\)
norman \(\frac {\frac {6 a \,c^{2} d \,f^{2}-12 a \,d^{3}}{f^{4}}+a c \,d^{2} x^{3}+a c \,d^{2} x^{3} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+\frac {a c \left (c^{2} f^{2}+6 d^{2}\right ) x}{f^{2}}+\frac {a c \left (c^{2} f^{2}-6 d^{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{f^{2}}+\frac {a \,d^{3} x^{4}}{4}+\frac {a \,d^{3} x^{4} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{4}+\frac {2 a c \left (c^{2} f^{2}-6 d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f^{3}}+\frac {3 a d \left (c^{2} f^{2}+2 d^{2}\right ) x^{2}}{2 f^{2}}+\frac {2 a \,d^{3} x^{3} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}+\frac {6 a c \,d^{2} x^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}+\frac {6 a d \left (c^{2} f^{2}-2 d^{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f^{3}}+\frac {3 a d \left (c^{2} f^{2}-2 d^{2}\right ) x^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{2 f^{2}}}{1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}\) \(307\)
parts \(\frac {a \left (d x +c \right )^{4}}{4 d}+\frac {a \left (\frac {d^{3} \left (\left (f x +e \right )^{3} \sin \left (f x +e \right )+3 \left (f x +e \right )^{2} \cos \left (f x +e \right )-6 \cos \left (f x +e \right )-6 \left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{3}}+\frac {3 c \,d^{2} \left (\left (f x +e \right )^{2} \sin \left (f x +e \right )-2 \sin \left (f x +e \right )+2 \left (f x +e \right ) \cos \left (f x +e \right )\right )}{f^{2}}-\frac {3 d^{3} e \left (\left (f x +e \right )^{2} \sin \left (f x +e \right )-2 \sin \left (f x +e \right )+2 \left (f x +e \right ) \cos \left (f x +e \right )\right )}{f^{3}}+\frac {3 c^{2} d \left (\cos \left (f x +e \right )+\left (f x +e \right ) \sin \left (f x +e \right )\right )}{f}-\frac {6 c \,d^{2} e \left (\cos \left (f x +e \right )+\left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{2}}+\frac {3 d^{3} e^{2} \left (\cos \left (f x +e \right )+\left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{3}}+c^{3} \sin \left (f x +e \right )-\frac {3 c^{2} d e \sin \left (f x +e \right )}{f}+\frac {3 c \,d^{2} e^{2} \sin \left (f x +e \right )}{f^{2}}-\frac {d^{3} e^{3} \sin \left (f x +e \right )}{f^{3}}\right )}{f}\) \(317\)
orering \(\frac {\left (d^{5} f^{4} x^{6}+6 c \,d^{4} f^{4} x^{5}+15 c^{2} d^{3} f^{4} x^{4}+20 c^{3} d^{2} f^{4} x^{3}+14 c^{4} d \,f^{4} x^{2}+24 d^{5} f^{2} x^{4}+4 c^{5} f^{4} x +96 c \,d^{4} f^{2} x^{3}+156 c^{2} d^{3} f^{2} x^{2}+120 c^{3} d^{2} f^{2} x +24 c^{4} d \,f^{2}-240 d^{5} x^{2}-480 d^{4} c x -96 d^{3} c^{2}\right ) \left (a +\cos \left (f x +e \right ) a \right )}{4 f^{4} \left (d x +c \right )^{2}}-\frac {\left (5 d^{4} f^{2} x^{4}+20 c \,d^{3} f^{2} x^{3}+30 c^{2} d^{2} f^{2} x^{2}+20 c^{3} d \,f^{2} x +2 c^{4} f^{2}-48 d^{4} x^{2}-96 d^{3} c x -12 c^{2} d^{2}\right ) \left (3 \left (d x +c \right )^{2} \left (a +\cos \left (f x +e \right ) a \right ) d -\left (d x +c \right )^{3} f \sin \left (f x +e \right ) a \right )}{2 \left (d x +c \right )^{4} f^{4}}+\frac {x \left (d^{3} f^{2} x^{3}+4 c \,d^{2} f^{2} x^{2}+6 c^{2} d \,f^{2} x +4 c^{3} f^{2}-12 d^{3} x -24 c \,d^{2}\right ) \left (6 \left (d x +c \right ) \left (a +\cos \left (f x +e \right ) a \right ) d^{2}-6 \left (d x +c \right )^{2} f \sin \left (f x +e \right ) a d -\left (d x +c \right )^{3} f^{2} \cos \left (f x +e \right ) a \right )}{4 f^{4} \left (d x +c \right )^{3}}\) \(430\)
derivativedivides \(\frac {c^{3} a \sin \left (f x +e \right )-\frac {3 a \,c^{2} d e \sin \left (f x +e \right )}{f}+\frac {3 a \,c^{2} d \left (\cos \left (f x +e \right )+\left (f x +e \right ) \sin \left (f x +e \right )\right )}{f}+\frac {3 a c \,d^{2} e^{2} \sin \left (f x +e \right )}{f^{2}}-\frac {6 a c \,d^{2} e \left (\cos \left (f x +e \right )+\left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{2}}+\frac {3 a c \,d^{2} \left (\left (f x +e \right )^{2} \sin \left (f x +e \right )-2 \sin \left (f x +e \right )+2 \left (f x +e \right ) \cos \left (f x +e \right )\right )}{f^{2}}-\frac {a \,d^{3} e^{3} \sin \left (f x +e \right )}{f^{3}}+\frac {3 a \,d^{3} e^{2} \left (\cos \left (f x +e \right )+\left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{3}}-\frac {3 a \,d^{3} e \left (\left (f x +e \right )^{2} \sin \left (f x +e \right )-2 \sin \left (f x +e \right )+2 \left (f x +e \right ) \cos \left (f x +e \right )\right )}{f^{3}}+\frac {a \,d^{3} \left (\left (f x +e \right )^{3} \sin \left (f x +e \right )+3 \left (f x +e \right )^{2} \cos \left (f x +e \right )-6 \cos \left (f x +e \right )-6 \left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{3}}+c^{3} a \left (f x +e \right )-\frac {3 a \,c^{2} d e \left (f x +e \right )}{f}+\frac {3 a \,c^{2} d \left (f x +e \right )^{2}}{2 f}+\frac {3 a c \,d^{2} e^{2} \left (f x +e \right )}{f^{2}}-\frac {3 a c \,d^{2} e \left (f x +e \right )^{2}}{f^{2}}+\frac {a c \,d^{2} \left (f x +e \right )^{3}}{f^{2}}-\frac {a \,d^{3} e^{3} \left (f x +e \right )}{f^{3}}+\frac {3 a \,d^{3} e^{2} \left (f x +e \right )^{2}}{2 f^{3}}-\frac {a \,d^{3} e \left (f x +e \right )^{3}}{f^{3}}+\frac {a \,d^{3} \left (f x +e \right )^{4}}{4 f^{3}}}{f}\) \(476\)
default \(\frac {c^{3} a \sin \left (f x +e \right )-\frac {3 a \,c^{2} d e \sin \left (f x +e \right )}{f}+\frac {3 a \,c^{2} d \left (\cos \left (f x +e \right )+\left (f x +e \right ) \sin \left (f x +e \right )\right )}{f}+\frac {3 a c \,d^{2} e^{2} \sin \left (f x +e \right )}{f^{2}}-\frac {6 a c \,d^{2} e \left (\cos \left (f x +e \right )+\left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{2}}+\frac {3 a c \,d^{2} \left (\left (f x +e \right )^{2} \sin \left (f x +e \right )-2 \sin \left (f x +e \right )+2 \left (f x +e \right ) \cos \left (f x +e \right )\right )}{f^{2}}-\frac {a \,d^{3} e^{3} \sin \left (f x +e \right )}{f^{3}}+\frac {3 a \,d^{3} e^{2} \left (\cos \left (f x +e \right )+\left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{3}}-\frac {3 a \,d^{3} e \left (\left (f x +e \right )^{2} \sin \left (f x +e \right )-2 \sin \left (f x +e \right )+2 \left (f x +e \right ) \cos \left (f x +e \right )\right )}{f^{3}}+\frac {a \,d^{3} \left (\left (f x +e \right )^{3} \sin \left (f x +e \right )+3 \left (f x +e \right )^{2} \cos \left (f x +e \right )-6 \cos \left (f x +e \right )-6 \left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{3}}+c^{3} a \left (f x +e \right )-\frac {3 a \,c^{2} d e \left (f x +e \right )}{f}+\frac {3 a \,c^{2} d \left (f x +e \right )^{2}}{2 f}+\frac {3 a c \,d^{2} e^{2} \left (f x +e \right )}{f^{2}}-\frac {3 a c \,d^{2} e \left (f x +e \right )^{2}}{f^{2}}+\frac {a c \,d^{2} \left (f x +e \right )^{3}}{f^{2}}-\frac {a \,d^{3} e^{3} \left (f x +e \right )}{f^{3}}+\frac {3 a \,d^{3} e^{2} \left (f x +e \right )^{2}}{2 f^{3}}-\frac {a \,d^{3} e \left (f x +e \right )^{3}}{f^{3}}+\frac {a \,d^{3} \left (f x +e \right )^{4}}{4 f^{3}}}{f}\) \(476\)

Input:

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

Output:

a*((d*x+c)*((d*x+c)^2*f^2-6*d^2)*f*sin(f*x+e)+3*((d*x+c)^2*f^2-2*d^2)*d*co 
s(f*x+e)+(1/2*d*x+c)*x*(1/2*x^2*d^2+c*d*x+c^2)*f^4-3*c^2*d*f^2+6*d^3)/f^4
 

Fricas [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 168, normalized size of antiderivative = 1.89 \[ \int (c+d x)^3 (a+a \cos (e+f x)) \, dx=\frac {a d^{3} f^{4} x^{4} + 4 \, a c d^{2} f^{4} x^{3} + 6 \, a c^{2} d f^{4} x^{2} + 4 \, a c^{3} f^{4} x + 12 \, {\left (a d^{3} f^{2} x^{2} + 2 \, a c d^{2} f^{2} x + a c^{2} d f^{2} - 2 \, a d^{3}\right )} \cos \left (f x + e\right ) + 4 \, {\left (a d^{3} f^{3} x^{3} + 3 \, a c d^{2} f^{3} x^{2} + a c^{3} f^{3} - 6 \, a c d^{2} f + 3 \, {\left (a c^{2} d f^{3} - 2 \, a d^{3} f\right )} x\right )} \sin \left (f x + e\right )}{4 \, f^{4}} \] Input:

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

Output:

1/4*(a*d^3*f^4*x^4 + 4*a*c*d^2*f^4*x^3 + 6*a*c^2*d*f^4*x^2 + 4*a*c^3*f^4*x 
 + 12*(a*d^3*f^2*x^2 + 2*a*c*d^2*f^2*x + a*c^2*d*f^2 - 2*a*d^3)*cos(f*x + 
e) + 4*(a*d^3*f^3*x^3 + 3*a*c*d^2*f^3*x^2 + a*c^3*f^3 - 6*a*c*d^2*f + 3*(a 
*c^2*d*f^3 - 2*a*d^3*f)*x)*sin(f*x + e))/f^4
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 264 vs. \(2 (88) = 176\).

Time = 0.27 (sec) , antiderivative size = 264, normalized size of antiderivative = 2.97 \[ \int (c+d x)^3 (a+a \cos (e+f x)) \, dx=\begin {cases} a c^{3} x + \frac {a c^{3} \sin {\left (e + f x \right )}}{f} + \frac {3 a c^{2} d x^{2}}{2} + \frac {3 a c^{2} d x \sin {\left (e + f x \right )}}{f} + \frac {3 a c^{2} d \cos {\left (e + f x \right )}}{f^{2}} + a c d^{2} x^{3} + \frac {3 a c d^{2} x^{2} \sin {\left (e + f x \right )}}{f} + \frac {6 a c d^{2} x \cos {\left (e + f x \right )}}{f^{2}} - \frac {6 a c d^{2} \sin {\left (e + f x \right )}}{f^{3}} + \frac {a d^{3} x^{4}}{4} + \frac {a d^{3} x^{3} \sin {\left (e + f x \right )}}{f} + \frac {3 a d^{3} x^{2} \cos {\left (e + f x \right )}}{f^{2}} - \frac {6 a d^{3} x \sin {\left (e + f x \right )}}{f^{3}} - \frac {6 a d^{3} \cos {\left (e + f x \right )}}{f^{4}} & \text {for}\: f \neq 0 \\\left (a \cos {\left (e \right )} + a\right ) \left (c^{3} x + \frac {3 c^{2} d x^{2}}{2} + c d^{2} x^{3} + \frac {d^{3} x^{4}}{4}\right ) & \text {otherwise} \end {cases} \] Input:

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

Output:

Piecewise((a*c**3*x + a*c**3*sin(e + f*x)/f + 3*a*c**2*d*x**2/2 + 3*a*c**2 
*d*x*sin(e + f*x)/f + 3*a*c**2*d*cos(e + f*x)/f**2 + a*c*d**2*x**3 + 3*a*c 
*d**2*x**2*sin(e + f*x)/f + 6*a*c*d**2*x*cos(e + f*x)/f**2 - 6*a*c*d**2*si 
n(e + f*x)/f**3 + a*d**3*x**4/4 + a*d**3*x**3*sin(e + f*x)/f + 3*a*d**3*x* 
*2*cos(e + f*x)/f**2 - 6*a*d**3*x*sin(e + f*x)/f**3 - 6*a*d**3*cos(e + f*x 
)/f**4, Ne(f, 0)), ((a*cos(e) + a)*(c**3*x + 3*c**2*d*x**2/2 + c*d**2*x**3 
 + d**3*x**4/4), True))
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 456 vs. \(2 (87) = 174\).

Time = 0.05 (sec) , antiderivative size = 456, normalized size of antiderivative = 5.12 \[ \int (c+d x)^3 (a+a \cos (e+f x)) \, dx=\frac {4 \, {\left (f x + e\right )} a c^{3} + \frac {{\left (f x + e\right )}^{4} a d^{3}}{f^{3}} - \frac {4 \, {\left (f x + e\right )}^{3} a d^{3} e}{f^{3}} + \frac {6 \, {\left (f x + e\right )}^{2} a d^{3} e^{2}}{f^{3}} - \frac {4 \, {\left (f x + e\right )} a d^{3} e^{3}}{f^{3}} + \frac {4 \, {\left (f x + e\right )}^{3} a c d^{2}}{f^{2}} - \frac {12 \, {\left (f x + e\right )}^{2} a c d^{2} e}{f^{2}} + \frac {12 \, {\left (f x + e\right )} a c d^{2} e^{2}}{f^{2}} + \frac {6 \, {\left (f x + e\right )}^{2} a c^{2} d}{f} - \frac {12 \, {\left (f x + e\right )} a c^{2} d e}{f} + 4 \, a c^{3} \sin \left (f x + e\right ) - \frac {4 \, a d^{3} e^{3} \sin \left (f x + e\right )}{f^{3}} + \frac {12 \, a c d^{2} e^{2} \sin \left (f x + e\right )}{f^{2}} - \frac {12 \, a c^{2} d e \sin \left (f x + e\right )}{f} + \frac {12 \, {\left ({\left (f x + e\right )} \sin \left (f x + e\right ) + \cos \left (f x + e\right )\right )} a d^{3} e^{2}}{f^{3}} - \frac {24 \, {\left ({\left (f x + e\right )} \sin \left (f x + e\right ) + \cos \left (f x + e\right )\right )} a c d^{2} e}{f^{2}} + \frac {12 \, {\left ({\left (f x + e\right )} \sin \left (f x + e\right ) + \cos \left (f x + e\right )\right )} a c^{2} d}{f} - \frac {12 \, {\left (2 \, {\left (f x + e\right )} \cos \left (f x + e\right ) + {\left ({\left (f x + e\right )}^{2} - 2\right )} \sin \left (f x + e\right )\right )} a d^{3} e}{f^{3}} + \frac {12 \, {\left (2 \, {\left (f x + e\right )} \cos \left (f x + e\right ) + {\left ({\left (f x + e\right )}^{2} - 2\right )} \sin \left (f x + e\right )\right )} a c d^{2}}{f^{2}} + \frac {4 \, {\left (3 \, {\left ({\left (f x + e\right )}^{2} - 2\right )} \cos \left (f x + e\right ) + {\left ({\left (f x + e\right )}^{3} - 6 \, f x - 6 \, e\right )} \sin \left (f x + e\right )\right )} a d^{3}}{f^{3}}}{4 \, f} \] Input:

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

Output:

1/4*(4*(f*x + e)*a*c^3 + (f*x + e)^4*a*d^3/f^3 - 4*(f*x + e)^3*a*d^3*e/f^3 
 + 6*(f*x + e)^2*a*d^3*e^2/f^3 - 4*(f*x + e)*a*d^3*e^3/f^3 + 4*(f*x + e)^3 
*a*c*d^2/f^2 - 12*(f*x + e)^2*a*c*d^2*e/f^2 + 12*(f*x + e)*a*c*d^2*e^2/f^2 
 + 6*(f*x + e)^2*a*c^2*d/f - 12*(f*x + e)*a*c^2*d*e/f + 4*a*c^3*sin(f*x + 
e) - 4*a*d^3*e^3*sin(f*x + e)/f^3 + 12*a*c*d^2*e^2*sin(f*x + e)/f^2 - 12*a 
*c^2*d*e*sin(f*x + e)/f + 12*((f*x + e)*sin(f*x + e) + cos(f*x + e))*a*d^3 
*e^2/f^3 - 24*((f*x + e)*sin(f*x + e) + cos(f*x + e))*a*c*d^2*e/f^2 + 12*( 
(f*x + e)*sin(f*x + e) + cos(f*x + e))*a*c^2*d/f - 12*(2*(f*x + e)*cos(f*x 
 + e) + ((f*x + e)^2 - 2)*sin(f*x + e))*a*d^3*e/f^3 + 12*(2*(f*x + e)*cos( 
f*x + e) + ((f*x + e)^2 - 2)*sin(f*x + e))*a*c*d^2/f^2 + 4*(3*((f*x + e)^2 
 - 2)*cos(f*x + e) + ((f*x + e)^3 - 6*f*x - 6*e)*sin(f*x + e))*a*d^3/f^3)/ 
f
 

Giac [A] (verification not implemented)

Time = 0.37 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.73 \[ \int (c+d x)^3 (a+a \cos (e+f x)) \, dx=\frac {1}{4} \, a d^{3} x^{4} + a c d^{2} x^{3} + \frac {3}{2} \, a c^{2} d x^{2} + a c^{3} x + \frac {3 \, {\left (a d^{3} f^{2} x^{2} + 2 \, a c d^{2} f^{2} x + a c^{2} d f^{2} - 2 \, a d^{3}\right )} \cos \left (f x + e\right )}{f^{4}} + \frac {{\left (a d^{3} f^{3} x^{3} + 3 \, a c d^{2} f^{3} x^{2} + 3 \, a c^{2} d f^{3} x + a c^{3} f^{3} - 6 \, a d^{3} f x - 6 \, a c d^{2} f\right )} \sin \left (f x + e\right )}{f^{4}} \] Input:

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

Output:

1/4*a*d^3*x^4 + a*c*d^2*x^3 + 3/2*a*c^2*d*x^2 + a*c^3*x + 3*(a*d^3*f^2*x^2 
 + 2*a*c*d^2*f^2*x + a*c^2*d*f^2 - 2*a*d^3)*cos(f*x + e)/f^4 + (a*d^3*f^3* 
x^3 + 3*a*c*d^2*f^3*x^2 + 3*a*c^2*d*f^3*x + a*c^3*f^3 - 6*a*d^3*f*x - 6*a* 
c*d^2*f)*sin(f*x + e)/f^4
 

Mupad [B] (verification not implemented)

Time = 40.55 (sec) , antiderivative size = 189, normalized size of antiderivative = 2.12 \[ \int (c+d x)^3 (a+a \cos (e+f x)) \, dx=\frac {\sin \left (e+f\,x\right )\,\left (a\,c^3\,f^2-6\,a\,c\,d^2\right )}{f^3}-\frac {3\,\cos \left (e+f\,x\right )\,\left (2\,a\,d^3-a\,c^2\,d\,f^2\right )}{f^4}+\frac {a\,d^3\,x^4}{4}+a\,c^3\,x-\frac {3\,x\,\sin \left (e+f\,x\right )\,\left (2\,a\,d^3-a\,c^2\,d\,f^2\right )}{f^3}+\frac {3\,a\,c^2\,d\,x^2}{2}+a\,c\,d^2\,x^3+\frac {3\,a\,d^3\,x^2\,\cos \left (e+f\,x\right )}{f^2}+\frac {a\,d^3\,x^3\,\sin \left (e+f\,x\right )}{f}+\frac {6\,a\,c\,d^2\,x\,\cos \left (e+f\,x\right )}{f^2}+\frac {3\,a\,c\,d^2\,x^2\,\sin \left (e+f\,x\right )}{f} \] Input:

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

Output:

(sin(e + f*x)*(a*c^3*f^2 - 6*a*c*d^2))/f^3 - (3*cos(e + f*x)*(2*a*d^3 - a* 
c^2*d*f^2))/f^4 + (a*d^3*x^4)/4 + a*c^3*x - (3*x*sin(e + f*x)*(2*a*d^3 - a 
*c^2*d*f^2))/f^3 + (3*a*c^2*d*x^2)/2 + a*c*d^2*x^3 + (3*a*d^3*x^2*cos(e + 
f*x))/f^2 + (a*d^3*x^3*sin(e + f*x))/f + (6*a*c*d^2*x*cos(e + f*x))/f^2 + 
(3*a*c*d^2*x^2*sin(e + f*x))/f
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 200, normalized size of antiderivative = 2.25 \[ \int (c+d x)^3 (a+a \cos (e+f x)) \, dx=\frac {a \left (12 \cos \left (f x +e \right ) c^{2} d \,f^{2}+24 \cos \left (f x +e \right ) c \,d^{2} f^{2} x +12 \cos \left (f x +e \right ) d^{3} f^{2} x^{2}-24 \cos \left (f x +e \right ) d^{3}+4 \sin \left (f x +e \right ) c^{3} f^{3}+12 \sin \left (f x +e \right ) c^{2} d \,f^{3} x +12 \sin \left (f x +e \right ) c \,d^{2} f^{3} x^{2}-24 \sin \left (f x +e \right ) c \,d^{2} f +4 \sin \left (f x +e \right ) d^{3} f^{3} x^{3}-24 \sin \left (f x +e \right ) d^{3} f x +4 c^{3} f^{4} x +6 c^{2} d \,f^{4} x^{2}+4 c \,d^{2} f^{4} x^{3}+d^{3} f^{4} x^{4}\right )}{4 f^{4}} \] Input:

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

Output:

(a*(12*cos(e + f*x)*c**2*d*f**2 + 24*cos(e + f*x)*c*d**2*f**2*x + 12*cos(e 
 + f*x)*d**3*f**2*x**2 - 24*cos(e + f*x)*d**3 + 4*sin(e + f*x)*c**3*f**3 + 
 12*sin(e + f*x)*c**2*d*f**3*x + 12*sin(e + f*x)*c*d**2*f**3*x**2 - 24*sin 
(e + f*x)*c*d**2*f + 4*sin(e + f*x)*d**3*f**3*x**3 - 24*sin(e + f*x)*d**3* 
f*x + 4*c**3*f**4*x + 6*c**2*d*f**4*x**2 + 4*c*d**2*f**4*x**3 + d**3*f**4* 
x**4))/(4*f**4)