\(\int \cos (x) \cos (3 x) \, dx\) [102]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 7, antiderivative size = 17 \[ \int \cos (x) \cos (3 x) \, dx=\frac {1}{4} \sin (2 x)+\frac {1}{8} \sin (4 x) \]

[Out]

1/4*sin(2*x)+1/8*sin(4*x)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {4368} \[ \int \cos (x) \cos (3 x) \, dx=\frac {1}{4} \sin (2 x)+\frac {1}{8} \sin (4 x) \]

[In]

Int[Cos[x]*Cos[3*x],x]

[Out]

Sin[2*x]/4 + Sin[4*x]/8

Rule 4368

Int[cos[(a_.) + (b_.)*(x_)]*cos[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[a - c + (b - d)*x]/(2*(b - d)), x]
+ Simp[Sin[a + c + (b + d)*x]/(2*(b + d)), x] /; FreeQ[{a, b, c, d}, x] && NeQ[b^2 - d^2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{4} \sin (2 x)+\frac {1}{8} \sin (4 x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.00 \[ \int \cos (x) \cos (3 x) \, dx=\frac {1}{4} \sin (2 x)+\frac {1}{8} \sin (4 x) \]

[In]

Integrate[Cos[x]*Cos[3*x],x]

[Out]

Sin[2*x]/4 + Sin[4*x]/8

Maple [A] (verified)

Time = 0.49 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.82

method result size
default \(\frac {\sin \left (2 x \right )}{4}+\frac {\sin \left (4 x \right )}{8}\) \(14\)
risch \(\frac {\sin \left (2 x \right )}{4}+\frac {\sin \left (4 x \right )}{8}\) \(14\)
parallelrisch \(\frac {\sin \left (2 x \right )}{4}+\frac {\sin \left (4 x \right )}{8}\) \(14\)
norman \(\frac {\frac {\tan \left (\frac {x}{2}\right ) \tan \left (\frac {3 x}{2}\right )^{2}}{4}-\frac {3 \tan \left (\frac {x}{2}\right )^{2} \tan \left (\frac {3 x}{2}\right )}{4}-\frac {\tan \left (\frac {x}{2}\right )}{4}+\frac {3 \tan \left (\frac {3 x}{2}\right )}{4}}{\left (1+\tan \left (\frac {x}{2}\right )^{2}\right ) \left (1+\tan \left (\frac {3 x}{2}\right )^{2}\right )}\) \(59\)

[In]

int(cos(x)*cos(3*x),x,method=_RETURNVERBOSE)

[Out]

1/4*sin(2*x)+1/8*sin(4*x)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.41 \[ \int \cos (x) \cos (3 x) \, dx=\cos \left (x\right )^{3} \sin \left (x\right ) \]

[In]

integrate(cos(x)*cos(3*x),x, algorithm="fricas")

[Out]

cos(x)^3*sin(x)

Sympy [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.18 \[ \int \cos (x) \cos (3 x) \, dx=- \frac {\sin {\left (x \right )} \cos {\left (3 x \right )}}{8} + \frac {3 \sin {\left (3 x \right )} \cos {\left (x \right )}}{8} \]

[In]

integrate(cos(x)*cos(3*x),x)

[Out]

-sin(x)*cos(3*x)/8 + 3*sin(3*x)*cos(x)/8

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.76 \[ \int \cos (x) \cos (3 x) \, dx=\frac {1}{8} \, \sin \left (4 \, x\right ) + \frac {1}{4} \, \sin \left (2 \, x\right ) \]

[In]

integrate(cos(x)*cos(3*x),x, algorithm="maxima")

[Out]

1/8*sin(4*x) + 1/4*sin(2*x)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.76 \[ \int \cos (x) \cos (3 x) \, dx=\frac {1}{8} \, \sin \left (4 \, x\right ) + \frac {1}{4} \, \sin \left (2 \, x\right ) \]

[In]

integrate(cos(x)*cos(3*x),x, algorithm="giac")

[Out]

1/8*sin(4*x) + 1/4*sin(2*x)

Mupad [B] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.41 \[ \int \cos (x) \cos (3 x) \, dx={\cos \left (x\right )}^3\,\sin \left (x\right ) \]

[In]

int(cos(3*x)*cos(x),x)

[Out]

cos(x)^3*sin(x)