### 3.111 $$\int \cos (x) \cos (2 x) \cos (3 x) \, dx$$

Optimal. Leaf size=30 $\frac{x}{4}+\frac{1}{8} \sin (2 x)+\frac{1}{16} \sin (4 x)+\frac{1}{24} \sin (6 x)$

[Out]

x/4 + Sin[2*x]/8 + Sin[4*x]/16 + Sin[6*x]/24

________________________________________________________________________________________

Rubi [A]  time = 0.0306922, antiderivative size = 30, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 2, integrand size = 11, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.182, Rules used = {4355, 2637} $\frac{x}{4}+\frac{1}{8} \sin (2 x)+\frac{1}{16} \sin (4 x)+\frac{1}{24} \sin (6 x)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

x/4 + Sin[2*x]/8 + Sin[4*x]/16 + Sin[6*x]/24

Rule 4355

Int[(F_)[(a_.) + (b_.)*(x_)]^(p_.)*(G_)[(c_.) + (d_.)*(x_)]^(q_.)*(H_)[(e_.) + (f_.)*(x_)]^(r_.), x_Symbol] :>
Int[ExpandTrigReduce[ActivateTrig[F[a + b*x]^p*G[c + d*x]^q*H[e + f*x]^r], x], x] /; FreeQ[{a, b, c, d, e, f}
, x] && (EqQ[F, sin] || EqQ[F, cos]) && (EqQ[G, sin] || EqQ[G, cos]) && (EqQ[H, sin] || EqQ[H, cos]) && IGtQ[p
, 0] && IGtQ[q, 0] && IGtQ[r, 0]

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \cos (x) \cos (2 x) \cos (3 x) \, dx &=\int \left (\frac{1}{4}+\frac{1}{4} \cos (2 x)+\frac{1}{4} \cos (4 x)+\frac{1}{4} \cos (6 x)\right ) \, dx\\ &=\frac{x}{4}+\frac{1}{4} \int \cos (2 x) \, dx+\frac{1}{4} \int \cos (4 x) \, dx+\frac{1}{4} \int \cos (6 x) \, dx\\ &=\frac{x}{4}+\frac{1}{8} \sin (2 x)+\frac{1}{16} \sin (4 x)+\frac{1}{24} \sin (6 x)\\ \end{align*}

Mathematica [A]  time = 0.0084162, size = 30, normalized size = 1. $\frac{x}{4}+\frac{1}{8} \sin (2 x)+\frac{1}{16} \sin (4 x)+\frac{1}{24} \sin (6 x)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

x/4 + Sin[2*x]/8 + Sin[4*x]/16 + Sin[6*x]/24

________________________________________________________________________________________

Maple [A]  time = 0., size = 23, normalized size = 0.8 \begin{align*}{\frac{x}{4}}+{\frac{\sin \left ( 2\,x \right ) }{8}}+{\frac{\sin \left ( 4\,x \right ) }{16}}+{\frac{\sin \left ( 6\,x \right ) }{24}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*x+1/8*sin(2*x)+1/16*sin(4*x)+1/24*sin(6*x)

________________________________________________________________________________________

Maxima [A]  time = 0.931044, size = 30, normalized size = 1. \begin{align*} \frac{1}{4} \, x + \frac{1}{24} \, \sin \left (6 \, x\right ) + \frac{1}{16} \, \sin \left (4 \, x\right ) + \frac{1}{8} \, \sin \left (2 \, x\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*x + 1/24*sin(6*x) + 1/16*sin(4*x) + 1/8*sin(2*x)

________________________________________________________________________________________

Fricas [A]  time = 1.97036, size = 81, normalized size = 2.7 \begin{align*} \frac{1}{12} \,{\left (16 \, \cos \left (x\right )^{5} - 10 \, \cos \left (x\right )^{3} + 3 \, \cos \left (x\right )\right )} \sin \left (x\right ) + \frac{1}{4} \, x \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/12*(16*cos(x)^5 - 10*cos(x)^3 + 3*cos(x))*sin(x) + 1/4*x

________________________________________________________________________________________

Sympy [B]  time = 14.4865, size = 112, normalized size = 3.73 \begin{align*} - \frac{x \sin{\left (x \right )} \sin{\left (2 x \right )} \cos{\left (3 x \right )}}{4} + \frac{x \sin{\left (x \right )} \sin{\left (3 x \right )} \cos{\left (2 x \right )}}{4} + \frac{x \sin{\left (2 x \right )} \sin{\left (3 x \right )} \cos{\left (x \right )}}{4} + \frac{x \cos{\left (x \right )} \cos{\left (2 x \right )} \cos{\left (3 x \right )}}{4} + \frac{\sin{\left (x \right )} \sin{\left (2 x \right )} \sin{\left (3 x \right )}}{24} - \frac{\sin{\left (2 x \right )} \cos{\left (x \right )} \cos{\left (3 x \right )}}{8} + \frac{\sin{\left (3 x \right )} \cos{\left (x \right )} \cos{\left (2 x \right )}}{3} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x*sin(x)*sin(2*x)*cos(3*x)/4 + x*sin(x)*sin(3*x)*cos(2*x)/4 + x*sin(2*x)*sin(3*x)*cos(x)/4 + x*cos(x)*cos(2*x
)*cos(3*x)/4 + sin(x)*sin(2*x)*sin(3*x)/24 - sin(2*x)*cos(x)*cos(3*x)/8 + sin(3*x)*cos(x)*cos(2*x)/3

________________________________________________________________________________________

Giac [A]  time = 1.06672, size = 30, normalized size = 1. \begin{align*} \frac{1}{4} \, x + \frac{1}{24} \, \sin \left (6 \, x\right ) + \frac{1}{16} \, \sin \left (4 \, x\right ) + \frac{1}{8} \, \sin \left (2 \, x\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*x + 1/24*sin(6*x) + 1/16*sin(4*x) + 1/8*sin(2*x)