3.565 \(\int e^x x^2 \sin (x) \, dx\)

Optimal. Leaf size=50 \[ \frac{1}{2} e^x x^2 \sin (x)-\frac{1}{2} e^x x^2 \cos (x)-\frac{1}{2} e^x \sin (x)+e^x x \cos (x)-\frac{1}{2} e^x \cos (x) \]

[Out]

-(E^x*Cos[x])/2 + E^x*x*Cos[x] - (E^x*x^2*Cos[x])/2 - (E^x*Sin[x])/2 + (E^x*x^2*
Sin[x])/2

_______________________________________________________________________________________

Rubi [A]  time = 0.167055, antiderivative size = 50, normalized size of antiderivative = 1., number of steps used = 11, number of rules used = 5, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.556 \[ \frac{1}{2} e^x x^2 \sin (x)-\frac{1}{2} e^x x^2 \cos (x)-\frac{1}{2} e^x \sin (x)+e^x x \cos (x)-\frac{1}{2} e^x \cos (x) \]

Antiderivative was successfully verified.

[In]  Int[E^x*x^2*Sin[x],x]

[Out]

-(E^x*Cos[x])/2 + E^x*x*Cos[x] - (E^x*x^2*Cos[x])/2 - (E^x*Sin[x])/2 + (E^x*x^2*
Sin[x])/2

_______________________________________________________________________________________

Rubi in Sympy [F]  time = 0., size = 0, normalized size = 0. \[ \frac{x^{2} e^{x} \sin{\left (x \right )}}{2} - \frac{x^{2} e^{x} \cos{\left (x \right )}}{2} - 2 \int x \left (\frac{e^{x} \sin{\left (x \right )}}{2} - \frac{e^{x} \cos{\left (x \right )}}{2}\right )\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(exp(x)*x**2*sin(x),x)

[Out]

x**2*exp(x)*sin(x)/2 - x**2*exp(x)*cos(x)/2 - 2*Integral(x*(exp(x)*sin(x)/2 - ex
p(x)*cos(x)/2), x)

_______________________________________________________________________________________

Mathematica [A]  time = 0.0431513, size = 25, normalized size = 0.5 \[ \frac{1}{2} e^x \left (\left (x^2-1\right ) \sin (x)-(x-1)^2 \cos (x)\right ) \]

Antiderivative was successfully verified.

[In]  Integrate[E^x*x^2*Sin[x],x]

[Out]

(E^x*(-((-1 + x)^2*Cos[x]) + (-1 + x^2)*Sin[x]))/2

_______________________________________________________________________________________

Maple [A]  time = 0.008, size = 27, normalized size = 0.5 \[ \left ( -{\frac{{x}^{2}}{2}}+x-{\frac{1}{2}} \right ){{\rm e}^{x}}\cos \left ( x \right ) + \left ({\frac{{x}^{2}}{2}}-{\frac{1}{2}} \right ){{\rm e}^{x}}\sin \left ( x \right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int(exp(x)*x^2*sin(x),x)

[Out]

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

_______________________________________________________________________________________

Maxima [A]  time = 1.3933, size = 35, normalized size = 0.7 \[ -\frac{1}{2} \,{\left (x^{2} - 2 \, x + 1\right )} \cos \left (x\right ) e^{x} + \frac{1}{2} \,{\left (x^{2} - 1\right )} e^{x} \sin \left (x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x^2*e^x*sin(x),x, algorithm="maxima")

[Out]

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

_______________________________________________________________________________________

Fricas [A]  time = 6.30064, size = 35, normalized size = 0.7 \[ -\frac{1}{2} \,{\left (x^{2} - 2 \, x + 1\right )} \cos \left (x\right ) e^{x} + \frac{1}{2} \,{\left (x^{2} - 1\right )} e^{x} \sin \left (x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x^2*e^x*sin(x),x, algorithm="fricas")

[Out]

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

_______________________________________________________________________________________

Sympy [A]  time = 3.21248, size = 48, normalized size = 0.96 \[ \frac{x^{2} e^{x} \sin{\left (x \right )}}{2} - \frac{x^{2} e^{x} \cos{\left (x \right )}}{2} + x e^{x} \cos{\left (x \right )} - \frac{e^{x} \sin{\left (x \right )}}{2} - \frac{e^{x} \cos{\left (x \right )}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(exp(x)*x**2*sin(x),x)

[Out]

x**2*exp(x)*sin(x)/2 - x**2*exp(x)*cos(x)/2 + x*exp(x)*cos(x) - exp(x)*sin(x)/2
- exp(x)*cos(x)/2

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.198486, size = 34, normalized size = 0.68 \[ -\frac{1}{2} \,{\left ({\left (x^{2} - 2 \, x + 1\right )} \cos \left (x\right ) -{\left (x^{2} - 1\right )} \sin \left (x\right )\right )} e^{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x^2*e^x*sin(x),x, algorithm="giac")

[Out]

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