3.95.18 \(\int \frac {1}{2} e^{-x} (31-18 x+x^2) \, dx\)

Optimal. Leaf size=26 \[ \left (3 e^{-x}+\frac {1}{2} e^{-x} (9-x)\right ) (-1+x) \]

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 30, normalized size of antiderivative = 1.15, number of steps used = 9, number of rules used = 4, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {12, 2196, 2194, 2176} \begin {gather*} -\frac {1}{2} e^{-x} x^2+8 e^{-x} x-\frac {15 e^{-x}}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(31 - 18*x + x^2)/(2*E^x),x]

[Out]

-15/(2*E^x) + (8*x)/E^x - x^2/(2*E^x)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 2176

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[((c + d*x)^m
*(b*F^(g*(e + f*x)))^n)/(f*g*n*Log[F]), x] - Dist[(d*m)/(f*g*n*Log[F]), Int[(c + d*x)^(m - 1)*(b*F^(g*(e + f*x
)))^n, x], x] /; FreeQ[{F, b, c, d, e, f, g, n}, x] && GtQ[m, 0] && IntegerQ[2*m] &&  !$UseGamma === True

Rule 2194

Int[((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.), x_Symbol] :> Simp[(F^(c*(a + b*x)))^n/(b*c*n*Log[F]), x] /; Fre
eQ[{F, a, b, c, n}, x]

Rule 2196

Int[(F_)^((c_.)*(v_))*(u_), x_Symbol] :> Int[ExpandIntegrand[F^(c*ExpandToSum[v, x]), u, x], x] /; FreeQ[{F, c
}, x] && PolynomialQ[u, x] && LinearQ[v, x] &&  !$UseGamma === True

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\frac {1}{2} \int e^{-x} \left (31-18 x+x^2\right ) \, dx\\ &=\frac {1}{2} \int \left (31 e^{-x}-18 e^{-x} x+e^{-x} x^2\right ) \, dx\\ &=\frac {1}{2} \int e^{-x} x^2 \, dx-9 \int e^{-x} x \, dx+\frac {31}{2} \int e^{-x} \, dx\\ &=-\frac {31 e^{-x}}{2}+9 e^{-x} x-\frac {1}{2} e^{-x} x^2-9 \int e^{-x} \, dx+\int e^{-x} x \, dx\\ &=-\frac {13 e^{-x}}{2}+8 e^{-x} x-\frac {1}{2} e^{-x} x^2+\int e^{-x} \, dx\\ &=-\frac {15 e^{-x}}{2}+8 e^{-x} x-\frac {1}{2} e^{-x} x^2\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 19, normalized size = 0.73 \begin {gather*} \frac {1}{2} e^{-x} \left (-15+16 x-x^2\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(31 - 18*x + x^2)/(2*E^x),x]

[Out]

(-15 + 16*x - x^2)/(2*E^x)

________________________________________________________________________________________

fricas [A]  time = 0.59, size = 14, normalized size = 0.54 \begin {gather*} -\frac {1}{2} \, {\left (x^{2} - 16 \, x + 15\right )} e^{\left (-x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/2*(x^2-18*x+31)/exp(x),x, algorithm="fricas")

[Out]

-1/2*(x^2 - 16*x + 15)*e^(-x)

________________________________________________________________________________________

giac [A]  time = 0.13, size = 14, normalized size = 0.54 \begin {gather*} -\frac {1}{2} \, {\left (x^{2} - 16 \, x + 15\right )} e^{\left (-x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/2*(x^2-18*x+31)/exp(x),x, algorithm="giac")

[Out]

-1/2*(x^2 - 16*x + 15)*e^(-x)

________________________________________________________________________________________

maple [A]  time = 0.03, size = 15, normalized size = 0.58




method result size



gosper \(-\frac {\left (x^{2}-16 x +15\right ) {\mathrm e}^{-x}}{2}\) \(15\)
norman \(\left (-\frac {15}{2}+8 x -\frac {1}{2} x^{2}\right ) {\mathrm e}^{-x}\) \(16\)
risch \(\frac {\left (-x^{2}+16 x -15\right ) {\mathrm e}^{-x}}{2}\) \(17\)
default \(-\frac {x^{2} {\mathrm e}^{-x}}{2}+8 x \,{\mathrm e}^{-x}-\frac {15 \,{\mathrm e}^{-x}}{2}\) \(24\)
meijerg \(\frac {15}{2}-\frac {31 \,{\mathrm e}^{-x}}{2}-\frac {\left (3 x^{2}+6 x +6\right ) {\mathrm e}^{-x}}{6}+\frac {9 \left (2 x +2\right ) {\mathrm e}^{-x}}{2}\) \(36\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/2*(x^2-18*x+31)/exp(x),x,method=_RETURNVERBOSE)

[Out]

-1/2*(x^2-16*x+15)/exp(x)

________________________________________________________________________________________

maxima [A]  time = 0.35, size = 30, normalized size = 1.15 \begin {gather*} -\frac {1}{2} \, {\left (x^{2} + 2 \, x + 2\right )} e^{\left (-x\right )} + 9 \, {\left (x + 1\right )} e^{\left (-x\right )} - \frac {31}{2} \, e^{\left (-x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/2*(x^2-18*x+31)/exp(x),x, algorithm="maxima")

[Out]

-1/2*(x^2 + 2*x + 2)*e^(-x) + 9*(x + 1)*e^(-x) - 31/2*e^(-x)

________________________________________________________________________________________

mupad [B]  time = 0.07, size = 12, normalized size = 0.46 \begin {gather*} -\frac {{\mathrm {e}}^{-x}\,\left (x-1\right )\,\left (x-15\right )}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(exp(-x)*(x^2/2 - 9*x + 31/2),x)

[Out]

-(exp(-x)*(x - 1)*(x - 15))/2

________________________________________________________________________________________

sympy [A]  time = 0.10, size = 12, normalized size = 0.46 \begin {gather*} \frac {\left (- x^{2} + 16 x - 15\right ) e^{- x}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/2*(x**2-18*x+31)/exp(x),x)

[Out]

(-x**2 + 16*x - 15)*exp(-x)/2

________________________________________________________________________________________