3.62.36 \(\int \frac {1}{2} (43-24 x+3 x^2+e^x (-3+4 x-x^2)) \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 41, normalized size of antiderivative = 1.41, number of steps used = 10, number of rules used = 4, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {12, 2196, 2194, 2176} \begin {gather*} \frac {x^3}{2}-\frac {e^x x^2}{2}-6 x^2+3 e^x x+\frac {43 x}{2}-\frac {9 e^x}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(43 - 24*x + 3*x^2 + E^x*(-3 + 4*x - x^2))/2,x]

[Out]

(-9*E^x)/2 + (43*x)/2 + 3*E^x*x - 6*x^2 - (E^x*x^2)/2 + x^3/2

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 \left (43-24 x+3 x^2+e^x \left (-3+4 x-x^2\right )\right ) \, dx\\ &=\frac {43 x}{2}-6 x^2+\frac {x^3}{2}+\frac {1}{2} \int e^x \left (-3+4 x-x^2\right ) \, dx\\ &=\frac {43 x}{2}-6 x^2+\frac {x^3}{2}+\frac {1}{2} \int \left (-3 e^x+4 e^x x-e^x x^2\right ) \, dx\\ &=\frac {43 x}{2}-6 x^2+\frac {x^3}{2}-\frac {1}{2} \int e^x x^2 \, dx-\frac {3 \int e^x \, dx}{2}+2 \int e^x x \, dx\\ &=-\frac {3 e^x}{2}+\frac {43 x}{2}+2 e^x x-6 x^2-\frac {e^x x^2}{2}+\frac {x^3}{2}-2 \int e^x \, dx+\int e^x x \, dx\\ &=-\frac {7 e^x}{2}+\frac {43 x}{2}+3 e^x x-6 x^2-\frac {e^x x^2}{2}+\frac {x^3}{2}-\int e^x \, dx\\ &=-\frac {9 e^x}{2}+\frac {43 x}{2}+3 e^x x-6 x^2-\frac {e^x x^2}{2}+\frac {x^3}{2}\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 29, normalized size = 1.00 \begin {gather*} \frac {1}{2} \left (43 x-12 x^2+x^3-e^x \left (9-6 x+x^2\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(43 - 24*x + 3*x^2 + E^x*(-3 + 4*x - x^2))/2,x]

[Out]

(43*x - 12*x^2 + x^3 - E^x*(9 - 6*x + x^2))/2

________________________________________________________________________________________

fricas [A]  time = 0.95, size = 26, normalized size = 0.90 \begin {gather*} \frac {1}{2} \, x^{3} - 6 \, x^{2} - \frac {1}{2} \, {\left (x^{2} - 6 \, x + 9\right )} e^{x} + \frac {43}{2} \, x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/2*(-x^2+4*x-3)*exp(x)+3/2*x^2-12*x+43/2,x, algorithm="fricas")

[Out]

1/2*x^3 - 6*x^2 - 1/2*(x^2 - 6*x + 9)*e^x + 43/2*x

________________________________________________________________________________________

giac [A]  time = 0.15, size = 26, normalized size = 0.90 \begin {gather*} \frac {1}{2} \, x^{3} - 6 \, x^{2} - \frac {1}{2} \, {\left (x^{2} - 6 \, x + 9\right )} e^{x} + \frac {43}{2} \, x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/2*(-x^2+4*x-3)*exp(x)+3/2*x^2-12*x+43/2,x, algorithm="giac")

[Out]

1/2*x^3 - 6*x^2 - 1/2*(x^2 - 6*x + 9)*e^x + 43/2*x

________________________________________________________________________________________

maple [A]  time = 0.03, size = 29, normalized size = 1.00




method result size



risch \(\frac {\left (-x^{2}+6 x -9\right ) {\mathrm e}^{x}}{2}+\frac {x^{3}}{2}-6 x^{2}+\frac {43 x}{2}\) \(29\)
default \(\frac {43 x}{2}-6 x^{2}+\frac {x^{3}}{2}+3 \,{\mathrm e}^{x} x -\frac {9 \,{\mathrm e}^{x}}{2}-\frac {{\mathrm e}^{x} x^{2}}{2}\) \(31\)
norman \(\frac {43 x}{2}-6 x^{2}+\frac {x^{3}}{2}+3 \,{\mathrm e}^{x} x -\frac {9 \,{\mathrm e}^{x}}{2}-\frac {{\mathrm e}^{x} x^{2}}{2}\) \(31\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/2*(-x^2+4*x-3)*exp(x)+3/2*x^2-12*x+43/2,x,method=_RETURNVERBOSE)

[Out]

1/2*(-x^2+6*x-9)*exp(x)+1/2*x^3-6*x^2+43/2*x

________________________________________________________________________________________

maxima [A]  time = 0.35, size = 26, normalized size = 0.90 \begin {gather*} \frac {1}{2} \, x^{3} - 6 \, x^{2} - \frac {1}{2} \, {\left (x^{2} - 6 \, x + 9\right )} e^{x} + \frac {43}{2} \, x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/2*(-x^2+4*x-3)*exp(x)+3/2*x^2-12*x+43/2,x, algorithm="maxima")

[Out]

1/2*x^3 - 6*x^2 - 1/2*(x^2 - 6*x + 9)*e^x + 43/2*x

________________________________________________________________________________________

mupad [B]  time = 4.36, size = 30, normalized size = 1.03 \begin {gather*} \frac {43\,x}{2}-\frac {9\,{\mathrm {e}}^x}{2}-\frac {x^2\,{\mathrm {e}}^x}{2}+3\,x\,{\mathrm {e}}^x-6\,x^2+\frac {x^3}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((3*x^2)/2 - (exp(x)*(x^2 - 4*x + 3))/2 - 12*x + 43/2,x)

[Out]

(43*x)/2 - (9*exp(x))/2 - (x^2*exp(x))/2 + 3*x*exp(x) - 6*x^2 + x^3/2

________________________________________________________________________________________

sympy [A]  time = 0.10, size = 27, normalized size = 0.93 \begin {gather*} \frac {x^{3}}{2} - 6 x^{2} + \frac {43 x}{2} + \frac {\left (- x^{2} + 6 x - 9\right ) e^{x}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/2*(-x**2+4*x-3)*exp(x)+3/2*x**2-12*x+43/2,x)

[Out]

x**3/2 - 6*x**2 + 43*x/2 + (-x**2 + 6*x - 9)*exp(x)/2

________________________________________________________________________________________