Integrand size = 29, antiderivative size = 108 \[ \int \cos (c+d x) (a+b \cos (c+d x)) \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {1}{8} b (4 A+3 C) x+\frac {a (3 A+2 C) \sin (c+d x)}{3 d}+\frac {b (4 A+3 C) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a C \cos ^2(c+d x) \sin (c+d x)}{3 d}+\frac {b C \cos ^3(c+d x) \sin (c+d x)}{4 d} \] Output:
1/8*b*(4*A+3*C)*x+1/3*a*(3*A+2*C)*sin(d*x+c)/d+1/8*b*(4*A+3*C)*cos(d*x+c)* sin(d*x+c)/d+1/3*a*C*cos(d*x+c)^2*sin(d*x+c)/d+1/4*b*C*cos(d*x+c)^3*sin(d* x+c)/d
Time = 0.28 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.78 \[ \int \cos (c+d x) (a+b \cos (c+d x)) \left (A+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+24 a (4 A+3 C) \sin (c+d x)+24 b (A+C) \sin (2 (c+d x))+8 a C \sin (3 (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])*(A + 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 + 24*a*(4*A + 3*C)*Sin[c + d*x] + 24*b*(A + C)*Sin[2*(c + d*x)] + 8*a*C*Sin[3*(c + d*x)] + 3*b*C*Sin[ 4*(c + d*x)])/(96*d)
Time = 0.46 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.07, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {3042, 3513, 3042, 3502, 3042, 3213}
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 (A+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 (A+C \sin \left (c+d x+\frac {\pi }{2}\right )^2\right )dx\) |
\(\Big \downarrow \) 3513 |
\(\displaystyle \frac {1}{4} \int \cos (c+d x) \left (4 a C \cos ^2(c+d x)+b (4 A+3 C) \cos (c+d x)+4 a A\right )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 ) \left (4 a C \sin \left (c+d x+\frac {\pi }{2}\right )^2+b (4 A+3 C) \sin \left (c+d x+\frac {\pi }{2}\right )+4 a A\right )dx+\frac {b C \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3502 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \int \cos (c+d x) (4 a (3 A+2 C)+3 b (4 A+3 C) \cos (c+d x))dx+\frac {4 a C \sin (c+d x) \cos ^2(c+d x)}{3 d}\right )+\frac {b C \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \int \sin \left (c+d x+\frac {\pi }{2}\right ) \left (4 a (3 A+2 C)+3 b (4 A+3 C) \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx+\frac {4 a C \sin (c+d x) \cos ^2(c+d x)}{3 d}\right )+\frac {b C \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3213 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (\frac {4 a (3 A+2 C) \sin (c+d x)}{d}+\frac {3 b (4 A+3 C) \sin (c+d x) \cos (c+d x)}{2 d}+\frac {3}{2} b x (4 A+3 C)\right )+\frac {4 a C \sin (c+d x) \cos ^2(c+d x)}{3 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])*(A + C*Cos[c + d*x]^2),x]
Output:
(b*C*Cos[c + d*x]^3*Sin[c + d*x])/(4*d) + ((4*a*C*Cos[c + d*x]^2*Sin[c + d *x])/(3*d) + ((3*b*(4*A + 3*C)*x)/2 + (4*a*(3*A + 2*C)*Sin[c + d*x])/d + ( 3*b*(4*A + 3*C)*Cos[c + d*x]*Sin[c + d*x])/(2*d))/3)/4
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.) *(x_)]), x_Symbol] :> Simp[(2*a*c + b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Co s[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /; Free Q[{a, b, c, d, e, f}, 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_)])*((A_.) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[ (-C)*d*Cos[e + f*x]*Sin[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 3) )), x] + Simp[1/(b*(m + 3)) Int[(a + b*Sin[e + f*x])^m*Simp[a*C*d + A*b*c *(m + 3) + b*d*(C*(m + 2) + A*(m + 3))*Sin[e + f*x] - (2*a*C*d - b*c*C*(m + 3))*Sin[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, C, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && !LtQ[m, -1]
Time = 4.03 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.64
method | result | size |
parallelrisch | \(\frac {24 b \left (A +C \right ) \sin \left (2 d x +2 c \right )+8 C a \sin \left (3 d x +3 c \right )+3 C b \sin \left (4 d x +4 c \right )+96 \left (\frac {b x d}{2}+a \sin \left (d x +c \right )\right ) \left (A +\frac {3 C}{4}\right )}{96 d}\) | \(69\) |
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 {C a \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+A b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a A \sin \left (d x +c \right )}{d}\) | \(96\) |
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 {C a \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+A b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a A \sin \left (d x +c \right )}{d}\) | \(96\) |
risch | \(\frac {b x A}{2}+\frac {3 b C x}{8}+\frac {\sin \left (d x +c \right ) a A}{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 {C a \sin \left (3 d x +3 c \right )}{12 d}+\frac {\sin \left (2 d x +2 c \right ) A b}{4 d}+\frac {\sin \left (2 d x +2 c \right ) C b}{4 d}\) | \(101\) |
parts | \(\frac {\sin \left (d x +c \right ) a A}{d}+\frac {A b \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 a \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3 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}\) | \(104\) |
norman | \(\frac {\left (\frac {1}{2} A b +\frac {3}{8} C b \right ) x +\left (2 A b +\frac {3}{2} C b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (2 A b +\frac {3}{2} C b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (3 A b +\frac {9}{4} C b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (\frac {1}{2} A b +\frac {3}{8} C b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\frac {\left (8 a A -4 A b +8 C a -5 C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{4 d}+\frac {\left (8 a A +4 A b +8 C a +5 C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {\left (72 a A -12 A b +40 C a +9 C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{12 d}+\frac {\left (72 a A +12 A 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}\) | \(1382\) |
Input:
int(cos(d*x+c)*(a+b*cos(d*x+c))*(A+C*cos(d*x+c)^2),x,method=_RETURNVERBOSE )
Output:
1/96*(24*b*(A+C)*sin(2*d*x+2*c)+8*C*a*sin(3*d*x+3*c)+3*C*b*sin(4*d*x+4*c)+ 96*(1/2*b*x*d+a*sin(d*x+c))*(A+3/4*C))/d
Time = 0.08 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.70 \[ \int \cos (c+d x) (a+b \cos (c+d x)) \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {3 \, {\left (4 \, A + 3 \, C\right )} b d x + {\left (6 \, C b \cos \left (d x + c\right )^{3} + 8 \, C a \cos \left (d x + c\right )^{2} + 3 \, {\left (4 \, A + 3 \, C\right )} b \cos \left (d x + c\right ) + 8 \, {\left (3 \, A + 2 \, C\right )} a\right )} \sin \left (d x + c\right )}{24 \, d} \] Input:
integrate(cos(d*x+c)*(a+b*cos(d*x+c))*(A+C*cos(d*x+c)^2),x, algorithm="fri cas")
Output:
1/24*(3*(4*A + 3*C)*b*d*x + (6*C*b*cos(d*x + c)^3 + 8*C*a*cos(d*x + c)^2 + 3*(4*A + 3*C)*b*cos(d*x + c) + 8*(3*A + 2*C)*a)*sin(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 226 vs. \(2 (99) = 198\).
Time = 0.17 (sec) , antiderivative size = 226, normalized size of antiderivative = 2.09 \[ \int \cos (c+d x) (a+b \cos (c+d x)) \left (A+C \cos ^2(c+d x)\right ) \, dx=\begin {cases} \frac {A a \sin {\left (c + d x \right )}}{d} + \frac {A b x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {A b x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {A b \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 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 + C \cos ^{2}{\left (c \right )}\right ) \left (a + b \cos {\left (c \right )}\right ) \cos {\left (c \right )} & \text {otherwise} \end {cases} \] Input:
integrate(cos(d*x+c)*(a+b*cos(d*x+c))*(A+C*cos(d*x+c)**2),x)
Output:
Piecewise((A*a*sin(c + d*x)/d + A*b*x*sin(c + d*x)**2/2 + A*b*x*cos(c + d* x)**2/2 + A*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*s in(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 + C*cos(c)**2)*(a + b*cos(c))*cos(c), True))
Time = 0.04 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.83 \[ \int \cos (c+d x) (a+b \cos (c+d x)) \left (A+C \cos ^2(c+d x)\right ) \, dx=-\frac {32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} C a - 24 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A 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 \, A a \sin \left (d x + c\right )}{96 \, d} \] Input:
integrate(cos(d*x+c)*(a+b*cos(d*x+c))*(A+C*cos(d*x+c)^2),x, algorithm="max ima")
Output:
-1/96*(32*(sin(d*x + c)^3 - 3*sin(d*x + c))*C*a - 24*(2*d*x + 2*c + sin(2* d*x + 2*c))*A*b - 3*(12*d*x + 12*c + sin(4*d*x + 4*c) + 8*sin(2*d*x + 2*c) )*C*b - 96*A*a*sin(d*x + c))/d
Time = 0.41 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.80 \[ \int \cos (c+d x) (a+b \cos (c+d x)) \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {1}{8} \, {\left (4 \, A b + 3 \, C b\right )} x + \frac {C b \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac {C a \sin \left (3 \, d x + 3 \, c\right )}{12 \, d} + \frac {{\left (A b + C b\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac {{\left (4 \, A a + 3 \, C a\right )} \sin \left (d x + c\right )}{4 \, d} \] Input:
integrate(cos(d*x+c)*(a+b*cos(d*x+c))*(A+C*cos(d*x+c)^2),x, algorithm="gia c")
Output:
1/8*(4*A*b + 3*C*b)*x + 1/32*C*b*sin(4*d*x + 4*c)/d + 1/12*C*a*sin(3*d*x + 3*c)/d + 1/4*(A*b + C*b)*sin(2*d*x + 2*c)/d + 1/4*(4*A*a + 3*C*a)*sin(d*x + c)/d
Time = 1.08 (sec) , antiderivative size = 243, normalized size of antiderivative = 2.25 \[ \int \cos (c+d x) (a+b \cos (c+d x)) \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {\left (2\,A\,a-A\,b+2\,C\,a-\frac {5\,C\,b}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (6\,A\,a-A\,b+\frac {10\,C\,a}{3}+\frac {3\,C\,b}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (6\,A\,a+A\,b+\frac {10\,C\,a}{3}-\frac {3\,C\,b}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (2\,A\,a+A\,b+2\,C\,a+\frac {5\,C\,b}{4}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{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 )}+\frac {b\,\mathrm {atan}\left (\frac {b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (4\,A+3\,C\right )}{4\,\left (A\,b+\frac {3\,C\,b}{4}\right )}\right )\,\left (4\,A+3\,C\right )}{4\,d}-\frac {b\,\left (4\,A+3\,C\right )\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\frac {d\,x}{2}\right )}{4\,d} \] Input:
int(cos(c + d*x)*(A + C*cos(c + d*x)^2)*(a + b*cos(c + d*x)),x)
Output:
(tan(c/2 + (d*x)/2)*(2*A*a + A*b + 2*C*a + (5*C*b)/4) + tan(c/2 + (d*x)/2) ^7*(2*A*a - A*b + 2*C*a - (5*C*b)/4) + tan(c/2 + (d*x)/2)^3*(6*A*a + A*b + (10*C*a)/3 - (3*C*b)/4) + tan(c/2 + (d*x)/2)^5*(6*A*a - A*b + (10*C*a)/3 + (3*C*b)/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)) + (b*atan((b*tan(c/2 + (d*x) /2)*(4*A + 3*C))/(4*(A*b + (3*C*b)/4)))*(4*A + 3*C))/(4*d) - (b*(4*A + 3*C )*(atan(tan(c/2 + (d*x)/2)) - (d*x)/2))/(4*d)
Time = 0.18 (sec) , antiderivative size = 101, normalized size of antiderivative = 0.94 \[ \int \cos (c+d x) (a+b \cos (c+d x)) \left (A+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 +24 \sin \left (d x +c \right ) a^{2}+24 \sin \left (d x +c \right ) a c +12 a b d x +9 b c d x}{24 d} \] Input:
int(cos(d*x+c)*(a+b*cos(d*x+c))*(A+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 + 24*sin(c + d* x)*a**2 + 24*sin(c + d*x)*a*c + 12*a*b*d*x + 9*b*c*d*x)/(24*d)