\(\int x \sin (4 x) \, dx\) [22]

   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 = 6, antiderivative size = 18 \[ \int x \sin (4 x) \, dx=-\frac {1}{4} x \cos (4 x)+\frac {1}{16} \sin (4 x) \]

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 18, 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.333, Rules used = {3377, 2717} \[ \int x \sin (4 x) \, dx=\frac {1}{16} \sin (4 x)-\frac {1}{4} x \cos (4 x) \]

[In]

Int[x*Sin[4*x],x]

[Out]

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

Rule 2717

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

Rule 3377

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(-(c + d*x)^m)*(Cos[e + f*x]/f), x]
+ Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

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

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.00 \[ \int x \sin (4 x) \, dx=-\frac {1}{4} x \cos (4 x)+\frac {1}{16} \sin (4 x) \]

[In]

Integrate[x*Sin[4*x],x]

[Out]

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

Maple [A] (verified)

Time = 0.14 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.83

method result size
derivativedivides \(-\frac {x \cos \left (4 x \right )}{4}+\frac {\sin \left (4 x \right )}{16}\) \(15\)
default \(-\frac {x \cos \left (4 x \right )}{4}+\frac {\sin \left (4 x \right )}{16}\) \(15\)
risch \(-\frac {x \cos \left (4 x \right )}{4}+\frac {\sin \left (4 x \right )}{16}\) \(15\)
parallelrisch \(-\frac {x \cos \left (4 x \right )}{4}+\frac {\sin \left (4 x \right )}{16}\) \(15\)
parts \(-\frac {x \cos \left (4 x \right )}{4}+\frac {\sin \left (4 x \right )}{16}\) \(15\)
meijerg \(\frac {\sqrt {\pi }\, \left (-\frac {2 x \cos \left (4 x \right )}{\sqrt {\pi }}+\frac {\sin \left (4 x \right )}{2 \sqrt {\pi }}\right )}{8}\) \(26\)
norman \(\frac {-\frac {x}{4}+\frac {x \left (\tan ^{2}\left (2 x \right )\right )}{4}+\frac {\tan \left (2 x \right )}{8}}{1+\tan ^{2}\left (2 x \right )}\) \(31\)

[In]

int(x*sin(4*x),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.78 \[ \int x \sin (4 x) \, dx=-\frac {1}{4} \, x \cos \left (4 \, x\right ) + \frac {1}{16} \, \sin \left (4 \, x\right ) \]

[In]

integrate(x*sin(4*x),x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.78 \[ \int x \sin (4 x) \, dx=- \frac {x \cos {\left (4 x \right )}}{4} + \frac {\sin {\left (4 x \right )}}{16} \]

[In]

integrate(x*sin(4*x),x)

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.78 \[ \int x \sin (4 x) \, dx=-\frac {1}{4} \, x \cos \left (4 \, x\right ) + \frac {1}{16} \, \sin \left (4 \, x\right ) \]

[In]

integrate(x*sin(4*x),x, algorithm="maxima")

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.78 \[ \int x \sin (4 x) \, dx=-\frac {1}{4} \, x \cos \left (4 \, x\right ) + \frac {1}{16} \, \sin \left (4 \, x\right ) \]

[In]

integrate(x*sin(4*x),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.78 \[ \int x \sin (4 x) \, dx=\frac {\sin \left (4\,x\right )}{16}-\frac {x\,\cos \left (4\,x\right )}{4} \]

[In]

int(x*sin(4*x),x)

[Out]

sin(4*x)/16 - (x*cos(4*x))/4