Integrand size = 29, antiderivative size = 84 \[ \int \cos ^2(c+d x) (a+a \sin (c+d x)) (A+B \sin (c+d x)) \, dx=\frac {1}{8} a (4 A+B) x-\frac {a (4 A+B) \cos ^3(c+d x)}{12 d}+\frac {a (4 A+B) \cos (c+d x) \sin (c+d x)}{8 d}-\frac {B \cos ^3(c+d x) (a+a \sin (c+d x))}{4 d} \] Output:
1/8*a*(4*A+B)*x-1/12*a*(4*A+B)*cos(d*x+c)^3/d+1/8*a*(4*A+B)*cos(d*x+c)*sin (d*x+c)/d-1/4*B*cos(d*x+c)^3*(a+a*sin(d*x+c))/d
Time = 0.93 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.18 \[ \int \cos ^2(c+d x) (a+a \sin (c+d x)) (A+B \sin (c+d x)) \, dx=\frac {a \cos (c+d x) \left (-8 (A+B)-\frac {6 (4 A+B) \arcsin \left (\frac {\sqrt {1-\sin (c+d x)}}{\sqrt {2}}\right )}{\sqrt {\cos ^2(c+d x)}}+3 (4 A-B) \sin (c+d x)+8 (A+B) \sin ^2(c+d x)+6 B \sin ^3(c+d x)\right )}{24 d} \] Input:
Integrate[Cos[c + d*x]^2*(a + a*Sin[c + d*x])*(A + B*Sin[c + d*x]),x]
Output:
(a*Cos[c + d*x]*(-8*(A + B) - (6*(4*A + B)*ArcSin[Sqrt[1 - Sin[c + d*x]]/S qrt[2]])/Sqrt[Cos[c + d*x]^2] + 3*(4*A - B)*Sin[c + d*x] + 8*(A + B)*Sin[c + d*x]^2 + 6*B*Sin[c + d*x]^3))/(24*d)
Time = 0.40 (sec) , antiderivative size = 80, normalized size of antiderivative = 0.95, 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(c+d x) (a \sin (c+d x)+a) (A+B \sin (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \cos (c+d x)^2 (a \sin (c+d x)+a) (A+B \sin (c+d x))dx\) |
\(\Big \downarrow \) 3339 |
\(\displaystyle \frac {1}{4} (4 A+B) \int \cos ^2(c+d x) (\sin (c+d x) a+a)dx-\frac {B \cos ^3(c+d x) (a \sin (c+d x)+a)}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} (4 A+B) \int \cos (c+d x)^2 (\sin (c+d x) a+a)dx-\frac {B \cos ^3(c+d x) (a \sin (c+d x)+a)}{4 d}\) |
\(\Big \downarrow \) 3148 |
\(\displaystyle \frac {1}{4} (4 A+B) \left (a \int \cos ^2(c+d x)dx-\frac {a \cos ^3(c+d x)}{3 d}\right )-\frac {B \cos ^3(c+d x) (a \sin (c+d x)+a)}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} (4 A+B) \left (a \int \sin \left (c+d x+\frac {\pi }{2}\right )^2dx-\frac {a \cos ^3(c+d x)}{3 d}\right )-\frac {B \cos ^3(c+d x) (a \sin (c+d x)+a)}{4 d}\) |
\(\Big \downarrow \) 3115 |
\(\displaystyle \frac {1}{4} (4 A+B) \left (a \left (\frac {\int 1dx}{2}+\frac {\sin (c+d x) \cos (c+d x)}{2 d}\right )-\frac {a \cos ^3(c+d x)}{3 d}\right )-\frac {B \cos ^3(c+d x) (a \sin (c+d x)+a)}{4 d}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {1}{4} (4 A+B) \left (a \left (\frac {\sin (c+d x) \cos (c+d x)}{2 d}+\frac {x}{2}\right )-\frac {a \cos ^3(c+d x)}{3 d}\right )-\frac {B \cos ^3(c+d x) (a \sin (c+d x)+a)}{4 d}\) |
Input:
Int[Cos[c + d*x]^2*(a + a*Sin[c + d*x])*(A + B*Sin[c + d*x]),x]
Output:
-1/4*(B*Cos[c + d*x]^3*(a + a*Sin[c + d*x]))/d + ((4*A + B)*(-1/3*(a*Cos[c + d*x]^3)/d + a*(x/2 + (Cos[c + d*x]*Sin[c + d*x])/(2*d))))/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.12 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.00
method | result | size |
parallelrisch | \(\frac {a \left (8 \left (-A -B \right ) \cos \left (3 d x +3 c \right )+48 d x A +12 d x B -24 A \cos \left (d x +c \right )+24 A \sin \left (2 d x +2 c \right )-3 B \sin \left (4 d x +4 c \right )-24 B \cos \left (d x +c \right )-32 A -32 B \right )}{96 d}\) | \(84\) |
derivativedivides | \(\frac {a B \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )^{3}}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )-\frac {a A \cos \left (d x +c \right )^{3}}{3}-\frac {a B \cos \left (d x +c \right )^{3}}{3}+a A \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(96\) |
default | \(\frac {a B \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )^{3}}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )-\frac {a A \cos \left (d x +c \right )^{3}}{3}-\frac {a B \cos \left (d x +c \right )^{3}}{3}+a A \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(96\) |
risch | \(\frac {a x A}{2}+\frac {a B x}{8}-\frac {a A \cos \left (d x +c \right )}{4 d}-\frac {a \cos \left (d x +c \right ) B}{4 d}-\frac {\sin \left (4 d x +4 c \right ) a B}{32 d}-\frac {a \cos \left (3 d x +3 c \right ) A}{12 d}-\frac {a \cos \left (3 d x +3 c \right ) B}{12 d}+\frac {\sin \left (2 d x +2 c \right ) a A}{4 d}\) | \(102\) |
norman | \(\frac {\left (\frac {1}{2} a A +\frac {1}{8} a B \right ) x +\left (2 a A +\frac {1}{2} a B \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (2 a A +\frac {1}{2} a B \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (3 a A +\frac {3}{4} a B \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (\frac {1}{2} a A +\frac {1}{8} a B \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}-\frac {2 a A +2 a B}{3 d}-\frac {2 \left (a A +a B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{3 d}-\frac {2 \left (a A +a B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{d}-\frac {2 \left (a A +a B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{d}+\frac {a \left (4 A -B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}-\frac {a \left (4 A -B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{4 d}+\frac {a \left (4 A +7 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{4 d}-\frac {a \left (4 A +7 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{4 d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{4}}\) | \(294\) |
orering | \(\text {Expression too large to display}\) | \(1508\) |
Input:
int(cos(d*x+c)^2*(a+a*sin(d*x+c))*(A+B*sin(d*x+c)),x,method=_RETURNVERBOSE )
Output:
1/96*a*(8*(-A-B)*cos(3*d*x+3*c)+48*d*x*A+12*d*x*B-24*A*cos(d*x+c)+24*A*sin (2*d*x+2*c)-3*B*sin(4*d*x+4*c)-24*B*cos(d*x+c)-32*A-32*B)/d
Time = 0.09 (sec) , antiderivative size = 65, normalized size of antiderivative = 0.77 \[ \int \cos ^2(c+d x) (a+a \sin (c+d x)) (A+B \sin (c+d x)) \, dx=-\frac {8 \, {\left (A + B\right )} a \cos \left (d x + c\right )^{3} - 3 \, {\left (4 \, A + B\right )} a d x + 3 \, {\left (2 \, B a \cos \left (d x + c\right )^{3} - {\left (4 \, A + B\right )} a \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{24 \, d} \] Input:
integrate(cos(d*x+c)^2*(a+a*sin(d*x+c))*(A+B*sin(d*x+c)),x, algorithm="fri cas")
Output:
-1/24*(8*(A + B)*a*cos(d*x + c)^3 - 3*(4*A + B)*a*d*x + 3*(2*B*a*cos(d*x + c)^3 - (4*A + B)*a*cos(d*x + c))*sin(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 199 vs. \(2 (75) = 150\).
Time = 0.19 (sec) , antiderivative size = 199, normalized size of antiderivative = 2.37 \[ \int \cos ^2(c+d x) (a+a \sin (c+d x)) (A+B \sin (c+d x)) \, dx=\begin {cases} \frac {A a x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {A a x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {A a \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} - \frac {A a \cos ^{3}{\left (c + d x \right )}}{3 d} + \frac {B a x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {B a x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {B a x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {B a \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} - \frac {B a \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} - \frac {B a \cos ^{3}{\left (c + d x \right )}}{3 d} & \text {for}\: d \neq 0 \\x \left (A + B \sin {\left (c \right )}\right ) \left (a \sin {\left (c \right )} + a\right ) \cos ^{2}{\left (c \right )} & \text {otherwise} \end {cases} \] Input:
integrate(cos(d*x+c)**2*(a+a*sin(d*x+c))*(A+B*sin(d*x+c)),x)
Output:
Piecewise((A*a*x*sin(c + d*x)**2/2 + A*a*x*cos(c + d*x)**2/2 + A*a*sin(c + d*x)*cos(c + d*x)/(2*d) - A*a*cos(c + d*x)**3/(3*d) + B*a*x*sin(c + d*x)* *4/8 + B*a*x*sin(c + d*x)**2*cos(c + d*x)**2/4 + B*a*x*cos(c + d*x)**4/8 + B*a*sin(c + d*x)**3*cos(c + d*x)/(8*d) - B*a*sin(c + d*x)*cos(c + d*x)**3 /(8*d) - B*a*cos(c + d*x)**3/(3*d), Ne(d, 0)), (x*(A + B*sin(c))*(a*sin(c) + a)*cos(c)**2, True))
Time = 0.03 (sec) , antiderivative size = 74, normalized size of antiderivative = 0.88 \[ \int \cos ^2(c+d x) (a+a \sin (c+d x)) (A+B \sin (c+d x)) \, dx=-\frac {32 \, A a \cos \left (d x + c\right )^{3} + 32 \, B a \cos \left (d x + c\right )^{3} - 24 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a - 3 \, {\left (4 \, d x + 4 \, c - \sin \left (4 \, d x + 4 \, c\right )\right )} B a}{96 \, d} \] Input:
integrate(cos(d*x+c)^2*(a+a*sin(d*x+c))*(A+B*sin(d*x+c)),x, algorithm="max ima")
Output:
-1/96*(32*A*a*cos(d*x + c)^3 + 32*B*a*cos(d*x + c)^3 - 24*(2*d*x + 2*c + s in(2*d*x + 2*c))*A*a - 3*(4*d*x + 4*c - sin(4*d*x + 4*c))*B*a)/d
Time = 0.16 (sec) , antiderivative size = 83, normalized size of antiderivative = 0.99 \[ \int \cos ^2(c+d x) (a+a \sin (c+d x)) (A+B \sin (c+d x)) \, dx=\frac {1}{8} \, {\left (4 \, A a + B a\right )} x - \frac {B a \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac {A a \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} - \frac {{\left (A a + B a\right )} \cos \left (3 \, d x + 3 \, c\right )}{12 \, d} - \frac {{\left (A a + B a\right )} \cos \left (d x + c\right )}{4 \, d} \] Input:
integrate(cos(d*x+c)^2*(a+a*sin(d*x+c))*(A+B*sin(d*x+c)),x, algorithm="gia c")
Output:
1/8*(4*A*a + B*a)*x - 1/32*B*a*sin(4*d*x + 4*c)/d + 1/4*A*a*sin(2*d*x + 2* c)/d - 1/12*(A*a + B*a)*cos(3*d*x + 3*c)/d - 1/4*(A*a + B*a)*cos(d*x + c)/ d
Time = 35.13 (sec) , antiderivative size = 276, normalized size of antiderivative = 3.29 \[ \int \cos ^2(c+d x) (a+a \sin (c+d x)) (A+B \sin (c+d x)) \, dx=\frac {a\,\mathrm {atan}\left (\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (4\,A+B\right )}{4\,\left (A\,a+\frac {B\,a}{4}\right )}\right )\,\left (4\,A+B\right )}{4\,d}-\frac {a\,\left (4\,A+B\right )\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\frac {d\,x}{2}\right )}{4\,d}-\frac {\left (A\,a-\frac {B\,a}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (2\,A\,a+2\,B\,a\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+\left (A\,a+\frac {7\,B\,a}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (2\,A\,a+2\,B\,a\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\left (-A\,a-\frac {7\,B\,a}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (\frac {2\,A\,a}{3}+\frac {2\,B\,a}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\left (\frac {B\,a}{4}-A\,a\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {2\,A\,a}{3}+\frac {2\,B\,a}{3}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \] Input:
int(cos(c + d*x)^2*(A + B*sin(c + d*x))*(a + a*sin(c + d*x)),x)
Output:
(a*atan((a*tan(c/2 + (d*x)/2)*(4*A + B))/(4*(A*a + (B*a)/4)))*(4*A + B))/( 4*d) - (a*(4*A + B)*(atan(tan(c/2 + (d*x)/2)) - (d*x)/2))/(4*d) - ((2*A*a) /3 + (2*B*a)/3 - tan(c/2 + (d*x)/2)*(A*a - (B*a)/4) + tan(c/2 + (d*x)/2)^4 *(2*A*a + 2*B*a) + tan(c/2 + (d*x)/2)^6*(2*A*a + 2*B*a) + tan(c/2 + (d*x)/ 2)^2*((2*A*a)/3 + (2*B*a)/3) + tan(c/2 + (d*x)/2)^7*(A*a - (B*a)/4) - tan( c/2 + (d*x)/2)^3*(A*a + (7*B*a)/4) + tan(c/2 + (d*x)/2)^5*(A*a + (7*B*a)/4 ))/(d*(4*tan(c/2 + (d*x)/2)^2 + 6*tan(c/2 + (d*x)/2)^4 + 4*tan(c/2 + (d*x) /2)^6 + tan(c/2 + (d*x)/2)^8 + 1))
Time = 0.18 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.45 \[ \int \cos ^2(c+d x) (a+a \sin (c+d x)) (A+B \sin (c+d x)) \, dx=\frac {a \left (6 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} b +8 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a +8 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} b +12 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a -3 \cos \left (d x +c \right ) \sin \left (d x +c \right ) b -8 \cos \left (d x +c \right ) a -8 \cos \left (d x +c \right ) b +12 a d x +8 a +3 b d x +8 b \right )}{24 d} \] Input:
int(cos(d*x+c)^2*(a+a*sin(d*x+c))*(A+B*sin(d*x+c)),x)
Output:
(a*(6*cos(c + d*x)*sin(c + d*x)**3*b + 8*cos(c + d*x)*sin(c + d*x)**2*a + 8*cos(c + d*x)*sin(c + d*x)**2*b + 12*cos(c + d*x)*sin(c + d*x)*a - 3*cos( c + d*x)*sin(c + d*x)*b - 8*cos(c + d*x)*a - 8*cos(c + d*x)*b + 12*a*d*x + 8*a + 3*b*d*x + 8*b))/(24*d)