\(\int \cos ^2(x) \sin (3+2 x) \, dx\) [229]

   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 = 28 \[ \int \cos ^2(x) \sin (3+2 x) \, dx=-\frac {1}{4} \cos (3+2 x)-\frac {1}{16} \cos (3+4 x)+\frac {1}{4} x \sin (3) \]

[Out]

-1/4*cos(3+2*x)-1/16*cos(3+4*x)+1/4*x*sin(3)

Rubi [A] (verified)

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

[In]

Int[Cos[x]^2*Sin[3 + 2*x],x]

[Out]

-1/4*Cos[3 + 2*x] - Cos[3 + 4*x]/16 + (x*Sin[3])/4

Rule 2718

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

Rule 4670

Int[Cos[w_]^(q_.)*Sin[v_]^(p_.), x_Symbol] :> Int[ExpandTrigReduce[Sin[v]^p*Cos[w]^q, x], x] /; IGtQ[p, 0] &&
IGtQ[q, 0] && ((PolynomialQ[v, x] && PolynomialQ[w, x]) || (BinomialQ[{v, w}, x] && IndependentQ[Cancel[v/w],
x]))

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

Mathematica [A] (verified)

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

[In]

Integrate[Cos[x]^2*Sin[3 + 2*x],x]

[Out]

-1/4*Cos[3 + 2*x] - Cos[3 + 4*x]/16 + (x*Sin[3])/4

Maple [A] (verified)

Time = 0.40 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.82

method result size
default \(-\frac {\cos \left (3+2 x \right )}{4}-\frac {\cos \left (4 x +3\right )}{16}+\frac {x \sin \left (3\right )}{4}\) \(23\)
risch \(-\frac {\cos \left (3+2 x \right )}{4}-\frac {\cos \left (4 x +3\right )}{16}+\frac {x \sin \left (3\right )}{4}\) \(23\)
parallelrisch \(-\frac {\cos \left (3+2 x \right )}{4}-\frac {\cos \left (4 x +3\right )}{16}-\frac {\cos \left (3\right )}{16}+\frac {1}{8}+\frac {x \sin \left (3\right )}{4}\) \(28\)
norman \(\frac {-2 \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+\left (\tan ^{3}\left (\frac {x}{2}\right )\right ) x +x \tan \left (\frac {x}{2}\right ) \left (\tan ^{2}\left (\frac {3}{2}+x \right )\right )-3 \left (\tan ^{3}\left (\frac {x}{2}\right )\right ) \tan \left (\frac {3}{2}+x \right )+2 \left (\tan ^{2}\left (\frac {x}{2}\right )\right ) \left (\tan ^{2}\left (\frac {3}{2}+x \right )\right )+3 \tan \left (\frac {x}{2}\right ) \tan \left (\frac {3}{2}+x \right )-x \tan \left (\frac {x}{2}\right )+\frac {x \tan \left (\frac {3}{2}+x \right )}{2}-3 x \left (\tan ^{2}\left (\frac {x}{2}\right )\right ) \tan \left (\frac {3}{2}+x \right )+\frac {x \left (\tan ^{4}\left (\frac {x}{2}\right )\right ) \tan \left (\frac {3}{2}+x \right )}{2}-\left (\tan ^{3}\left (\frac {x}{2}\right )\right ) x \left (\tan ^{2}\left (\frac {3}{2}+x \right )\right )}{\left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )^{2} \left (1+\tan ^{2}\left (\frac {3}{2}+x \right )\right )}\) \(142\)

[In]

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

[Out]

-1/4*cos(3+2*x)-1/16*cos(4*x+3)+1/4*x*sin(3)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.14 \[ \int \cos ^2(x) \sin (3+2 x) \, dx=-\frac {1}{2} \, \cos \left (3\right ) \cos \left (x\right )^{4} + \frac {1}{4} \, x \sin \left (3\right ) + \frac {1}{4} \, {\left (2 \, \cos \left (x\right )^{3} \sin \left (3\right ) + \cos \left (x\right ) \sin \left (3\right )\right )} \sin \left (x\right ) \]

[In]

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

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 75 vs. \(2 (22) = 44\).

Time = 0.32 (sec) , antiderivative size = 75, normalized size of antiderivative = 2.68 \[ \int \cos ^2(x) \sin (3+2 x) \, dx=- \frac {x \sin ^{2}{\left (x \right )} \sin {\left (2 x + 3 \right )}}{4} - \frac {x \sin {\left (x \right )} \cos {\left (x \right )} \cos {\left (2 x + 3 \right )}}{2} + \frac {x \sin {\left (2 x + 3 \right )} \cos ^{2}{\left (x \right )}}{4} - \frac {\sin {\left (x \right )} \sin {\left (2 x + 3 \right )} \cos {\left (x \right )}}{4} - \frac {\cos ^{2}{\left (x \right )} \cos {\left (2 x + 3 \right )}}{2} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.79 \[ \int \cos ^2(x) \sin (3+2 x) \, dx=\frac {1}{4} \, x \sin \left (3\right ) - \frac {1}{16} \, \cos \left (4 \, x + 3\right ) - \frac {1}{4} \, \cos \left (2 \, x + 3\right ) \]

[In]

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

[Out]

1/4*x*sin(3) - 1/16*cos(4*x + 3) - 1/4*cos(2*x + 3)

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.79 \[ \int \cos ^2(x) \sin (3+2 x) \, dx=\frac {1}{4} \, x \sin \left (3\right ) - \frac {1}{16} \, \cos \left (4 \, x + 3\right ) - \frac {1}{4} \, \cos \left (2 \, x + 3\right ) \]

[In]

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

[Out]

1/4*x*sin(3) - 1/16*cos(4*x + 3) - 1/4*cos(2*x + 3)

Mupad [B] (verification not implemented)

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

[In]

int(sin(2*x + 3)*cos(x)^2,x)

[Out]

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