\(\int e^{a+b x-c x^2} x^3 \, dx\) [432]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 17, antiderivative size = 181 \[ \int e^{a+b x-c x^2} x^3 \, dx=-\frac {b^2 e^{a+b x-c x^2}}{8 c^3}-\frac {e^{a+b x-c x^2}}{2 c^2}-\frac {b e^{a+b x-c x^2} x}{4 c^2}-\frac {e^{a+b x-c x^2} x^2}{2 c}-\frac {b^3 e^{a+\frac {b^2}{4 c}} \sqrt {\pi } \text {erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{16 c^{7/2}}-\frac {3 b e^{a+\frac {b^2}{4 c}} \sqrt {\pi } \text {erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{5/2}} \]

[Out]

-1/8*b^2*exp(-c*x^2+b*x+a)/c^3-1/2*exp(-c*x^2+b*x+a)/c^2-1/4*b*exp(-c*x^2+b*x+a)*x/c^2-1/2*exp(-c*x^2+b*x+a)*x
^2/c-1/16*b^3*exp(a+1/4*b^2/c)*erf(1/2*(-2*c*x+b)/c^(1/2))*Pi^(1/2)/c^(7/2)-3/8*b*exp(a+1/4*b^2/c)*erf(1/2*(-2
*c*x+b)/c^(1/2))*Pi^(1/2)/c^(5/2)

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 181, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {2273, 2272, 2266, 2236} \[ \int e^{a+b x-c x^2} x^3 \, dx=-\frac {3 \sqrt {\pi } b e^{a+\frac {b^2}{4 c}} \text {erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{5/2}}-\frac {b^2 e^{a+b x-c x^2}}{8 c^3}-\frac {\sqrt {\pi } b^3 e^{a+\frac {b^2}{4 c}} \text {erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{16 c^{7/2}}-\frac {b x e^{a+b x-c x^2}}{4 c^2}-\frac {e^{a+b x-c x^2}}{2 c^2}-\frac {x^2 e^{a+b x-c x^2}}{2 c} \]

[In]

Int[E^(a + b*x - c*x^2)*x^3,x]

[Out]

-1/8*(b^2*E^(a + b*x - c*x^2))/c^3 - E^(a + b*x - c*x^2)/(2*c^2) - (b*E^(a + b*x - c*x^2)*x)/(4*c^2) - (E^(a +
 b*x - c*x^2)*x^2)/(2*c) - (b^3*E^(a + b^2/(4*c))*Sqrt[Pi]*Erf[(b - 2*c*x)/(2*Sqrt[c])])/(16*c^(7/2)) - (3*b*E
^(a + b^2/(4*c))*Sqrt[Pi]*Erf[(b - 2*c*x)/(2*Sqrt[c])])/(8*c^(5/2))

Rule 2236

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erf[(c + d*x)*Rt[(-b)*Log[F],
 2]]/(2*d*Rt[(-b)*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && NegQ[b]

Rule 2266

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[F^(a - b^2/(4*c)), Int[F^((b + 2*c*x)^2/(4*c))
, x], x] /; FreeQ[{F, a, b, c}, x]

Rule 2272

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

Rule 2273

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

Rubi steps \begin{align*} \text {integral}& = -\frac {e^{a+b x-c x^2} x^2}{2 c}+\frac {\int e^{a+b x-c x^2} x \, dx}{c}+\frac {b \int e^{a+b x-c x^2} x^2 \, dx}{2 c} \\ & = -\frac {e^{a+b x-c x^2}}{2 c^2}-\frac {b e^{a+b x-c x^2} x}{4 c^2}-\frac {e^{a+b x-c x^2} x^2}{2 c}+\frac {b \int e^{a+b x-c x^2} \, dx}{4 c^2}+\frac {b \int e^{a+b x-c x^2} \, dx}{2 c^2}+\frac {b^2 \int e^{a+b x-c x^2} x \, dx}{4 c^2} \\ & = -\frac {b^2 e^{a+b x-c x^2}}{8 c^3}-\frac {e^{a+b x-c x^2}}{2 c^2}-\frac {b e^{a+b x-c x^2} x}{4 c^2}-\frac {e^{a+b x-c x^2} x^2}{2 c}+\frac {b^3 \int e^{a+b x-c x^2} \, dx}{8 c^3}+\frac {\left (b e^{a+\frac {b^2}{4 c}}\right ) \int e^{-\frac {(b-2 c x)^2}{4 c}} \, dx}{4 c^2}+\frac {\left (b e^{a+\frac {b^2}{4 c}}\right ) \int e^{-\frac {(b-2 c x)^2}{4 c}} \, dx}{2 c^2} \\ & = -\frac {b^2 e^{a+b x-c x^2}}{8 c^3}-\frac {e^{a+b x-c x^2}}{2 c^2}-\frac {b e^{a+b x-c x^2} x}{4 c^2}-\frac {e^{a+b x-c x^2} x^2}{2 c}-\frac {3 b e^{a+\frac {b^2}{4 c}} \sqrt {\pi } \text {erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{5/2}}+\frac {\left (b^3 e^{a+\frac {b^2}{4 c}}\right ) \int e^{-\frac {(b-2 c x)^2}{4 c}} \, dx}{8 c^3} \\ & = -\frac {b^2 e^{a+b x-c x^2}}{8 c^3}-\frac {e^{a+b x-c x^2}}{2 c^2}-\frac {b e^{a+b x-c x^2} x}{4 c^2}-\frac {e^{a+b x-c x^2} x^2}{2 c}-\frac {b^3 e^{a+\frac {b^2}{4 c}} \sqrt {\pi } \text {erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{16 c^{7/2}}-\frac {3 b e^{a+\frac {b^2}{4 c}} \sqrt {\pi } \text {erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{5/2}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.27 (sec) , antiderivative size = 91, normalized size of antiderivative = 0.50 \[ \int e^{a+b x-c x^2} x^3 \, dx=-\frac {e^a \left (2 \sqrt {c} e^{x (b-c x)} \left (b^2+2 b c x+4 c \left (1+c x^2\right )\right )+b \left (b^2+6 c\right ) e^{\frac {b^2}{4 c}} \sqrt {\pi } \text {erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )\right )}{16 c^{7/2}} \]

[In]

Integrate[E^(a + b*x - c*x^2)*x^3,x]

[Out]

-1/16*(E^a*(2*Sqrt[c]*E^(x*(b - c*x))*(b^2 + 2*b*c*x + 4*c*(1 + c*x^2)) + b*(b^2 + 6*c)*E^(b^2/(4*c))*Sqrt[Pi]
*Erf[(b - 2*c*x)/(2*Sqrt[c])]))/c^(7/2)

Maple [A] (verified)

Time = 0.06 (sec) , antiderivative size = 154, normalized size of antiderivative = 0.85

method result size
risch \(-\frac {{\mathrm e}^{-c \,x^{2}+b x +a} x^{2}}{2 c}-\frac {b \,{\mathrm e}^{-c \,x^{2}+b x +a} x}{4 c^{2}}-\frac {b^{2} {\mathrm e}^{-c \,x^{2}+b x +a}}{8 c^{3}}-\frac {b^{3} \sqrt {\pi }\, {\mathrm e}^{\frac {4 c a +b^{2}}{4 c}} \operatorname {erf}\left (-\sqrt {c}\, x +\frac {b}{2 \sqrt {c}}\right )}{16 c^{\frac {7}{2}}}-\frac {3 b \sqrt {\pi }\, {\mathrm e}^{\frac {4 c a +b^{2}}{4 c}} \operatorname {erf}\left (-\sqrt {c}\, x +\frac {b}{2 \sqrt {c}}\right )}{8 c^{\frac {5}{2}}}-\frac {{\mathrm e}^{-c \,x^{2}+b x +a}}{2 c^{2}}\) \(154\)
default \(-\frac {{\mathrm e}^{-c \,x^{2}+b x +a} x^{2}}{2 c}+\frac {b \left (-\frac {{\mathrm e}^{-c \,x^{2}+b x +a} x}{2 c}+\frac {b \left (-\frac {{\mathrm e}^{-c \,x^{2}+b x +a}}{2 c}-\frac {b \sqrt {\pi }\, {\mathrm e}^{a +\frac {b^{2}}{4 c}} \operatorname {erf}\left (-\sqrt {c}\, x +\frac {b}{2 \sqrt {c}}\right )}{4 c^{\frac {3}{2}}}\right )}{2 c}-\frac {\sqrt {\pi }\, {\mathrm e}^{a +\frac {b^{2}}{4 c}} \operatorname {erf}\left (-\sqrt {c}\, x +\frac {b}{2 \sqrt {c}}\right )}{4 c^{\frac {3}{2}}}\right )}{2 c}+\frac {-\frac {{\mathrm e}^{-c \,x^{2}+b x +a}}{2 c}-\frac {b \sqrt {\pi }\, {\mathrm e}^{a +\frac {b^{2}}{4 c}} \operatorname {erf}\left (-\sqrt {c}\, x +\frac {b}{2 \sqrt {c}}\right )}{4 c^{\frac {3}{2}}}}{c}\) \(194\)
parts \(-\frac {\sqrt {\pi }\, {\mathrm e}^{a +\frac {b^{2}}{4 c}} \operatorname {erf}\left (-\sqrt {c}\, x +\frac {b}{2 \sqrt {c}}\right ) x^{3}}{2 \sqrt {c}}+\frac {{\mathrm e}^{a +\frac {b^{2}}{4 c}} \left (8 \,\operatorname {erf}\left (\frac {-2 x c +b}{2 \sqrt {c}}\right ) x^{3} c^{\frac {11}{2}} \sqrt {\pi }-c^{\frac {5}{2}} \sqrt {\pi }\, \operatorname {erf}\left (\frac {-2 x c +b}{2 \sqrt {c}}\right ) b^{3}-8 \,{\mathrm e}^{-\frac {\left (-2 x c +b \right )^{2}}{4 c}} x^{2} c^{5}-6 c^{\frac {7}{2}} \sqrt {\pi }\, \operatorname {erf}\left (\frac {-2 x c +b}{2 \sqrt {c}}\right ) b -4 b \,{\mathrm e}^{-\frac {\left (-2 x c +b \right )^{2}}{4 c}} x \,c^{4}-2 \,{\mathrm e}^{-\frac {\left (-2 x c +b \right )^{2}}{4 c}} b^{2} c^{3}-8 \,{\mathrm e}^{-\frac {\left (-2 x c +b \right )^{2}}{4 c}} c^{4}\right )}{16 c^{6}}\) \(206\)

[In]

int(exp(-c*x^2+b*x+a)*x^3,x,method=_RETURNVERBOSE)

[Out]

-1/2*exp(-c*x^2+b*x+a)*x^2/c-1/4*b*exp(-c*x^2+b*x+a)*x/c^2-1/8*b^2*exp(-c*x^2+b*x+a)/c^3-1/16*b^3/c^(7/2)*Pi^(
1/2)*exp(1/4*(4*a*c+b^2)/c)*erf(-c^(1/2)*x+1/2*b/c^(1/2))-3/8*b/c^(5/2)*Pi^(1/2)*exp(1/4*(4*a*c+b^2)/c)*erf(-c
^(1/2)*x+1/2*b/c^(1/2))-1/2*exp(-c*x^2+b*x+a)/c^2

Fricas [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 89, normalized size of antiderivative = 0.49 \[ \int e^{a+b x-c x^2} x^3 \, dx=\frac {\sqrt {\pi } {\left (b^{3} + 6 \, b c\right )} \sqrt {c} \operatorname {erf}\left (\frac {2 \, c x - b}{2 \, \sqrt {c}}\right ) e^{\left (\frac {b^{2} + 4 \, a c}{4 \, c}\right )} - 2 \, {\left (4 \, c^{3} x^{2} + 2 \, b c^{2} x + b^{2} c + 4 \, c^{2}\right )} e^{\left (-c x^{2} + b x + a\right )}}{16 \, c^{4}} \]

[In]

integrate(exp(-c*x^2+b*x+a)*x^3,x, algorithm="fricas")

[Out]

1/16*(sqrt(pi)*(b^3 + 6*b*c)*sqrt(c)*erf(1/2*(2*c*x - b)/sqrt(c))*e^(1/4*(b^2 + 4*a*c)/c) - 2*(4*c^3*x^2 + 2*b
*c^2*x + b^2*c + 4*c^2)*e^(-c*x^2 + b*x + a))/c^4

Sympy [F]

\[ \int e^{a+b x-c x^2} x^3 \, dx=e^{a} \int x^{3} e^{b x} e^{- c x^{2}}\, dx \]

[In]

integrate(exp(-c*x**2+b*x+a)*x**3,x)

[Out]

exp(a)*Integral(x**3*exp(b*x)*exp(-c*x**2), x)

Maxima [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 181, normalized size of antiderivative = 1.00 \[ \int e^{a+b x-c x^2} x^3 \, dx=\frac {{\left (\frac {\sqrt {\pi } {\left (2 \, c x - b\right )} b^{3} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {\frac {{\left (2 \, c x - b\right )}^{2}}{c}}\right ) - 1\right )}}{\sqrt {\frac {{\left (2 \, c x - b\right )}^{2}}{c}} \left (-c\right )^{\frac {7}{2}}} - \frac {6 \, b^{2} c e^{\left (-\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}}{\left (-c\right )^{\frac {7}{2}}} - \frac {12 \, {\left (2 \, c x - b\right )}^{3} b \Gamma \left (\frac {3}{2}, \frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (\frac {{\left (2 \, c x - b\right )}^{2}}{c}\right )^{\frac {3}{2}} \left (-c\right )^{\frac {7}{2}}} - \frac {8 \, c^{2} \Gamma \left (2, \frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (-c\right )^{\frac {7}{2}}}\right )} e^{\left (a + \frac {b^{2}}{4 \, c}\right )}}{16 \, \sqrt {-c}} \]

[In]

integrate(exp(-c*x^2+b*x+a)*x^3,x, algorithm="maxima")

[Out]

1/16*(sqrt(pi)*(2*c*x - b)*b^3*(erf(1/2*sqrt((2*c*x - b)^2/c)) - 1)/(sqrt((2*c*x - b)^2/c)*(-c)^(7/2)) - 6*b^2
*c*e^(-1/4*(2*c*x - b)^2/c)/(-c)^(7/2) - 12*(2*c*x - b)^3*b*gamma(3/2, 1/4*(2*c*x - b)^2/c)/(((2*c*x - b)^2/c)
^(3/2)*(-c)^(7/2)) - 8*c^2*gamma(2, 1/4*(2*c*x - b)^2/c)/(-c)^(7/2))*e^(a + 1/4*b^2/c)/sqrt(-c)

Giac [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 104, normalized size of antiderivative = 0.57 \[ \int e^{a+b x-c x^2} x^3 \, dx=-\frac {\frac {\sqrt {\pi } {\left (b^{3} + 6 \, b c\right )} \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x - \frac {b}{c}\right )}\right ) e^{\left (\frac {b^{2} + 4 \, a c}{4 \, c}\right )}}{\sqrt {c}} + 2 \, {\left (c^{2} {\left (2 \, x - \frac {b}{c}\right )}^{2} + 3 \, b c {\left (2 \, x - \frac {b}{c}\right )} + 3 \, b^{2} + 4 \, c\right )} e^{\left (-c x^{2} + b x + a\right )}}{16 \, c^{3}} \]

[In]

integrate(exp(-c*x^2+b*x+a)*x^3,x, algorithm="giac")

[Out]

-1/16*(sqrt(pi)*(b^3 + 6*b*c)*erf(-1/2*sqrt(c)*(2*x - b/c))*e^(1/4*(b^2 + 4*a*c)/c)/sqrt(c) + 2*(c^2*(2*x - b/
c)^2 + 3*b*c*(2*x - b/c) + 3*b^2 + 4*c)*e^(-c*x^2 + b*x + a))/c^3

Mupad [B] (verification not implemented)

Time = 0.30 (sec) , antiderivative size = 112, normalized size of antiderivative = 0.62 \[ \int e^{a+b x-c x^2} x^3 \, dx=-{\mathrm {e}}^{-c\,x^2+b\,x+a}\,\left (\frac {1}{2\,c^2}+\frac {b^2}{8\,c^3}\right )-\frac {x^2\,{\mathrm {e}}^{-c\,x^2+b\,x+a}}{2\,c}-\frac {b\,x\,{\mathrm {e}}^{-c\,x^2+b\,x+a}}{4\,c^2}-\frac {\sqrt {\pi }\,\mathrm {erfi}\left (\frac {\frac {b}{2}-c\,x}{\sqrt {-c}}\right )\,{\mathrm {e}}^{a+\frac {b^2}{4\,c}}\,\left (b^3+6\,c\,b\right )}{16\,{\left (-c\right )}^{7/2}} \]

[In]

int(x^3*exp(a + b*x - c*x^2),x)

[Out]

- exp(a + b*x - c*x^2)*(1/(2*c^2) + b^2/(8*c^3)) - (x^2*exp(a + b*x - c*x^2))/(2*c) - (b*x*exp(a + b*x - c*x^2
))/(4*c^2) - (pi^(1/2)*erfi((b/2 - c*x)/(-c)^(1/2))*exp(a + b^2/(4*c))*(6*b*c + b^3))/(16*(-c)^(7/2))