Integrand size = 18, antiderivative size = 67 \[ \int (c+d x)^2 (a+a \cos (e+f x)) \, dx=\frac {a (c+d x)^3}{3 d}+\frac {2 a d (c+d x) \cos (e+f x)}{f^2}-\frac {2 a d^2 \sin (e+f x)}{f^3}+\frac {a (c+d x)^2 \sin (e+f x)}{f} \] Output:
1/3*a*(d*x+c)^3/d+2*a*d*(d*x+c)*cos(f*x+e)/f^2-2*a*d^2*sin(f*x+e)/f^3+a*(d *x+c)^2*sin(f*x+e)/f
Time = 0.40 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.19 \[ \int (c+d x)^2 (a+a \cos (e+f x)) \, dx=a \left (c^2 x+c d x^2+\frac {d^2 x^3}{3}+\frac {2 d (c+d x) \cos (e+f x)}{f^2}+\frac {\left (c^2 f^2+2 c d f^2 x+d^2 \left (-2+f^2 x^2\right )\right ) \sin (e+f x)}{f^3}\right ) \] Input:
Integrate[(c + d*x)^2*(a + a*Cos[e + f*x]),x]
Output:
a*(c^2*x + c*d*x^2 + (d^2*x^3)/3 + (2*d*(c + d*x)*Cos[e + f*x])/f^2 + ((c^ 2*f^2 + 2*c*d*f^2*x + d^2*(-2 + f^2*x^2))*Sin[e + f*x])/f^3)
Time = 0.30 (sec) , antiderivative size = 67, 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)^2 (a \cos (e+f x)+a) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (c+d x)^2 \left (a \sin \left (e+f x+\frac {\pi }{2}\right )+a\right )dx\) |
\(\Big \downarrow \) 3798 |
\(\displaystyle \int \left (a (c+d x)^2 \cos (e+f x)+a (c+d x)^2\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {2 a d (c+d x) \cos (e+f x)}{f^2}+\frac {a (c+d x)^2 \sin (e+f x)}{f}+\frac {a (c+d x)^3}{3 d}-\frac {2 a d^2 \sin (e+f x)}{f^3}\) |
Input:
Int[(c + d*x)^2*(a + a*Cos[e + f*x]),x]
Output:
(a*(c + d*x)^3)/(3*d) + (2*a*d*(c + d*x)*Cos[e + f*x])/f^2 - (2*a*d^2*Sin[ e + f*x])/f^3 + (a*(c + d*x)^2*Sin[e + f*x])/f
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])
Time = 1.33 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.15
method | result | size |
parallelrisch | \(\frac {a \left (\left (\left (d x +c \right )^{2} f^{2}-2 d^{2}\right ) \sin \left (f x +e \right )+f \left (\left (2 d^{2} x +2 c d \right ) \cos \left (f x +e \right )+x \left (\frac {1}{3} x^{2} d^{2}+c d x +c^{2}\right ) f^{2}-2 c d \right )\right )}{f^{3}}\) | \(77\) |
risch | \(\frac {d^{2} a \,x^{3}}{3}+c d a \,x^{2}+a \,c^{2} x +\frac {a \,c^{3}}{3 d}+\frac {2 a d \left (d x +c \right ) \cos \left (f x +e \right )}{f^{2}}+\frac {a \left (d^{2} x^{2} f^{2}+2 c d \,f^{2} x +c^{2} f^{2}-2 d^{2}\right ) \sin \left (f x +e \right )}{f^{3}}\) | \(93\) |
parts | \(\frac {a \left (d x +c \right )^{3}}{3 d}+\frac {a \left (\frac {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 {2 c d \left (\cos \left (f x +e \right )+\left (f x +e \right ) \sin \left (f x +e \right )\right )}{f}-\frac {2 d^{2} e \left (\cos \left (f x +e \right )+\left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{2}}+c^{2} \sin \left (f x +e \right )-\frac {2 c d e \sin \left (f x +e \right )}{f}+\frac {d^{2} e^{2} \sin \left (f x +e \right )}{f^{2}}\right )}{f}\) | \(158\) |
norman | \(\frac {\frac {a \left (c^{2} f^{2}+2 d^{2}\right ) x}{f^{2}}+c d a \,x^{2}+c d a \,x^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+\frac {a \left (c^{2} f^{2}-2 d^{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{f^{2}}+\frac {d^{2} a \,x^{3}}{3}-\frac {4 c d a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{f^{2}}+\frac {2 a \left (c^{2} f^{2}-2 d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f^{3}}+\frac {d^{2} a \,x^{3} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{3}+\frac {2 d^{2} a \,x^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}+\frac {4 c d a x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}}{1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}\) | \(207\) |
derivativedivides | \(\frac {a \,c^{2} \sin \left (f x +e \right )-\frac {2 a c d e \sin \left (f x +e \right )}{f}+\frac {2 a c d \left (\cos \left (f x +e \right )+\left (f x +e \right ) \sin \left (f x +e \right )\right )}{f}+\frac {a \,d^{2} e^{2} \sin \left (f x +e \right )}{f^{2}}-\frac {2 a \,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 {a \,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}}+a \,c^{2} \left (f x +e \right )-\frac {2 a c d e \left (f x +e \right )}{f}+\frac {a c d \left (f x +e \right )^{2}}{f}+\frac {a \,d^{2} e^{2} \left (f x +e \right )}{f^{2}}-\frac {a \,d^{2} e \left (f x +e \right )^{2}}{f^{2}}+\frac {a \,d^{2} \left (f x +e \right )^{3}}{3 f^{2}}}{f}\) | \(236\) |
default | \(\frac {a \,c^{2} \sin \left (f x +e \right )-\frac {2 a c d e \sin \left (f x +e \right )}{f}+\frac {2 a c d \left (\cos \left (f x +e \right )+\left (f x +e \right ) \sin \left (f x +e \right )\right )}{f}+\frac {a \,d^{2} e^{2} \sin \left (f x +e \right )}{f^{2}}-\frac {2 a \,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 {a \,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}}+a \,c^{2} \left (f x +e \right )-\frac {2 a c d e \left (f x +e \right )}{f}+\frac {a c d \left (f x +e \right )^{2}}{f}+\frac {a \,d^{2} e^{2} \left (f x +e \right )}{f^{2}}-\frac {a \,d^{2} e \left (f x +e \right )^{2}}{f^{2}}+\frac {a \,d^{2} \left (f x +e \right )^{3}}{3 f^{2}}}{f}\) | \(236\) |
orering | \(\frac {\left (d^{4} f^{4} x^{5}+5 c \,d^{3} f^{4} x^{4}+10 c^{2} d^{2} f^{4} x^{3}+9 c^{3} d \,f^{4} x^{2}+3 c^{4} f^{4} x +12 d^{4} f^{2} x^{3}+42 c \,d^{3} f^{2} x^{2}+48 c^{2} d^{2} f^{2} x +12 c^{3} d \,f^{2}-48 d^{4} x -12 d^{3} c \right ) \left (a +\cos \left (f x +e \right ) a \right )}{3 f^{4} \left (d x +c \right )^{2}}-\frac {\left (7 d^{3} f^{2} x^{3}+21 c \,d^{2} f^{2} x^{2}+21 c^{2} d \,f^{2} x +3 c^{3} f^{2}-30 d^{3} x -6 c \,d^{2}\right ) \left (2 \left (d x +c \right ) \left (a +\cos \left (f x +e \right ) a \right ) d -\left (d x +c \right )^{2} f \sin \left (f x +e \right ) a \right )}{3 f^{4} \left (d x +c \right )^{3}}+\frac {x \left (d^{2} x^{2} f^{2}+3 c d \,f^{2} x +3 c^{2} f^{2}-6 d^{2}\right ) \left (2 d^{2} \left (a +\cos \left (f x +e \right ) a \right )-4 \left (d x +c \right ) f \sin \left (f x +e \right ) a d -\left (d x +c \right )^{2} f^{2} \cos \left (f x +e \right ) a \right )}{3 f^{4} \left (d x +c \right )^{2}}\) | \(336\) |
Input:
int((d*x+c)^2*(a+cos(f*x+e)*a),x,method=_RETURNVERBOSE)
Output:
a*(((d*x+c)^2*f^2-2*d^2)*sin(f*x+e)+f*((2*d^2*x+2*c*d)*cos(f*x+e)+x*(1/3*x ^2*d^2+c*d*x+c^2)*f^2-2*c*d))/f^3
Time = 0.08 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.52 \[ \int (c+d x)^2 (a+a \cos (e+f x)) \, dx=\frac {a d^{2} f^{3} x^{3} + 3 \, a c d f^{3} x^{2} + 3 \, a c^{2} f^{3} x + 6 \, {\left (a d^{2} f x + a c d f\right )} \cos \left (f x + e\right ) + 3 \, {\left (a d^{2} f^{2} x^{2} + 2 \, a c d f^{2} x + a c^{2} f^{2} - 2 \, a d^{2}\right )} \sin \left (f x + e\right )}{3 \, f^{3}} \] Input:
integrate((d*x+c)^2*(a+a*cos(f*x+e)),x, algorithm="fricas")
Output:
1/3*(a*d^2*f^3*x^3 + 3*a*c*d*f^3*x^2 + 3*a*c^2*f^3*x + 6*(a*d^2*f*x + a*c* d*f)*cos(f*x + e) + 3*(a*d^2*f^2*x^2 + 2*a*c*d*f^2*x + a*c^2*f^2 - 2*a*d^2 )*sin(f*x + e))/f^3
Leaf count of result is larger than twice the leaf count of optimal. 151 vs. \(2 (65) = 130\).
Time = 0.20 (sec) , antiderivative size = 151, normalized size of antiderivative = 2.25 \[ \int (c+d x)^2 (a+a \cos (e+f x)) \, dx=\begin {cases} a c^{2} x + \frac {a c^{2} \sin {\left (e + f x \right )}}{f} + a c d x^{2} + \frac {2 a c d x \sin {\left (e + f x \right )}}{f} + \frac {2 a c d \cos {\left (e + f x \right )}}{f^{2}} + \frac {a d^{2} x^{3}}{3} + \frac {a d^{2} x^{2} \sin {\left (e + f x \right )}}{f} + \frac {2 a d^{2} x \cos {\left (e + f x \right )}}{f^{2}} - \frac {2 a d^{2} \sin {\left (e + f x \right )}}{f^{3}} & \text {for}\: f \neq 0 \\\left (a \cos {\left (e \right )} + a\right ) \left (c^{2} x + c d x^{2} + \frac {d^{2} x^{3}}{3}\right ) & \text {otherwise} \end {cases} \] Input:
integrate((d*x+c)**2*(a+a*cos(f*x+e)),x)
Output:
Piecewise((a*c**2*x + a*c**2*sin(e + f*x)/f + a*c*d*x**2 + 2*a*c*d*x*sin(e + f*x)/f + 2*a*c*d*cos(e + f*x)/f**2 + a*d**2*x**3/3 + a*d**2*x**2*sin(e + f*x)/f + 2*a*d**2*x*cos(e + f*x)/f**2 - 2*a*d**2*sin(e + f*x)/f**3, Ne(f , 0)), ((a*cos(e) + a)*(c**2*x + c*d*x**2 + d**2*x**3/3), True))
Leaf count of result is larger than twice the leaf count of optimal. 235 vs. \(2 (65) = 130\).
Time = 0.04 (sec) , antiderivative size = 235, normalized size of antiderivative = 3.51 \[ \int (c+d x)^2 (a+a \cos (e+f x)) \, dx=\frac {3 \, {\left (f x + e\right )} a c^{2} + \frac {{\left (f x + e\right )}^{3} a d^{2}}{f^{2}} - \frac {3 \, {\left (f x + e\right )}^{2} a d^{2} e}{f^{2}} + \frac {3 \, {\left (f x + e\right )} a d^{2} e^{2}}{f^{2}} + \frac {3 \, {\left (f x + e\right )}^{2} a c d}{f} - \frac {6 \, {\left (f x + e\right )} a c d e}{f} + 3 \, a c^{2} \sin \left (f x + e\right ) + \frac {3 \, a d^{2} e^{2} \sin \left (f x + e\right )}{f^{2}} - \frac {6 \, a c d e \sin \left (f x + e\right )}{f} - \frac {6 \, {\left ({\left (f x + e\right )} \sin \left (f x + e\right ) + \cos \left (f x + e\right )\right )} a d^{2} e}{f^{2}} + \frac {6 \, {\left ({\left (f x + e\right )} \sin \left (f x + e\right ) + \cos \left (f x + e\right )\right )} a c d}{f} + \frac {3 \, {\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^{2}}{f^{2}}}{3 \, f} \] Input:
integrate((d*x+c)^2*(a+a*cos(f*x+e)),x, algorithm="maxima")
Output:
1/3*(3*(f*x + e)*a*c^2 + (f*x + e)^3*a*d^2/f^2 - 3*(f*x + e)^2*a*d^2*e/f^2 + 3*(f*x + e)*a*d^2*e^2/f^2 + 3*(f*x + e)^2*a*c*d/f - 6*(f*x + e)*a*c*d*e /f + 3*a*c^2*sin(f*x + e) + 3*a*d^2*e^2*sin(f*x + e)/f^2 - 6*a*c*d*e*sin(f *x + e)/f - 6*((f*x + e)*sin(f*x + e) + cos(f*x + e))*a*d^2*e/f^2 + 6*((f* x + e)*sin(f*x + e) + cos(f*x + e))*a*c*d/f + 3*(2*(f*x + e)*cos(f*x + e) + ((f*x + e)^2 - 2)*sin(f*x + e))*a*d^2/f^2)/f
Time = 0.32 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.37 \[ \int (c+d x)^2 (a+a \cos (e+f x)) \, dx=\frac {1}{3} \, a d^{2} x^{3} + a c d x^{2} + a c^{2} x + \frac {2 \, {\left (a d^{2} f x + a c d f\right )} \cos \left (f x + e\right )}{f^{3}} + \frac {{\left (a d^{2} f^{2} x^{2} + 2 \, a c d f^{2} x + a c^{2} f^{2} - 2 \, a d^{2}\right )} \sin \left (f x + e\right )}{f^{3}} \] Input:
integrate((d*x+c)^2*(a+a*cos(f*x+e)),x, algorithm="giac")
Output:
1/3*a*d^2*x^3 + a*c*d*x^2 + a*c^2*x + 2*(a*d^2*f*x + a*c*d*f)*cos(f*x + e) /f^3 + (a*d^2*f^2*x^2 + 2*a*c*d*f^2*x + a*c^2*f^2 - 2*a*d^2)*sin(f*x + e)/ f^3
Time = 40.52 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.67 \[ \int (c+d x)^2 (a+a \cos (e+f x)) \, dx=\frac {a\,d^2\,x^3}{3}-\frac {\sin \left (e+f\,x\right )\,\left (2\,a\,d^2-a\,c^2\,f^2\right )}{f^3}+a\,c^2\,x+a\,c\,d\,x^2+\frac {2\,a\,d^2\,x\,\cos \left (e+f\,x\right )}{f^2}+\frac {a\,d^2\,x^2\,\sin \left (e+f\,x\right )}{f}+\frac {2\,a\,c\,d\,\cos \left (e+f\,x\right )}{f^2}+\frac {2\,a\,c\,d\,x\,\sin \left (e+f\,x\right )}{f} \] Input:
int((a + a*cos(e + f*x))*(c + d*x)^2,x)
Output:
(a*d^2*x^3)/3 - (sin(e + f*x)*(2*a*d^2 - a*c^2*f^2))/f^3 + a*c^2*x + a*c*d *x^2 + (2*a*d^2*x*cos(e + f*x))/f^2 + (a*d^2*x^2*sin(e + f*x))/f + (2*a*c* d*cos(e + f*x))/f^2 + (2*a*c*d*x*sin(e + f*x))/f
Time = 0.17 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.73 \[ \int (c+d x)^2 (a+a \cos (e+f x)) \, dx=\frac {a \left (6 \cos \left (f x +e \right ) c d f +6 \cos \left (f x +e \right ) d^{2} f x +3 \sin \left (f x +e \right ) c^{2} f^{2}+6 \sin \left (f x +e \right ) c d \,f^{2} x +3 \sin \left (f x +e \right ) d^{2} f^{2} x^{2}-6 \sin \left (f x +e \right ) d^{2}+3 c^{2} f^{3} x +3 c d \,f^{3} x^{2}+d^{2} f^{3} x^{3}\right )}{3 f^{3}} \] Input:
int((d*x+c)^2*(a+a*cos(f*x+e)),x)
Output:
(a*(6*cos(e + f*x)*c*d*f + 6*cos(e + f*x)*d**2*f*x + 3*sin(e + f*x)*c**2*f **2 + 6*sin(e + f*x)*c*d*f**2*x + 3*sin(e + f*x)*d**2*f**2*x**2 - 6*sin(e + f*x)*d**2 + 3*c**2*f**3*x + 3*c*d*f**3*x**2 + d**2*f**3*x**3))/(3*f**3)