3.6.66 \(\int e^{-3 x} x^2 \sin (x) \, dx\) [566]

Optimal. Leaf size=75 \[ -\frac {13}{250} e^{-3 x} \cos (x)-\frac {3}{25} e^{-3 x} x \cos (x)-\frac {1}{10} e^{-3 x} x^2 \cos (x)-\frac {9}{250} e^{-3 x} \sin (x)-\frac {4}{25} e^{-3 x} x \sin (x)-\frac {3}{10} e^{-3 x} x^2 \sin (x) \]

[Out]

-13/250*cos(x)/exp(3*x)-3/25*x*cos(x)/exp(3*x)-1/10*x^2*cos(x)/exp(3*x)-9/250*sin(x)/exp(3*x)-4/25*x*sin(x)/ex
p(3*x)-3/10*x^2*sin(x)/exp(3*x)

________________________________________________________________________________________

Rubi [A]
time = 0.10, antiderivative size = 75, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 5, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.454, Rules used = {4517, 4553, 14, 4518, 4554} \begin {gather*} -\frac {3}{10} e^{-3 x} x^2 \sin (x)-\frac {1}{10} e^{-3 x} x^2 \cos (x)-\frac {4}{25} e^{-3 x} x \sin (x)-\frac {9}{250} e^{-3 x} \sin (x)-\frac {3}{25} e^{-3 x} x \cos (x)-\frac {13}{250} e^{-3 x} \cos (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(x^2*Sin[x])/E^(3*x),x]

[Out]

(-13*Cos[x])/(250*E^(3*x)) - (3*x*Cos[x])/(25*E^(3*x)) - (x^2*Cos[x])/(10*E^(3*x)) - (9*Sin[x])/(250*E^(3*x))
- (4*x*Sin[x])/(25*E^(3*x)) - (3*x^2*Sin[x])/(10*E^(3*x))

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 4517

Int[(F_)^((c_.)*((a_.) + (b_.)*(x_)))*Sin[(d_.) + (e_.)*(x_)], x_Symbol] :> Simp[b*c*Log[F]*F^(c*(a + b*x))*(S
in[d + e*x]/(e^2 + b^2*c^2*Log[F]^2)), x] - Simp[e*F^(c*(a + b*x))*(Cos[d + e*x]/(e^2 + b^2*c^2*Log[F]^2)), x]
 /; FreeQ[{F, a, b, c, d, e}, x] && NeQ[e^2 + b^2*c^2*Log[F]^2, 0]

Rule 4518

Int[Cos[(d_.) + (e_.)*(x_)]*(F_)^((c_.)*((a_.) + (b_.)*(x_))), x_Symbol] :> Simp[b*c*Log[F]*F^(c*(a + b*x))*(C
os[d + e*x]/(e^2 + b^2*c^2*Log[F]^2)), x] + Simp[e*F^(c*(a + b*x))*(Sin[d + e*x]/(e^2 + b^2*c^2*Log[F]^2)), x]
 /; FreeQ[{F, a, b, c, d, e}, x] && NeQ[e^2 + b^2*c^2*Log[F]^2, 0]

Rule 4553

Int[(F_)^((c_.)*((a_.) + (b_.)*(x_)))*((f_.)*(x_))^(m_.)*Sin[(d_.) + (e_.)*(x_)]^(n_.), x_Symbol] :> Module[{u
 = IntHide[F^(c*(a + b*x))*Sin[d + e*x]^n, x]}, Dist[(f*x)^m, u, x] - Dist[f*m, Int[(f*x)^(m - 1)*u, x], x]] /
; FreeQ[{F, a, b, c, d, e, f}, x] && IGtQ[n, 0] && GtQ[m, 0]

Rule 4554

Int[Cos[(d_.) + (e_.)*(x_)]^(n_.)*(F_)^((c_.)*((a_.) + (b_.)*(x_)))*((f_.)*(x_))^(m_.), x_Symbol] :> Module[{u
 = IntHide[F^(c*(a + b*x))*Cos[d + e*x]^n, x]}, Dist[(f*x)^m, u, x] - Dist[f*m, Int[(f*x)^(m - 1)*u, x], x]] /
; FreeQ[{F, a, b, c, d, e, f}, x] && IGtQ[n, 0] && GtQ[m, 0]

Rubi steps

\begin {align*} \int e^{-3 x} x^2 \sin (x) \, dx &=-\frac {1}{10} e^{-3 x} x^2 \cos (x)-\frac {3}{10} e^{-3 x} x^2 \sin (x)-2 \int x \left (-\frac {1}{10} e^{-3 x} \cos (x)-\frac {3}{10} e^{-3 x} \sin (x)\right ) \, dx\\ &=-\frac {1}{10} e^{-3 x} x^2 \cos (x)-\frac {3}{10} e^{-3 x} x^2 \sin (x)-2 \int \left (-\frac {1}{10} e^{-3 x} x \cos (x)-\frac {3}{10} e^{-3 x} x \sin (x)\right ) \, dx\\ &=-\frac {1}{10} e^{-3 x} x^2 \cos (x)-\frac {3}{10} e^{-3 x} x^2 \sin (x)+\frac {1}{5} \int e^{-3 x} x \cos (x) \, dx+\frac {3}{5} \int e^{-3 x} x \sin (x) \, dx\\ &=-\frac {3}{25} e^{-3 x} x \cos (x)-\frac {1}{10} e^{-3 x} x^2 \cos (x)-\frac {4}{25} e^{-3 x} x \sin (x)-\frac {3}{10} e^{-3 x} x^2 \sin (x)-\frac {1}{5} \int \left (-\frac {3}{10} e^{-3 x} \cos (x)+\frac {1}{10} e^{-3 x} \sin (x)\right ) \, dx-\frac {3}{5} \int \left (-\frac {1}{10} e^{-3 x} \cos (x)-\frac {3}{10} e^{-3 x} \sin (x)\right ) \, dx\\ &=-\frac {3}{25} e^{-3 x} x \cos (x)-\frac {1}{10} e^{-3 x} x^2 \cos (x)-\frac {4}{25} e^{-3 x} x \sin (x)-\frac {3}{10} e^{-3 x} x^2 \sin (x)-\frac {1}{50} \int e^{-3 x} \sin (x) \, dx+2 \left (\frac {3}{50} \int e^{-3 x} \cos (x) \, dx\right )+\frac {9}{50} \int e^{-3 x} \sin (x) \, dx\\ &=-\frac {2}{125} e^{-3 x} \cos (x)-\frac {3}{25} e^{-3 x} x \cos (x)-\frac {1}{10} e^{-3 x} x^2 \cos (x)-\frac {6}{125} e^{-3 x} \sin (x)-\frac {4}{25} e^{-3 x} x \sin (x)-\frac {3}{10} e^{-3 x} x^2 \sin (x)+2 \left (-\frac {9}{500} e^{-3 x} \cos (x)+\frac {3}{500} e^{-3 x} \sin (x)\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 38, normalized size = 0.51 \begin {gather*} \frac {1}{250} e^{-3 x} \left (-\left (\left (13+30 x+25 x^2\right ) \cos (x)\right )-\left (9+40 x+75 x^2\right ) \sin (x)\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(x^2*Sin[x])/E^(3*x),x]

[Out]

(-((13 + 30*x + 25*x^2)*Cos[x]) - (9 + 40*x + 75*x^2)*Sin[x])/(250*E^(3*x))

________________________________________________________________________________________

Maple [A]
time = 0.05, size = 36, normalized size = 0.48

method result size
default \(\left (-\frac {1}{10} x^{2}-\frac {3}{25} x -\frac {13}{250}\right ) {\mathrm e}^{-3 x} \cos \left (x \right )+\left (-\frac {3}{10} x^{2}-\frac {4}{25} x -\frac {9}{250}\right ) {\mathrm e}^{-3 x} \sin \left (x \right )\) \(36\)
risch \(\left (-\frac {1}{500}+\frac {3 i}{500}\right ) \left (25 x^{2}+5 i x +15 x +3 i+4\right ) {\mathrm e}^{\left (-3+i\right ) x}+\left (-\frac {1}{500}-\frac {3 i}{500}\right ) \left (25 x^{2}-5 i x +15 x -3 i+4\right ) {\mathrm e}^{\left (-3-i\right ) x}\) \(54\)
norman \(\frac {\left (-\frac {13}{250}-\frac {3 x}{25}-\frac {x^{2}}{10}+\frac {13 \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{250}-\frac {8 x \tan \left (\frac {x}{2}\right )}{25}+\frac {3 x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{25}-\frac {3 x^{2} \tan \left (\frac {x}{2}\right )}{5}+\frac {x^{2} \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{10}-\frac {9 \tan \left (\frac {x}{2}\right )}{125}\right ) {\mathrm e}^{-3 x}}{1+\tan ^{2}\left (\frac {x}{2}\right )}\) \(78\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(-1/10*x^2-3/25*x-13/250)*exp(-3*x)*cos(x)+(-3/10*x^2-4/25*x-9/250)*exp(-3*x)*sin(x)

________________________________________________________________________________________

Maxima [A]
time = 2.01, size = 33, normalized size = 0.44 \begin {gather*} -\frac {1}{250} \, {\left ({\left (25 \, x^{2} + 30 \, x + 13\right )} \cos \left (x\right ) + {\left (75 \, x^{2} + 40 \, x + 9\right )} \sin \left (x\right )\right )} e^{\left (-3 \, x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/250*((25*x^2 + 30*x + 13)*cos(x) + (75*x^2 + 40*x + 9)*sin(x))*e^(-3*x)

________________________________________________________________________________________

Fricas [A]
time = 0.75, size = 37, normalized size = 0.49 \begin {gather*} -\frac {1}{250} \, {\left (25 \, x^{2} + 30 \, x + 13\right )} \cos \left (x\right ) e^{\left (-3 \, x\right )} - \frac {1}{250} \, {\left (75 \, x^{2} + 40 \, x + 9\right )} e^{\left (-3 \, x\right )} \sin \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/250*(25*x^2 + 30*x + 13)*cos(x)*e^(-3*x) - 1/250*(75*x^2 + 40*x + 9)*e^(-3*x)*sin(x)

________________________________________________________________________________________

Sympy [A]
time = 0.42, size = 80, normalized size = 1.07 \begin {gather*} - \frac {3 x^{2} e^{- 3 x} \sin {\left (x \right )}}{10} - \frac {x^{2} e^{- 3 x} \cos {\left (x \right )}}{10} - \frac {4 x e^{- 3 x} \sin {\left (x \right )}}{25} - \frac {3 x e^{- 3 x} \cos {\left (x \right )}}{25} - \frac {9 e^{- 3 x} \sin {\left (x \right )}}{250} - \frac {13 e^{- 3 x} \cos {\left (x \right )}}{250} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-3*x**2*exp(-3*x)*sin(x)/10 - x**2*exp(-3*x)*cos(x)/10 - 4*x*exp(-3*x)*sin(x)/25 - 3*x*exp(-3*x)*cos(x)/25 - 9
*exp(-3*x)*sin(x)/250 - 13*exp(-3*x)*cos(x)/250

________________________________________________________________________________________

Giac [A]
time = 1.55, size = 33, normalized size = 0.44 \begin {gather*} -\frac {1}{250} \, {\left ({\left (25 \, x^{2} + 30 \, x + 13\right )} \cos \left (x\right ) + {\left (75 \, x^{2} + 40 \, x + 9\right )} \sin \left (x\right )\right )} e^{\left (-3 \, x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/250*((25*x^2 + 30*x + 13)*cos(x) + (75*x^2 + 40*x + 9)*sin(x))*e^(-3*x)

________________________________________________________________________________________

Mupad [B]
time = 0.11, size = 39, normalized size = 0.52 \begin {gather*} -\frac {{\mathrm {e}}^{-3\,x}\,\left (13\,\cos \left (x\right )+9\,\sin \left (x\right )+25\,x^2\,\cos \left (x\right )+75\,x^2\,\sin \left (x\right )+30\,x\,\cos \left (x\right )+40\,x\,\sin \left (x\right )\right )}{250} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*exp(-3*x)*sin(x),x)

[Out]

-(exp(-3*x)*(13*cos(x) + 9*sin(x) + 25*x^2*cos(x) + 75*x^2*sin(x) + 30*x*cos(x) + 40*x*sin(x)))/250

________________________________________________________________________________________