Integrand size = 25, antiderivative size = 65 \[ \int \cos ^2(c+d x) \sin (c+d x) (a+b \sin (c+d x)) \, dx=\frac {b x}{8}-\frac {a \cos ^3(c+d x)}{3 d}+\frac {b \cos (c+d x) \sin (c+d x)}{8 d}-\frac {b \cos ^3(c+d x) \sin (c+d x)}{4 d} \] Output:
1/8*b*x-1/3*a*cos(d*x+c)^3/d+1/8*b*cos(d*x+c)*sin(d*x+c)/d-1/4*b*cos(d*x+c )^3*sin(d*x+c)/d
Time = 0.13 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.94 \[ \int \cos ^2(c+d x) \sin (c+d x) (a+b \sin (c+d x)) \, dx=\frac {b x}{8}-\frac {a \cos ^3(c+d x)}{3 d}+\frac {1}{8} b \left (-\frac {\cos (4 d x) \sin (4 c)}{4 d}-\frac {\cos (4 c) \sin (4 d x)}{4 d}\right ) \] Input:
Integrate[Cos[c + d*x]^2*Sin[c + d*x]*(a + b*Sin[c + d*x]),x]
Output:
(b*x)/8 - (a*Cos[c + d*x]^3)/(3*d) + (b*(-1/4*(Cos[4*d*x]*Sin[4*c])/d - (C os[4*c]*Sin[4*d*x])/(4*d)))/8
Time = 0.42 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.08, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.360, Rules used = {3042, 3317, 3042, 3045, 15, 3048, 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 \sin (c+d x) \cos ^2(c+d x) (a+b \sin (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sin (c+d x) \cos (c+d x)^2 (a+b \sin (c+d x))dx\) |
\(\Big \downarrow \) 3317 |
\(\displaystyle a \int \cos ^2(c+d x) \sin (c+d x)dx+b \int \cos ^2(c+d x) \sin ^2(c+d x)dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle a \int \cos (c+d x)^2 \sin (c+d x)dx+b \int \cos (c+d x)^2 \sin (c+d x)^2dx\) |
\(\Big \downarrow \) 3045 |
\(\displaystyle b \int \cos (c+d x)^2 \sin (c+d x)^2dx-\frac {a \int \cos ^2(c+d x)d\cos (c+d x)}{d}\) |
\(\Big \downarrow \) 15 |
\(\displaystyle b \int \cos (c+d x)^2 \sin (c+d x)^2dx-\frac {a \cos ^3(c+d x)}{3 d}\) |
\(\Big \downarrow \) 3048 |
\(\displaystyle b \left (\frac {1}{4} \int \cos ^2(c+d x)dx-\frac {\sin (c+d x) \cos ^3(c+d x)}{4 d}\right )-\frac {a \cos ^3(c+d x)}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle b \left (\frac {1}{4} \int \sin \left (c+d x+\frac {\pi }{2}\right )^2dx-\frac {\sin (c+d x) \cos ^3(c+d x)}{4 d}\right )-\frac {a \cos ^3(c+d x)}{3 d}\) |
\(\Big \downarrow \) 3115 |
\(\displaystyle b \left (\frac {1}{4} \left (\frac {\int 1dx}{2}+\frac {\sin (c+d x) \cos (c+d x)}{2 d}\right )-\frac {\sin (c+d x) \cos ^3(c+d x)}{4 d}\right )-\frac {a \cos ^3(c+d x)}{3 d}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle b \left (\frac {1}{4} \left (\frac {\sin (c+d x) \cos (c+d x)}{2 d}+\frac {x}{2}\right )-\frac {\sin (c+d x) \cos ^3(c+d x)}{4 d}\right )-\frac {a \cos ^3(c+d x)}{3 d}\) |
Input:
Int[Cos[c + d*x]^2*Sin[c + d*x]*(a + b*Sin[c + d*x]),x]
Output:
-1/3*(a*Cos[c + d*x]^3)/d + b*(-1/4*(Cos[c + d*x]^3*Sin[c + d*x])/d + (x/2 + (Cos[c + d*x]*Sin[c + d*x])/(2*d))/4)
Int[(a_.)*(x_)^(m_.), x_Symbol] :> Simp[a*(x^(m + 1)/(m + 1)), x] /; FreeQ[ {a, m}, x] && NeQ[m, -1]
Int[(cos[(e_.) + (f_.)*(x_)]*(a_.))^(m_.)*sin[(e_.) + (f_.)*(x_)]^(n_.), x_ Symbol] :> Simp[-(a*f)^(-1) Subst[Int[x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Cos[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2] && !(IntegerQ[(m - 1)/2] && GtQ[m, 0] && LeQ[m, n])
Int[(cos[(e_.) + (f_.)*(x_)]*(b_.))^(n_)*((a_.)*sin[(e_.) + (f_.)*(x_)])^(m _), x_Symbol] :> Simp[(-a)*(b*Cos[e + f*x])^(n + 1)*((a*Sin[e + f*x])^(m - 1)/(b*f*(m + n))), x] + Simp[a^2*((m - 1)/(m + n)) Int[(b*Cos[e + f*x])^n *(a*Sin[e + f*x])^(m - 2), x], x] /; FreeQ[{a, b, e, f, n}, x] && GtQ[m, 1] && NeQ[m + n, 0] && IntegersQ[2*m, 2*n]
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_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n _.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[a Int[(g*Co s[e + f*x])^p*(d*Sin[e + f*x])^n, x], x] + Simp[b/d Int[(g*Cos[e + f*x])^ p*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x]
Time = 1.57 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.74
method | result | size |
risch | \(\frac {b x}{8}-\frac {a \cos \left (d x +c \right )}{4 d}-\frac {b \sin \left (4 d x +4 c \right )}{32 d}-\frac {a \cos \left (3 d x +3 c \right )}{12 d}\) | \(48\) |
parallelrisch | \(\frac {12 b x d -24 a \cos \left (d x +c \right )-3 b \sin \left (4 d x +4 c \right )-8 a \cos \left (3 d x +3 c \right )-32 a}{96 d}\) | \(48\) |
derivativedivides | \(\frac {-\frac {\cos \left (d x +c \right )^{3} a}{3}+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 )}{d}\) | \(57\) |
default | \(\frac {-\frac {\cos \left (d x +c \right )^{3} a}{3}+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 )}{d}\) | \(57\) |
norman | \(\frac {\frac {b x}{8}-\frac {2 a}{3 d}-\frac {b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {7 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{4 d}-\frac {7 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{4 d}+\frac {b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{4 d}+\frac {b x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{2}+\frac {3 b x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{4}+\frac {b x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{2}+\frac {b x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{8}-\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{3 d}-\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{d}-\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{4}}\) | \(205\) |
orering | \(x \cos \left (d x +c \right )^{2} \sin \left (d x +c \right ) \left (a +b \sin \left (d x +c \right )\right )-\frac {169 \left (-2 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} \left (a +b \sin \left (d x +c \right )\right ) d +\cos \left (d x +c \right )^{3} d \left (a +b \sin \left (d x +c \right )\right )+\cos \left (d x +c \right )^{3} \sin \left (d x +c \right ) b d \right )}{144 d^{2}}+\frac {169 x \left (2 d^{2} \sin \left (d x +c \right )^{3} \left (a +b \sin \left (d x +c \right )\right )-7 \cos \left (d x +c \right )^{2} \sin \left (d x +c \right ) \left (a +b \sin \left (d x +c \right )\right ) d^{2}-5 \cos \left (d x +c \right )^{2} \sin \left (d x +c \right )^{2} b \,d^{2}+2 \cos \left (d x +c \right )^{4} d^{2} b \right )}{144 d^{2}}-\frac {13 \left (20 d^{3} \sin \left (d x +c \right )^{2} \left (a +b \sin \left (d x +c \right )\right ) \cos \left (d x +c \right )+12 d^{3} \sin \left (d x +c \right )^{3} b \cos \left (d x +c \right )-7 \cos \left (d x +c \right )^{3} d^{3} \left (a +b \sin \left (d x +c \right )\right )-25 \cos \left (d x +c \right )^{3} \sin \left (d x +c \right ) b \,d^{3}\right )}{72 d^{4}}+\frac {13 x \left (61 d^{4} \sin \left (d x +c \right ) \left (a +b \sin \left (d x +c \right )\right ) \cos \left (d x +c \right )^{2}+131 \cos \left (d x +c \right )^{2} \sin \left (d x +c \right )^{2} b \,d^{4}-20 d^{4} \sin \left (d x +c \right )^{3} \left (a +b \sin \left (d x +c \right )\right )-12 \sin \left (d x +c \right )^{4} b \,d^{4}-32 \cos \left (d x +c \right )^{4} b \,d^{4}\right )}{72 d^{4}}-\frac {61 d^{5} \cos \left (d x +c \right )^{3} \left (a +b \sin \left (d x +c \right )\right )+451 d^{5} \sin \left (d x +c \right ) b \cos \left (d x +c \right )^{3}-182 d^{5} \sin \left (d x +c \right )^{2} \left (a +b \sin \left (d x +c \right )\right ) \cos \left (d x +c \right )-330 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} b \,d^{5}}{144 d^{6}}+\frac {x \left (-547 d^{6} \cos \left (d x +c \right )^{2} \left (a +b \sin \left (d x +c \right )\right ) \sin \left (d x +c \right )+512 d^{6} \cos \left (d x +c \right )^{4} b -2525 d^{6} \sin \left (d x +c \right )^{2} b \cos \left (d x +c \right )^{2}+182 d^{6} \sin \left (d x +c \right )^{3} \left (a +b \sin \left (d x +c \right )\right )+330 d^{6} \sin \left (d x +c \right )^{4} b \right )}{144 d^{6}}\) | \(607\) |
Input:
int(cos(d*x+c)^2*sin(d*x+c)*(a+b*sin(d*x+c)),x,method=_RETURNVERBOSE)
Output:
1/8*b*x-1/4*a*cos(d*x+c)/d-1/32*b/d*sin(4*d*x+4*c)-1/12*a/d*cos(3*d*x+3*c)
Time = 0.11 (sec) , antiderivative size = 51, normalized size of antiderivative = 0.78 \[ \int \cos ^2(c+d x) \sin (c+d x) (a+b \sin (c+d x)) \, dx=-\frac {8 \, a \cos \left (d x + c\right )^{3} - 3 \, b d x + 3 \, {\left (2 \, b \cos \left (d x + c\right )^{3} - b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{24 \, d} \] Input:
integrate(cos(d*x+c)^2*sin(d*x+c)*(a+b*sin(d*x+c)),x, algorithm="fricas")
Output:
-1/24*(8*a*cos(d*x + c)^3 - 3*b*d*x + 3*(2*b*cos(d*x + c)^3 - b*cos(d*x + c))*sin(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 119 vs. \(2 (56) = 112\).
Time = 0.16 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.83 \[ \int \cos ^2(c+d x) \sin (c+d x) (a+b \sin (c+d x)) \, dx=\begin {cases} - \frac {a \cos ^{3}{\left (c + d x \right )}}{3 d} + \frac {b x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {b x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {b x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {b \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} - \frac {b \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} & \text {for}\: d \neq 0 \\x \left (a + b \sin {\left (c \right )}\right ) \sin {\left (c \right )} \cos ^{2}{\left (c \right )} & \text {otherwise} \end {cases} \] Input:
integrate(cos(d*x+c)**2*sin(d*x+c)*(a+b*sin(d*x+c)),x)
Output:
Piecewise((-a*cos(c + d*x)**3/(3*d) + b*x*sin(c + d*x)**4/8 + b*x*sin(c + d*x)**2*cos(c + d*x)**2/4 + b*x*cos(c + d*x)**4/8 + b*sin(c + d*x)**3*cos( c + d*x)/(8*d) - b*sin(c + d*x)*cos(c + d*x)**3/(8*d), Ne(d, 0)), (x*(a + b*sin(c))*sin(c)*cos(c)**2, True))
Time = 0.04 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.60 \[ \int \cos ^2(c+d x) \sin (c+d x) (a+b \sin (c+d x)) \, dx=-\frac {32 \, a \cos \left (d x + c\right )^{3} - 3 \, {\left (4 \, d x + 4 \, c - \sin \left (4 \, d x + 4 \, c\right )\right )} b}{96 \, d} \] Input:
integrate(cos(d*x+c)^2*sin(d*x+c)*(a+b*sin(d*x+c)),x, algorithm="maxima")
Output:
-1/96*(32*a*cos(d*x + c)^3 - 3*(4*d*x + 4*c - sin(4*d*x + 4*c))*b)/d
Time = 0.14 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.72 \[ \int \cos ^2(c+d x) \sin (c+d x) (a+b \sin (c+d x)) \, dx=\frac {1}{8} \, b x - \frac {a \cos \left (3 \, d x + 3 \, c\right )}{12 \, d} - \frac {a \cos \left (d x + c\right )}{4 \, d} - \frac {b \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} \] Input:
integrate(cos(d*x+c)^2*sin(d*x+c)*(a+b*sin(d*x+c)),x, algorithm="giac")
Output:
1/8*b*x - 1/12*a*cos(3*d*x + 3*c)/d - 1/4*a*cos(d*x + c)/d - 1/32*b*sin(4* d*x + 4*c)/d
Time = 37.96 (sec) , antiderivative size = 125, normalized size of antiderivative = 1.92 \[ \int \cos ^2(c+d x) \sin (c+d x) (a+b \sin (c+d x)) \, dx=\frac {b\,x}{8}-\frac {-\frac {b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{4}+2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+\frac {7\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{4}+2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-\frac {7\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{4}+\frac {2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{3}+\frac {b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}+\frac {2\,a}{3}}{d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^4} \] Input:
int(cos(c + d*x)^2*sin(c + d*x)*(a + b*sin(c + d*x)),x)
Output:
(b*x)/8 - ((2*a)/3 + (b*tan(c/2 + (d*x)/2))/4 + (2*a*tan(c/2 + (d*x)/2)^2) /3 + 2*a*tan(c/2 + (d*x)/2)^4 + 2*a*tan(c/2 + (d*x)/2)^6 - (7*b*tan(c/2 + (d*x)/2)^3)/4 + (7*b*tan(c/2 + (d*x)/2)^5)/4 - (b*tan(c/2 + (d*x)/2)^7)/4) /(d*(tan(c/2 + (d*x)/2)^2 + 1)^4)
Time = 0.18 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.11 \[ \int \cos ^2(c+d x) \sin (c+d x) (a+b \sin (c+d x)) \, dx=\frac {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 -3 \cos \left (d x +c \right ) \sin \left (d x +c \right ) b -8 \cos \left (d x +c \right ) a +8 a +3 b d x}{24 d} \] Input:
int(cos(d*x+c)^2*sin(d*x+c)*(a+b*sin(d*x+c)),x)
Output:
(6*cos(c + d*x)*sin(c + d*x)**3*b + 8*cos(c + d*x)*sin(c + d*x)**2*a - 3*c os(c + d*x)*sin(c + d*x)*b - 8*cos(c + d*x)*a + 8*a + 3*b*d*x)/(24*d)