Integrand size = 17, antiderivative size = 88 \[ \int \cos ^2(a+b x) \cos ^2(c+d x) \, dx=\frac {x}{4}+\frac {\sin (2 a+2 b x)}{8 b}+\frac {\sin (2 (a-c)+2 (b-d) x)}{16 (b-d)}+\frac {\sin (2 c+2 d x)}{8 d}+\frac {\sin (2 (a+c)+2 (b+d) x)}{16 (b+d)} \] Output:
1/4*x+1/8*sin(2*b*x+2*a)/b+sin(2*a-2*c+2*(b-d)*x)/(16*b-16*d)+1/8*sin(2*d* x+2*c)/d+sin(2*a+2*c+2*(b+d)*x)/(16*b+16*d)
Time = 0.53 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.19 \[ \int \cos ^2(a+b x) \cos ^2(c+d x) \, dx=\frac {2 d \left (b^2-d^2\right ) \sin (2 (a+b x))+b d (b+d) \sin (2 (a-c+(b-d) x))+b (b-d) (2 (b+d) \sin (2 (c+d x))+d (4 (b+d) x+\sin (2 (a+c+(b+d) x))))}{16 b (b-d) d (b+d)} \] Input:
Integrate[Cos[a + b*x]^2*Cos[c + d*x]^2,x]
Output:
(2*d*(b^2 - d^2)*Sin[2*(a + b*x)] + b*d*(b + d)*Sin[2*(a - c + (b - d)*x)] + b*(b - d)*(2*(b + d)*Sin[2*(c + d*x)] + d*(4*(b + d)*x + Sin[2*(a + c + (b + d)*x)])))/(16*b*(b - d)*d*(b + d))
Time = 0.26 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {5081, 2009}
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(a+b x) \cos ^2(c+d x) \, dx\) |
\(\Big \downarrow \) 5081 |
\(\displaystyle \int \left (\frac {1}{8} \cos (2 (a-c)+2 x (b-d))+\frac {1}{8} \cos (2 (a+c)+2 x (b+d))+\frac {1}{4} \cos (2 a+2 b x)+\frac {1}{4} \cos (2 c+2 d x)+\frac {1}{4}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\sin (2 (a-c)+2 x (b-d))}{16 (b-d)}+\frac {\sin (2 (a+c)+2 x (b+d))}{16 (b+d)}+\frac {\sin (2 a+2 b x)}{8 b}+\frac {\sin (2 c+2 d x)}{8 d}+\frac {x}{4}\) |
Input:
Int[Cos[a + b*x]^2*Cos[c + d*x]^2,x]
Output:
x/4 + Sin[2*a + 2*b*x]/(8*b) + Sin[2*(a - c) + 2*(b - d)*x]/(16*(b - d)) + Sin[2*c + 2*d*x]/(8*d) + Sin[2*(a + c) + 2*(b + d)*x]/(16*(b + d))
Int[Cos[v_]^(p_.)*Cos[w_]^(q_.), x_Symbol] :> Int[ExpandTrigReduce[Cos[v]^p *Cos[w]^q, x], x] /; ((PolynomialQ[v, x] && PolynomialQ[w, x]) || (Binomial Q[{v, w}, x] && IndependentQ[Cancel[v/w], x])) && IGtQ[p, 0] && IGtQ[q, 0]
Time = 4.63 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.01
method | result | size |
default | \(\frac {x}{4}+\frac {\sin \left (2 b x +2 a \right )}{8 b}+\frac {\sin \left (2 d x +2 c \right )}{8 d}+\frac {\sin \left (\left (2 b -2 d \right ) x +2 a -2 c \right )}{16 b -16 d}+\frac {\sin \left (\left (2 b +2 d \right ) x +2 a +2 c \right )}{16 b +16 d}\) | \(89\) |
parallelrisch | \(\frac {b d \left (b +d \right ) \sin \left (\left (2 b -2 d \right ) x +2 a -2 c \right )+4 \left (b -d \right ) \left (\frac {b d \sin \left (\left (2 b +2 d \right ) x +2 a +2 c \right )}{4}+\left (\frac {d \sin \left (2 b x +2 a \right )}{2}+b \left (d x +\frac {\sin \left (2 d x +2 c \right )}{2}\right )\right ) \left (b +d \right )\right )}{16 d \,b^{3}-16 d^{3} b}\) | \(104\) |
risch | \(\frac {x}{4}+\frac {\sin \left (2 b x +2 a \right )}{8 b}+\frac {\sin \left (2 d x +2 c \right ) b^{2}}{8 \left (b -d \right ) d \left (b +d \right )}-\frac {d \sin \left (2 d x +2 c \right )}{8 \left (b -d \right ) \left (b +d \right )}+\frac {\sin \left (2 b x -2 d x +2 a -2 c \right ) b}{16 \left (b -d \right ) \left (b +d \right )}+\frac {d \sin \left (2 b x -2 d x +2 a -2 c \right )}{16 \left (b -d \right ) \left (b +d \right )}+\frac {\sin \left (2 b x +2 d x +2 a +2 c \right ) b}{16 \left (b -d \right ) \left (b +d \right )}-\frac {d \sin \left (2 b x +2 d x +2 a +2 c \right )}{16 \left (b -d \right ) \left (b +d \right )}\) | \(196\) |
orering | \(\text {Expression too large to display}\) | \(2376\) |
Input:
int(cos(b*x+a)^2*cos(d*x+c)^2,x,method=_RETURNVERBOSE)
Output:
1/4*x+1/8*sin(2*b*x+2*a)/b+1/8*sin(2*d*x+2*c)/d+1/8/(2*b-2*d)*sin((2*b-2*d )*x+2*a-2*c)+1/8/(2*b+2*d)*sin((2*b+2*d)*x+2*a+2*c)
Time = 0.08 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.19 \[ \int \cos ^2(a+b x) \cos ^2(c+d x) \, dx=-\frac {{\left (2 \, b d^{2} \cos \left (b x + a\right )^{2} - b^{3}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - {\left (b^{3} d - b d^{3}\right )} x - {\left (2 \, b^{2} d \cos \left (b x + a\right ) \cos \left (d x + c\right )^{2} - d^{3} \cos \left (b x + a\right )\right )} \sin \left (b x + a\right )}{4 \, {\left (b^{3} d - b d^{3}\right )}} \] Input:
integrate(cos(b*x+a)^2*cos(d*x+c)^2,x, algorithm="fricas")
Output:
-1/4*((2*b*d^2*cos(b*x + a)^2 - b^3)*cos(d*x + c)*sin(d*x + c) - (b^3*d - b*d^3)*x - (2*b^2*d*cos(b*x + a)*cos(d*x + c)^2 - d^3*cos(b*x + a))*sin(b* x + a))/(b^3*d - b*d^3)
Leaf count of result is larger than twice the leaf count of optimal. 1027 vs. \(2 (76) = 152\).
Time = 1.64 (sec) , antiderivative size = 1027, normalized size of antiderivative = 11.67 \[ \int \cos ^2(a+b x) \cos ^2(c+d x) \, dx=\text {Too large to display} \] Input:
integrate(cos(b*x+a)**2*cos(d*x+c)**2,x)
Output:
Piecewise((x*cos(a)**2*cos(c)**2, Eq(b, 0) & Eq(d, 0)), ((x*sin(c + d*x)** 2/2 + x*cos(c + d*x)**2/2 + sin(c + d*x)*cos(c + d*x)/(2*d))*cos(a)**2, Eq (b, 0)), (3*x*sin(a - d*x)**2*sin(c + d*x)**2/8 + x*sin(a - d*x)**2*cos(c + d*x)**2/8 - x*sin(a - d*x)*sin(c + d*x)*cos(a - d*x)*cos(c + d*x)/2 + x* sin(c + d*x)**2*cos(a - d*x)**2/8 + 3*x*cos(a - d*x)**2*cos(c + d*x)**2/8 + sin(a - d*x)**2*sin(c + d*x)*cos(c + d*x)/(2*d) + sin(a - d*x)*sin(c + d *x)**2*cos(a - d*x)/(8*d) - 5*sin(a - d*x)*cos(a - d*x)*cos(c + d*x)**2/(8 *d), Eq(b, -d)), (3*x*sin(a + d*x)**2*sin(c + d*x)**2/8 + x*sin(a + d*x)** 2*cos(c + d*x)**2/8 + x*sin(a + d*x)*sin(c + d*x)*cos(a + d*x)*cos(c + d*x )/2 + x*sin(c + d*x)**2*cos(a + d*x)**2/8 + 3*x*cos(a + d*x)**2*cos(c + d* x)**2/8 + 3*sin(a + d*x)*sin(c + d*x)**2*cos(a + d*x)/(8*d) + sin(a + d*x) *cos(a + d*x)*cos(c + d*x)**2/(8*d) + sin(c + d*x)*cos(a + d*x)**2*cos(c + d*x)/(2*d), Eq(b, d)), ((x*sin(a + b*x)**2/2 + x*cos(a + b*x)**2/2 + sin( a + b*x)*cos(a + b*x)/(2*b))*cos(c)**2, Eq(d, 0)), (b**3*d*x*sin(a + b*x)* *2*sin(c + d*x)**2/(4*b**3*d - 4*b*d**3) + b**3*d*x*sin(a + b*x)**2*cos(c + d*x)**2/(4*b**3*d - 4*b*d**3) + b**3*d*x*sin(c + d*x)**2*cos(a + b*x)**2 /(4*b**3*d - 4*b*d**3) + b**3*d*x*cos(a + b*x)**2*cos(c + d*x)**2/(4*b**3* d - 4*b*d**3) + b**3*sin(a + b*x)**2*sin(c + d*x)*cos(c + d*x)/(4*b**3*d - 4*b*d**3) + b**3*sin(c + d*x)*cos(a + b*x)**2*cos(c + d*x)/(4*b**3*d - 4* b*d**3) + 2*b**2*d*sin(a + b*x)*cos(a + b*x)*cos(c + d*x)**2/(4*b**3*d ...
Leaf count of result is larger than twice the leaf count of optimal. 620 vs. \(2 (78) = 156\).
Time = 0.06 (sec) , antiderivative size = 620, normalized size of antiderivative = 7.05 \[ \int \cos ^2(a+b x) \cos ^2(c+d x) \, dx =\text {Too large to display} \] Input:
integrate(cos(b*x+a)^2*cos(d*x+c)^2,x, algorithm="maxima")
Output:
1/32*(8*((b*cos(2*c)^2 + b*sin(2*c)^2)*d^3 - (b^3*cos(2*c)^2 + b^3*sin(2*c )^2)*d)*x + (b^2*d*sin(2*c) - b*d^2*sin(2*c))*cos(2*(b + d)*x + 2*a + 4*c) - (b^2*d*sin(2*c) - b*d^2*sin(2*c))*cos(2*(b + d)*x + 2*a) - (b^2*d*sin(2 *c) + b*d^2*sin(2*c))*cos(-2*(b - d)*x - 2*a + 4*c) + (b^2*d*sin(2*c) + b* d^2*sin(2*c))*cos(-2*(b - d)*x - 2*a) + 2*(b^2*d*sin(2*c) - d^3*sin(2*c))* cos(2*b*x + 2*a + 2*c) - 2*(b^2*d*sin(2*c) - d^3*sin(2*c))*cos(2*b*x + 2*a - 2*c) - 2*(b^3*sin(2*c) - b*d^2*sin(2*c))*cos(2*d*x) + 2*(b^3*sin(2*c) - b*d^2*sin(2*c))*cos(2*d*x + 4*c) - (b^2*d*cos(2*c) - b*d^2*cos(2*c))*sin( 2*(b + d)*x + 2*a + 4*c) - (b^2*d*cos(2*c) - b*d^2*cos(2*c))*sin(2*(b + d) *x + 2*a) + (b^2*d*cos(2*c) + b*d^2*cos(2*c))*sin(-2*(b - d)*x - 2*a + 4*c ) + (b^2*d*cos(2*c) + b*d^2*cos(2*c))*sin(-2*(b - d)*x - 2*a) - 2*(b^2*d*c os(2*c) - d^3*cos(2*c))*sin(2*b*x + 2*a + 2*c) - 2*(b^2*d*cos(2*c) - d^3*c os(2*c))*sin(2*b*x + 2*a - 2*c) - 2*(b^3*cos(2*c) - b*d^2*cos(2*c))*sin(2* d*x) - 2*(b^3*cos(2*c) - b*d^2*cos(2*c))*sin(2*d*x + 4*c))/((b*cos(2*c)^2 + b*sin(2*c)^2)*d^3 - (b^3*cos(2*c)^2 + b^3*sin(2*c)^2)*d)
Time = 0.12 (sec) , antiderivative size = 80, normalized size of antiderivative = 0.91 \[ \int \cos ^2(a+b x) \cos ^2(c+d x) \, dx=\frac {1}{4} \, x + \frac {\sin \left (2 \, b x + 2 \, d x + 2 \, a + 2 \, c\right )}{16 \, {\left (b + d\right )}} + \frac {\sin \left (2 \, b x - 2 \, d x + 2 \, a - 2 \, c\right )}{16 \, {\left (b - d\right )}} + \frac {\sin \left (2 \, b x + 2 \, a\right )}{8 \, b} + \frac {\sin \left (2 \, d x + 2 \, c\right )}{8 \, d} \] Input:
integrate(cos(b*x+a)^2*cos(d*x+c)^2,x, algorithm="giac")
Output:
1/4*x + 1/16*sin(2*b*x + 2*d*x + 2*a + 2*c)/(b + d) + 1/16*sin(2*b*x - 2*d *x + 2*a - 2*c)/(b - d) + 1/8*sin(2*b*x + 2*a)/b + 1/8*sin(2*d*x + 2*c)/d
Time = 20.07 (sec) , antiderivative size = 177, normalized size of antiderivative = 2.01 \[ \int \cos ^2(a+b x) \cos ^2(c+d x) \, dx=\frac {2\,b^3\,\sin \left (2\,c+2\,d\,x\right )-2\,d^3\,\sin \left (2\,a+2\,b\,x\right )+b\,d^2\,\sin \left (2\,a-2\,c+2\,b\,x-2\,d\,x\right )-b\,d^2\,\sin \left (2\,a+2\,c+2\,b\,x+2\,d\,x\right )+b^2\,d\,\sin \left (2\,a-2\,c+2\,b\,x-2\,d\,x\right )+b^2\,d\,\sin \left (2\,a+2\,c+2\,b\,x+2\,d\,x\right )+2\,b^2\,d\,\sin \left (2\,a+2\,b\,x\right )-2\,b\,d^2\,\sin \left (2\,c+2\,d\,x\right )-4\,b\,d^3\,x+4\,b^3\,d\,x}{16\,b\,d\,\left (b^2-d^2\right )} \] Input:
int(cos(a + b*x)^2*cos(c + d*x)^2,x)
Output:
(2*b^3*sin(2*c + 2*d*x) - 2*d^3*sin(2*a + 2*b*x) + b*d^2*sin(2*a - 2*c + 2 *b*x - 2*d*x) - b*d^2*sin(2*a + 2*c + 2*b*x + 2*d*x) + b^2*d*sin(2*a - 2*c + 2*b*x - 2*d*x) + b^2*d*sin(2*a + 2*c + 2*b*x + 2*d*x) + 2*b^2*d*sin(2*a + 2*b*x) - 2*b*d^2*sin(2*c + 2*d*x) - 4*b*d^3*x + 4*b^3*d*x)/(16*b*d*(b^2 - d^2))
Time = 0.16 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.75 \[ \int \cos ^2(a+b x) \cos ^2(c+d x) \, dx=\frac {-2 \cos \left (b x +a \right ) \sin \left (b x +a \right ) \sin \left (d x +c \right )^{2} b^{2} d +2 \cos \left (b x +a \right ) \sin \left (b x +a \right ) b^{2} d -\cos \left (b x +a \right ) \sin \left (b x +a \right ) d^{3}+2 \cos \left (d x +c \right ) \sin \left (b x +a \right )^{2} \sin \left (d x +c \right ) b \,d^{2}+\cos \left (d x +c \right ) \sin \left (d x +c \right ) b^{3}-2 \cos \left (d x +c \right ) \sin \left (d x +c \right ) b \,d^{2}+b^{3} d x -b \,d^{3} x}{4 b d \left (b^{2}-d^{2}\right )} \] Input:
int(cos(b*x+a)^2*cos(d*x+c)^2,x)
Output:
( - 2*cos(a + b*x)*sin(a + b*x)*sin(c + d*x)**2*b**2*d + 2*cos(a + b*x)*si n(a + b*x)*b**2*d - cos(a + b*x)*sin(a + b*x)*d**3 + 2*cos(c + d*x)*sin(a + b*x)**2*sin(c + d*x)*b*d**2 + cos(c + d*x)*sin(c + d*x)*b**3 - 2*cos(c + d*x)*sin(c + d*x)*b*d**2 + b**3*d*x - b*d**3*x)/(4*b*d*(b**2 - d**2))