\(\int \sin (x) \sin (2 x) \sin (3 x) \, dx\) [142]

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

Optimal result

Integrand size = 11, antiderivative size = 25 \[ \int \sin (x) \sin (2 x) \sin (3 x) \, dx=-\frac {1}{8} \cos (2 x)-\frac {1}{16} \cos (4 x)+\frac {1}{24} \cos (6 x) \]

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {4440, 2718} \[ \int \sin (x) \sin (2 x) \sin (3 x) \, dx=-\frac {1}{8} \cos (2 x)-\frac {1}{16} \cos (4 x)+\frac {1}{24} \cos (6 x) \]

[In]

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

[Out]

-1/8*Cos[2*x] - Cos[4*x]/16 + Cos[6*x]/24

Rule 2718

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

Rule 4440

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]

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

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00 \[ \int \sin (x) \sin (2 x) \sin (3 x) \, dx=-\frac {1}{8} \cos (2 x)-\frac {1}{16} \cos (4 x)+\frac {1}{24} \cos (6 x) \]

[In]

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

[Out]

-1/8*Cos[2*x] - Cos[4*x]/16 + Cos[6*x]/24

Maple [A] (verified)

Time = 1.32 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.80

method result size
default \(-\frac {\cos \left (2 x \right )}{8}-\frac {\cos \left (4 x \right )}{16}+\frac {\cos \left (6 x \right )}{24}\) \(20\)
risch \(-\frac {\cos \left (2 x \right )}{8}-\frac {\cos \left (4 x \right )}{16}+\frac {\cos \left (6 x \right )}{24}\) \(20\)
parallelrisch \(-\frac {3}{16}+\frac {\cos \left (6 x \right )}{24}-\frac {\cos \left (4 x \right )}{16}-\frac {\cos \left (2 x \right )}{8}\) \(21\)

[In]

int(sin(x)*sin(2*x)*sin(3*x),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.68 \[ \int \sin (x) \sin (2 x) \sin (3 x) \, dx=\frac {4}{3} \, \cos \left (x\right )^{6} - \frac {5}{2} \, \cos \left (x\right )^{4} + \cos \left (x\right )^{2} \]

[In]

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

[Out]

4/3*cos(x)^6 - 5/2*cos(x)^4 + cos(x)^2

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 114 vs. \(2 (19) = 38\).

Time = 1.14 (sec) , antiderivative size = 114, normalized size of antiderivative = 4.56 \[ \int \sin (x) \sin (2 x) \sin (3 x) \, dx=\frac {x \sin {\left (x \right )} \sin {\left (2 x \right )} \sin {\left (3 x \right )}}{4} + \frac {x \sin {\left (x \right )} \cos {\left (2 x \right )} \cos {\left (3 x \right )}}{4} + \frac {x \sin {\left (2 x \right )} \cos {\left (x \right )} \cos {\left (3 x \right )}}{4} - \frac {x \sin {\left (3 x \right )} \cos {\left (x \right )} \cos {\left (2 x \right )}}{4} - \frac {5 \sin {\left (x \right )} \sin {\left (2 x \right )} \cos {\left (3 x \right )}}{24} - \frac {\sin {\left (2 x \right )} \sin {\left (3 x \right )} \cos {\left (x \right )}}{8} - \frac {\cos {\left (x \right )} \cos {\left (2 x \right )} \cos {\left (3 x \right )}}{6} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

1/24*cos(6*x) - 1/16*cos(4*x) - 1/8*cos(2*x)

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.52 \[ \int \sin (x) \sin (2 x) \sin (3 x) \, dx=-\frac {4}{3} \, \sin \left (x\right )^{6} + \frac {3}{2} \, \sin \left (x\right )^{4} \]

[In]

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

[Out]

-4/3*sin(x)^6 + 3/2*sin(x)^4

Mupad [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.56 \[ \int \sin (x) \sin (2 x) \sin (3 x) \, dx=-\frac {{\sin \left (x\right )}^4\,\left (8\,{\sin \left (x\right )}^2-9\right )}{6} \]

[In]

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

[Out]

-(sin(x)^4*(8*sin(x)^2 - 9))/6