Integrand size = 36, antiderivative size = 105 \[ \int \cos (c+d x) (a+b \cos (c+d x)) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {1}{8} (4 a B+3 b C) x+\frac {(b B+a C) \sin (c+d x)}{d}+\frac {(4 a B+3 b C) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {b C \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {(b B+a C) \sin ^3(c+d x)}{3 d} \] Output:
1/8*(4*B*a+3*C*b)*x+(B*b+C*a)*sin(d*x+c)/d+1/8*(4*B*a+3*C*b)*cos(d*x+c)*si n(d*x+c)/d+1/4*b*C*cos(d*x+c)^3*sin(d*x+c)/d-1/3*(B*b+C*a)*sin(d*x+c)^3/d
Time = 0.22 (sec) , antiderivative size = 91, normalized size of antiderivative = 0.87 \[ \int \cos (c+d x) (a+b \cos (c+d x)) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {48 a B c+36 b c C+48 a B d x+36 b C d x+96 (b B+a C) \sin (c+d x)-32 (b B+a C) \sin ^3(c+d x)+24 (a B+b C) \sin (2 (c+d x))+3 b C \sin (4 (c+d x))}{96 d} \] Input:
Integrate[Cos[c + d*x]*(a + b*Cos[c + d*x])*(B*Cos[c + d*x] + C*Cos[c + d* x]^2),x]
Output:
(48*a*B*c + 36*b*c*C + 48*a*B*d*x + 36*b*C*d*x + 96*(b*B + a*C)*Sin[c + d* x] - 32*(b*B + a*C)*Sin[c + d*x]^3 + 24*(a*B + b*C)*Sin[2*(c + d*x)] + 3*b *C*Sin[4*(c + d*x)])/(96*d)
Time = 0.66 (sec) , antiderivative size = 97, normalized size of antiderivative = 0.92, number of steps used = 14, number of rules used = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.361, Rules used = {3042, 3508, 3042, 3447, 3042, 3502, 3042, 3227, 3042, 3113, 2009, 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 (c+d x) (a+b \cos (c+d x)) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sin \left (c+d x+\frac {\pi }{2}\right ) \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right ) \left (B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2\right )dx\) |
\(\Big \downarrow \) 3508 |
\(\displaystyle \int \cos ^2(c+d x) (a+b \cos (c+d x)) (B+C \cos (c+d x))dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sin \left (c+d x+\frac {\pi }{2}\right )^2 \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right ) \left (B+C \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx\) |
\(\Big \downarrow \) 3447 |
\(\displaystyle \int \cos ^2(c+d x) \left ((a C+b B) \cos (c+d x)+a B+b C \cos ^2(c+d x)\right )dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sin \left (c+d x+\frac {\pi }{2}\right )^2 \left ((a C+b B) \sin \left (c+d x+\frac {\pi }{2}\right )+a B+b C \sin \left (c+d x+\frac {\pi }{2}\right )^2\right )dx\) |
\(\Big \downarrow \) 3502 |
\(\displaystyle \frac {1}{4} \int \cos ^2(c+d x) (4 a B+3 b C+4 (b B+a C) \cos (c+d x))dx+\frac {b C \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} \int \sin \left (c+d x+\frac {\pi }{2}\right )^2 \left (4 a B+3 b C+4 (b B+a C) \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx+\frac {b C \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3227 |
\(\displaystyle \frac {1}{4} \left (4 (a C+b B) \int \cos ^3(c+d x)dx+(4 a B+3 b C) \int \cos ^2(c+d x)dx\right )+\frac {b C \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} \left ((4 a B+3 b C) \int \sin \left (c+d x+\frac {\pi }{2}\right )^2dx+4 (a C+b B) \int \sin \left (c+d x+\frac {\pi }{2}\right )^3dx\right )+\frac {b C \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3113 |
\(\displaystyle \frac {1}{4} \left ((4 a B+3 b C) \int \sin \left (c+d x+\frac {\pi }{2}\right )^2dx-\frac {4 (a C+b B) \int \left (1-\sin ^2(c+d x)\right )d(-\sin (c+d x))}{d}\right )+\frac {b C \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {1}{4} \left ((4 a B+3 b C) \int \sin \left (c+d x+\frac {\pi }{2}\right )^2dx-\frac {4 (a C+b B) \left (\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}\right )+\frac {b C \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3115 |
\(\displaystyle \frac {1}{4} \left ((4 a B+3 b C) \left (\frac {\int 1dx}{2}+\frac {\sin (c+d x) \cos (c+d x)}{2 d}\right )-\frac {4 (a C+b B) \left (\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}\right )+\frac {b C \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {1}{4} \left ((4 a B+3 b C) \left (\frac {\sin (c+d x) \cos (c+d x)}{2 d}+\frac {x}{2}\right )-\frac {4 (a C+b B) \left (\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}\right )+\frac {b C \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
Input:
Int[Cos[c + d*x]*(a + b*Cos[c + d*x])*(B*Cos[c + d*x] + C*Cos[c + d*x]^2), x]
Output:
(b*C*Cos[c + d*x]^3*Sin[c + d*x])/(4*d) + ((4*a*B + 3*b*C)*(x/2 + (Cos[c + d*x]*Sin[c + d*x])/(2*d)) - (4*(b*B + a*C)*(-Sin[c + d*x] + Sin[c + d*x]^ 3/3))/d)/4
Int[sin[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1) Subst[Int[Exp and[(1 - x^2)^((n - 1)/2), x], x], x, Cos[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[(n - 1)/2, 0]
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[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x _)]), x_Symbol] :> Simp[c Int[(b*Sin[e + f*x])^m, x], x] + Simp[d/b Int [(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Int[(a + b*Sin[e + f*x])^m*(A*c + (B*c + A*d)*Sin[e + f*x] + B*d*Sin[e + f*x]^2), x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Co s[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Simp[1/(b*(m + 2)) Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && !LtQ[m, -1]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_ .) + (f_.)*(x_)]^2), x_Symbol] :> Simp[1/b^2 Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*(b*B - a*C + b*C*Sin[e + f*x]), x], x] /; FreeQ [{a, b, c, d, e, f, A, B, C, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[A*b^2 - a*b*B + a^2*C, 0]
Time = 3.73 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.82
method | result | size |
parallelrisch | \(\frac {\left (24 B a +24 C b \right ) \sin \left (2 d x +2 c \right )+\left (8 B b +8 C a \right ) \sin \left (3 d x +3 c \right )+3 C \sin \left (4 d x +4 c \right ) b +\left (72 B b +72 C a \right ) \sin \left (d x +c \right )+48 x \left (B a +\frac {3 C b}{4}\right ) d}{96 d}\) | \(86\) |
parts | \(\frac {\left (B b +C a \right ) \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3 d}+\frac {B a \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {C b \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) | \(97\) |
derivativedivides | \(\frac {C b \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {B b \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+\frac {C a \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+B a \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(107\) |
default | \(\frac {C b \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {B b \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+\frac {C a \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+B a \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(107\) |
risch | \(\frac {x B a}{2}+\frac {3 b C x}{8}+\frac {3 \sin \left (d x +c \right ) B b}{4 d}+\frac {3 a C \sin \left (d x +c \right )}{4 d}+\frac {C b \sin \left (4 d x +4 c \right )}{32 d}+\frac {\sin \left (3 d x +3 c \right ) B b}{12 d}+\frac {\sin \left (3 d x +3 c \right ) C a}{12 d}+\frac {\sin \left (2 d x +2 c \right ) B a}{4 d}+\frac {\sin \left (2 d x +2 c \right ) C b}{4 d}\) | \(118\) |
norman | \(\frac {\left (\frac {B a}{2}+\frac {3 C b}{8}\right ) x +\left (2 B a +\frac {3 C b}{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (2 B a +\frac {3 C b}{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (3 B a +\frac {9 C b}{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (\frac {B a}{2}+\frac {3 C b}{8}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}-\frac {\left (4 B a -8 B b -8 C a +5 C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{4 d}+\frac {\left (4 B a +8 B b +8 C a +5 C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}-\frac {\left (12 B a -40 B b -40 C a -9 C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{12 d}+\frac {\left (12 B a +40 B b +40 C a -9 C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{12 d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{4}}\) | \(247\) |
orering | \(\text {Expression too large to display}\) | \(4731\) |
Input:
int(cos(d*x+c)*(a+b*cos(d*x+c))*(B*cos(d*x+c)+C*cos(d*x+c)^2),x,method=_RE TURNVERBOSE)
Output:
1/96*((24*B*a+24*C*b)*sin(2*d*x+2*c)+(8*B*b+8*C*a)*sin(3*d*x+3*c)+3*C*sin( 4*d*x+4*c)*b+(72*B*b+72*C*a)*sin(d*x+c)+48*x*(B*a+3/4*C*b)*d)/d
Time = 0.09 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.77 \[ \int \cos (c+d x) (a+b \cos (c+d x)) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {3 \, {\left (4 \, B a + 3 \, C b\right )} d x + {\left (6 \, C b \cos \left (d x + c\right )^{3} + 8 \, {\left (C a + B b\right )} \cos \left (d x + c\right )^{2} + 16 \, C a + 16 \, B b + 3 \, {\left (4 \, B a + 3 \, C b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{24 \, d} \] Input:
integrate(cos(d*x+c)*(a+b*cos(d*x+c))*(B*cos(d*x+c)+C*cos(d*x+c)^2),x, alg orithm="fricas")
Output:
1/24*(3*(4*B*a + 3*C*b)*d*x + (6*C*b*cos(d*x + c)^3 + 8*(C*a + B*b)*cos(d* x + c)^2 + 16*C*a + 16*B*b + 3*(4*B*a + 3*C*b)*cos(d*x + c))*sin(d*x + c)) /d
Leaf count of result is larger than twice the leaf count of optimal. 255 vs. \(2 (97) = 194\).
Time = 0.18 (sec) , antiderivative size = 255, normalized size of antiderivative = 2.43 \[ \int \cos (c+d x) (a+b \cos (c+d x)) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\begin {cases} \frac {B a x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {B a x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {B a \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {2 B b \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {B b \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {2 C a \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {C a \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {3 C b x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 C b x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 C b x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {3 C b \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {5 C 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 \cos {\left (c \right )}\right ) \left (B \cos {\left (c \right )} + C \cos ^{2}{\left (c \right )}\right ) \cos {\left (c \right )} & \text {otherwise} \end {cases} \] Input:
integrate(cos(d*x+c)*(a+b*cos(d*x+c))*(B*cos(d*x+c)+C*cos(d*x+c)**2),x)
Output:
Piecewise((B*a*x*sin(c + d*x)**2/2 + B*a*x*cos(c + d*x)**2/2 + B*a*sin(c + d*x)*cos(c + d*x)/(2*d) + 2*B*b*sin(c + d*x)**3/(3*d) + B*b*sin(c + d*x)* cos(c + d*x)**2/d + 2*C*a*sin(c + d*x)**3/(3*d) + C*a*sin(c + d*x)*cos(c + d*x)**2/d + 3*C*b*x*sin(c + d*x)**4/8 + 3*C*b*x*sin(c + d*x)**2*cos(c + d *x)**2/4 + 3*C*b*x*cos(c + d*x)**4/8 + 3*C*b*sin(c + d*x)**3*cos(c + d*x)/ (8*d) + 5*C*b*sin(c + d*x)*cos(c + d*x)**3/(8*d), Ne(d, 0)), (x*(a + b*cos (c))*(B*cos(c) + C*cos(c)**2)*cos(c), True))
Time = 0.04 (sec) , antiderivative size = 101, normalized size of antiderivative = 0.96 \[ \int \cos (c+d x) (a+b \cos (c+d x)) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {24 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a - 32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} C a - 32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B b + 3 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} C b}{96 \, d} \] Input:
integrate(cos(d*x+c)*(a+b*cos(d*x+c))*(B*cos(d*x+c)+C*cos(d*x+c)^2),x, alg orithm="maxima")
Output:
1/96*(24*(2*d*x + 2*c + sin(2*d*x + 2*c))*B*a - 32*(sin(d*x + c)^3 - 3*sin (d*x + c))*C*a - 32*(sin(d*x + c)^3 - 3*sin(d*x + c))*B*b + 3*(12*d*x + 12 *c + sin(4*d*x + 4*c) + 8*sin(2*d*x + 2*c))*C*b)/d
Time = 0.94 (sec) , antiderivative size = 89, normalized size of antiderivative = 0.85 \[ \int \cos (c+d x) (a+b \cos (c+d x)) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {1}{8} \, {\left (4 \, B a + 3 \, C b\right )} x + \frac {C b \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac {{\left (C a + B b\right )} \sin \left (3 \, d x + 3 \, c\right )}{12 \, d} + \frac {{\left (B a + C b\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac {3 \, {\left (C a + B b\right )} \sin \left (d x + c\right )}{4 \, d} \] Input:
integrate(cos(d*x+c)*(a+b*cos(d*x+c))*(B*cos(d*x+c)+C*cos(d*x+c)^2),x, alg orithm="giac")
Output:
1/8*(4*B*a + 3*C*b)*x + 1/32*C*b*sin(4*d*x + 4*c)/d + 1/12*(C*a + B*b)*sin (3*d*x + 3*c)/d + 1/4*(B*a + C*b)*sin(2*d*x + 2*c)/d + 3/4*(C*a + B*b)*sin (d*x + c)/d
Time = 0.63 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.11 \[ \int \cos (c+d x) (a+b \cos (c+d x)) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {B\,a\,x}{2}+\frac {3\,C\,b\,x}{8}+\frac {3\,B\,b\,\sin \left (c+d\,x\right )}{4\,d}+\frac {3\,C\,a\,\sin \left (c+d\,x\right )}{4\,d}+\frac {B\,a\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {B\,b\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {C\,a\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {C\,b\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {C\,b\,\sin \left (4\,c+4\,d\,x\right )}{32\,d} \] Input:
int(cos(c + d*x)*(B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x)), x)
Output:
(B*a*x)/2 + (3*C*b*x)/8 + (3*B*b*sin(c + d*x))/(4*d) + (3*C*a*sin(c + d*x) )/(4*d) + (B*a*sin(2*c + 2*d*x))/(4*d) + (B*b*sin(3*c + 3*d*x))/(12*d) + ( C*a*sin(3*c + 3*d*x))/(12*d) + (C*b*sin(2*c + 2*d*x))/(4*d) + (C*b*sin(4*c + 4*d*x))/(32*d)
Time = 0.17 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.09 \[ \int \cos (c+d x) (a+b \cos (c+d x)) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {-6 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} b c +12 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a b +15 \cos \left (d x +c \right ) \sin \left (d x +c \right ) b c -8 \sin \left (d x +c \right )^{3} a c -8 \sin \left (d x +c \right )^{3} b^{2}+24 \sin \left (d x +c \right ) a c +24 \sin \left (d x +c \right ) b^{2}+12 a b d x +9 b c d x}{24 d} \] Input:
int(cos(d*x+c)*(a+b*cos(d*x+c))*(B*cos(d*x+c)+C*cos(d*x+c)^2),x)
Output:
( - 6*cos(c + d*x)*sin(c + d*x)**3*b*c + 12*cos(c + d*x)*sin(c + d*x)*a*b + 15*cos(c + d*x)*sin(c + d*x)*b*c - 8*sin(c + d*x)**3*a*c - 8*sin(c + d*x )**3*b**2 + 24*sin(c + d*x)*a*c + 24*sin(c + d*x)*b**2 + 12*a*b*d*x + 9*b* c*d*x)/(24*d)