Integrand size = 29, antiderivative size = 79 \[ \int \cos ^2(e+f x) (a+a \sin (e+f x)) (c+d \sin (e+f x)) \, dx=\frac {1}{8} a (4 c+d) x-\frac {a (c+d) \cos ^3(e+f x)}{3 f}+\frac {a (4 c+d) \cos (e+f x) \sin (e+f x)}{8 f}-\frac {a d \cos ^3(e+f x) \sin (e+f x)}{4 f} \] Output:
1/8*a*(4*c+d)*x-1/3*a*(c+d)*cos(f*x+e)^3/f+1/8*a*(4*c+d)*cos(f*x+e)*sin(f* x+e)/f-1/4*a*d*cos(f*x+e)^3*sin(f*x+e)/f
Time = 1.35 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.25 \[ \int \cos ^2(e+f x) (a+a \sin (e+f x)) (c+d \sin (e+f x)) \, dx=\frac {a \cos (e+f x) \left (-8 (c+d)-\frac {6 (4 c+d) \arcsin \left (\frac {\sqrt {1-\sin (e+f x)}}{\sqrt {2}}\right )}{\sqrt {\cos ^2(e+f x)}}+3 (4 c-d) \sin (e+f x)+8 (c+d) \sin ^2(e+f x)+6 d \sin ^3(e+f x)\right )}{24 f} \] Input:
Integrate[Cos[e + f*x]^2*(a + a*Sin[e + f*x])*(c + d*Sin[e + f*x]),x]
Output:
(a*Cos[e + f*x]*(-8*(c + d) - (6*(4*c + d)*ArcSin[Sqrt[1 - Sin[e + f*x]]/S qrt[2]])/Sqrt[Cos[e + f*x]^2] + 3*(4*c - d)*Sin[e + f*x] + 8*(c + d)*Sin[e + f*x]^2 + 6*d*Sin[e + f*x]^3))/(24*f)
Time = 0.39 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.01, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.241, Rules used = {3042, 3339, 3042, 3148, 3042, 3115, 24}
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 \cos ^2(e+f x) (a \sin (e+f x)+a) (c+d \sin (e+f x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \cos (e+f x)^2 (a \sin (e+f x)+a) (c+d \sin (e+f x))dx\) |
\(\Big \downarrow \) 3339 |
\(\displaystyle \frac {1}{4} (4 c+d) \int \cos ^2(e+f x) (\sin (e+f x) a+a)dx-\frac {d \cos ^3(e+f x) (a \sin (e+f x)+a)}{4 f}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} (4 c+d) \int \cos (e+f x)^2 (\sin (e+f x) a+a)dx-\frac {d \cos ^3(e+f x) (a \sin (e+f x)+a)}{4 f}\) |
\(\Big \downarrow \) 3148 |
\(\displaystyle \frac {1}{4} (4 c+d) \left (a \int \cos ^2(e+f x)dx-\frac {a \cos ^3(e+f x)}{3 f}\right )-\frac {d \cos ^3(e+f x) (a \sin (e+f x)+a)}{4 f}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} (4 c+d) \left (a \int \sin \left (e+f x+\frac {\pi }{2}\right )^2dx-\frac {a \cos ^3(e+f x)}{3 f}\right )-\frac {d \cos ^3(e+f x) (a \sin (e+f x)+a)}{4 f}\) |
\(\Big \downarrow \) 3115 |
\(\displaystyle \frac {1}{4} (4 c+d) \left (a \left (\frac {\int 1dx}{2}+\frac {\sin (e+f x) \cos (e+f x)}{2 f}\right )-\frac {a \cos ^3(e+f x)}{3 f}\right )-\frac {d \cos ^3(e+f x) (a \sin (e+f x)+a)}{4 f}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {1}{4} (4 c+d) \left (a \left (\frac {\sin (e+f x) \cos (e+f x)}{2 f}+\frac {x}{2}\right )-\frac {a \cos ^3(e+f x)}{3 f}\right )-\frac {d \cos ^3(e+f x) (a \sin (e+f x)+a)}{4 f}\) |
Input:
Int[Cos[e + f*x]^2*(a + a*Sin[e + f*x])*(c + d*Sin[e + f*x]),x]
Output:
-1/4*(d*Cos[e + f*x]^3*(a + a*Sin[e + f*x]))/f + ((4*c + d)*(-1/3*(a*Cos[e + f*x]^3)/f + a*(x/2 + (Cos[e + f*x]*Sin[e + f*x])/(2*f))))/4
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* x]*((b*Sin[c + d*x])^(n - 1)/(d*n)), x] + Simp[b^2*((n - 1)/n) Int[(b*Sin [c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && IntegerQ[ 2*n]
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x _)]), x_Symbol] :> Simp[(-b)*((g*Cos[e + f*x])^(p + 1)/(f*g*(p + 1))), x] + Simp[a Int[(g*Cos[e + f*x])^p, x], x] /; FreeQ[{a, b, e, f, g, p}, x] && (IntegerQ[2*p] || NeQ[a^2 - b^2, 0])
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x _)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-d)* (g*Cos[e + f*x])^(p + 1)*((a + b*Sin[e + f*x])^m/(f*g*(m + p + 1))), x] + S imp[(a*d*m + b*c*(m + p + 1))/(b*(m + p + 1)) Int[(g*Cos[e + f*x])^p*(a + b*Sin[e + f*x])^m, x], x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] && EqQ[ a^2 - b^2, 0] && NeQ[m + p + 1, 0]
Time = 3.10 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.91
method | result | size |
parallelrisch | \(-\frac {\left (\frac {8 \left (c +d \right ) \cos \left (3 f x +3 e \right )}{3}-8 \sin \left (2 f x +2 e \right ) c +d \sin \left (4 f x +4 e \right )+8 \left (c +d \right ) \cos \left (f x +e \right )-16 f x c -4 f x d +\frac {32 c}{3}+\frac {32 d}{3}\right ) a}{32 f}\) | \(72\) |
derivativedivides | \(\frac {a d \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )^{3}}{4}+\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{8}+\frac {f x}{8}+\frac {e}{8}\right )-\frac {a c \cos \left (f x +e \right )^{3}}{3}-\frac {a d \cos \left (f x +e \right )^{3}}{3}+a c \left (\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}\) | \(96\) |
default | \(\frac {a d \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )^{3}}{4}+\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{8}+\frac {f x}{8}+\frac {e}{8}\right )-\frac {a c \cos \left (f x +e \right )^{3}}{3}-\frac {a d \cos \left (f x +e \right )^{3}}{3}+a c \left (\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}\) | \(96\) |
risch | \(\frac {a x c}{2}+\frac {a x d}{8}-\frac {a c \cos \left (f x +e \right )}{4 f}-\frac {a \cos \left (f x +e \right ) d}{4 f}-\frac {a d \sin \left (4 f x +4 e \right )}{32 f}-\frac {a \cos \left (3 f x +3 e \right ) c}{12 f}-\frac {a \cos \left (3 f x +3 e \right ) d}{12 f}+\frac {a c \sin \left (2 f x +2 e \right )}{4 f}\) | \(102\) |
norman | \(\frac {\left (\frac {1}{2} a c +\frac {1}{8} a d \right ) x +\left (2 a c +\frac {1}{2} a d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+\left (2 a c +\frac {1}{2} a d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}+\left (3 a c +\frac {3}{4} a d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}+\left (\frac {1}{2} a c +\frac {1}{8} a d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{8}-\frac {2 a c +2 a d}{3 f}-\frac {2 \left (a c +a d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{3 f}-\frac {2 \left (a c +a d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{f}-\frac {2 \left (a c +a d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}}{f}+\frac {a \left (4 c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{4 f}-\frac {a \left (4 c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{4 f}+\frac {a \left (4 c +7 d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{4 f}-\frac {a \left (4 c +7 d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{4 f}}{\left (1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}\right )^{4}}\) | \(294\) |
orering | \(\text {Expression too large to display}\) | \(1508\) |
Input:
int(cos(f*x+e)^2*(a+a*sin(f*x+e))*(c+d*sin(f*x+e)),x,method=_RETURNVERBOSE )
Output:
-1/32*(8/3*(c+d)*cos(3*f*x+3*e)-8*sin(2*f*x+2*e)*c+d*sin(4*f*x+4*e)+8*(c+d )*cos(f*x+e)-16*f*x*c-4*f*x*d+32/3*c+32/3*d)*a/f
Time = 0.09 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.91 \[ \int \cos ^2(e+f x) (a+a \sin (e+f x)) (c+d \sin (e+f x)) \, dx=-\frac {8 \, {\left (a c + a d\right )} \cos \left (f x + e\right )^{3} - 3 \, {\left (4 \, a c + a d\right )} f x + 3 \, {\left (2 \, a d \cos \left (f x + e\right )^{3} - {\left (4 \, a c + a d\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{24 \, f} \] Input:
integrate(cos(f*x+e)^2*(a+a*sin(f*x+e))*(c+d*sin(f*x+e)),x, algorithm="fri cas")
Output:
-1/24*(8*(a*c + a*d)*cos(f*x + e)^3 - 3*(4*a*c + a*d)*f*x + 3*(2*a*d*cos(f *x + e)^3 - (4*a*c + a*d)*cos(f*x + e))*sin(f*x + e))/f
Leaf count of result is larger than twice the leaf count of optimal. 199 vs. \(2 (71) = 142\).
Time = 0.18 (sec) , antiderivative size = 199, normalized size of antiderivative = 2.52 \[ \int \cos ^2(e+f x) (a+a \sin (e+f x)) (c+d \sin (e+f x)) \, dx=\begin {cases} \frac {a c x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {a c x \cos ^{2}{\left (e + f x \right )}}{2} + \frac {a c \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {a c \cos ^{3}{\left (e + f x \right )}}{3 f} + \frac {a d x \sin ^{4}{\left (e + f x \right )}}{8} + \frac {a d x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{4} + \frac {a d x \cos ^{4}{\left (e + f x \right )}}{8} + \frac {a d \sin ^{3}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{8 f} - \frac {a d \sin {\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{8 f} - \frac {a d \cos ^{3}{\left (e + f x \right )}}{3 f} & \text {for}\: f \neq 0 \\x \left (c + d \sin {\left (e \right )}\right ) \left (a \sin {\left (e \right )} + a\right ) \cos ^{2}{\left (e \right )} & \text {otherwise} \end {cases} \] Input:
integrate(cos(f*x+e)**2*(a+a*sin(f*x+e))*(c+d*sin(f*x+e)),x)
Output:
Piecewise((a*c*x*sin(e + f*x)**2/2 + a*c*x*cos(e + f*x)**2/2 + a*c*sin(e + f*x)*cos(e + f*x)/(2*f) - a*c*cos(e + f*x)**3/(3*f) + a*d*x*sin(e + f*x)* *4/8 + a*d*x*sin(e + f*x)**2*cos(e + f*x)**2/4 + a*d*x*cos(e + f*x)**4/8 + a*d*sin(e + f*x)**3*cos(e + f*x)/(8*f) - a*d*sin(e + f*x)*cos(e + f*x)**3 /(8*f) - a*d*cos(e + f*x)**3/(3*f), Ne(f, 0)), (x*(c + d*sin(e))*(a*sin(e) + a)*cos(e)**2, True))
Time = 0.03 (sec) , antiderivative size = 74, normalized size of antiderivative = 0.94 \[ \int \cos ^2(e+f x) (a+a \sin (e+f x)) (c+d \sin (e+f x)) \, dx=-\frac {32 \, a c \cos \left (f x + e\right )^{3} + 32 \, a d \cos \left (f x + e\right )^{3} - 24 \, {\left (2 \, f x + 2 \, e + \sin \left (2 \, f x + 2 \, e\right )\right )} a c - 3 \, {\left (4 \, f x + 4 \, e - \sin \left (4 \, f x + 4 \, e\right )\right )} a d}{96 \, f} \] Input:
integrate(cos(f*x+e)^2*(a+a*sin(f*x+e))*(c+d*sin(f*x+e)),x, algorithm="max ima")
Output:
-1/96*(32*a*c*cos(f*x + e)^3 + 32*a*d*cos(f*x + e)^3 - 24*(2*f*x + 2*e + s in(2*f*x + 2*e))*a*c - 3*(4*f*x + 4*e - sin(4*f*x + 4*e))*a*d)/f
Time = 0.13 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.05 \[ \int \cos ^2(e+f x) (a+a \sin (e+f x)) (c+d \sin (e+f x)) \, dx=\frac {1}{8} \, {\left (4 \, a c + a d\right )} x - \frac {a d \sin \left (4 \, f x + 4 \, e\right )}{32 \, f} + \frac {a c \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} - \frac {{\left (a c + a d\right )} \cos \left (3 \, f x + 3 \, e\right )}{12 \, f} - \frac {{\left (a c + a d\right )} \cos \left (f x + e\right )}{4 \, f} \] Input:
integrate(cos(f*x+e)^2*(a+a*sin(f*x+e))*(c+d*sin(f*x+e)),x, algorithm="gia c")
Output:
1/8*(4*a*c + a*d)*x - 1/32*a*d*sin(4*f*x + 4*e)/f + 1/4*a*c*sin(2*f*x + 2* e)/f - 1/12*(a*c + a*d)*cos(3*f*x + 3*e)/f - 1/4*(a*c + a*d)*cos(f*x + e)/ f
Time = 34.78 (sec) , antiderivative size = 276, normalized size of antiderivative = 3.49 \[ \int \cos ^2(e+f x) (a+a \sin (e+f x)) (c+d \sin (e+f x)) \, dx=\frac {a\,\mathrm {atan}\left (\frac {a\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (4\,c+d\right )}{4\,\left (a\,c+\frac {a\,d}{4}\right )}\right )\,\left (4\,c+d\right )}{4\,f}-\frac {\left (a\,c-\frac {a\,d}{4}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^7+\left (2\,a\,c+2\,a\,d\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6+\left (a\,c+\frac {7\,a\,d}{4}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5+\left (2\,a\,c+2\,a\,d\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+\left (-a\,c-\frac {7\,a\,d}{4}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+\left (\frac {2\,a\,c}{3}+\frac {2\,a\,d}{3}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+\left (\frac {a\,d}{4}-a\,c\right )\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+\frac {2\,a\,c}{3}+\frac {2\,a\,d}{3}}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^8+4\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+1\right )}-\frac {a\,\left (4\,c+d\right )\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )-\frac {f\,x}{2}\right )}{4\,f} \] Input:
int(cos(e + f*x)^2*(a + a*sin(e + f*x))*(c + d*sin(e + f*x)),x)
Output:
(a*atan((a*tan(e/2 + (f*x)/2)*(4*c + d))/(4*(a*c + (a*d)/4)))*(4*c + d))/( 4*f) - ((2*a*c)/3 + (2*a*d)/3 + tan(e/2 + (f*x)/2)^4*(2*a*c + 2*a*d) + tan (e/2 + (f*x)/2)^6*(2*a*c + 2*a*d) + tan(e/2 + (f*x)/2)^2*((2*a*c)/3 + (2*a *d)/3) + tan(e/2 + (f*x)/2)^7*(a*c - (a*d)/4) - tan(e/2 + (f*x)/2)^3*(a*c + (7*a*d)/4) + tan(e/2 + (f*x)/2)^5*(a*c + (7*a*d)/4) - tan(e/2 + (f*x)/2) *(a*c - (a*d)/4))/(f*(4*tan(e/2 + (f*x)/2)^2 + 6*tan(e/2 + (f*x)/2)^4 + 4* tan(e/2 + (f*x)/2)^6 + tan(e/2 + (f*x)/2)^8 + 1)) - (a*(4*c + d)*(atan(tan (e/2 + (f*x)/2)) - (f*x)/2))/(4*f)
Time = 0.21 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.54 \[ \int \cos ^2(e+f x) (a+a \sin (e+f x)) (c+d \sin (e+f x)) \, dx=\frac {a \left (6 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{3} d +8 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} c +8 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} d +12 \cos \left (f x +e \right ) \sin \left (f x +e \right ) c -3 \cos \left (f x +e \right ) \sin \left (f x +e \right ) d -8 \cos \left (f x +e \right ) c -8 \cos \left (f x +e \right ) d +12 c f x +8 c +3 d f x +8 d \right )}{24 f} \] Input:
int(cos(f*x+e)^2*(a+a*sin(f*x+e))*(c+d*sin(f*x+e)),x)
Output:
(a*(6*cos(e + f*x)*sin(e + f*x)**3*d + 8*cos(e + f*x)*sin(e + f*x)**2*c + 8*cos(e + f*x)*sin(e + f*x)**2*d + 12*cos(e + f*x)*sin(e + f*x)*c - 3*cos( e + f*x)*sin(e + f*x)*d - 8*cos(e + f*x)*c - 8*cos(e + f*x)*d + 12*c*f*x + 8*c + 3*d*f*x + 8*d))/(24*f)