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

Optimal. Leaf size=66 \[ -\frac {e^{a+b x-c x^2}}{2 c}-\frac {b e^{a+\frac {b^2}{4 c}} \sqrt {\pi } \text {erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{4 c^{3/2}} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {2272, 2266, 2236} \begin {gather*} -\frac {\sqrt {\pi } b e^{a+\frac {b^2}{4 c}} \text {Erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{4 c^{3/2}}-\frac {e^{a+b x-c x^2}}{2 c} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-1/2*E^(a + b*x - c*x^2)/c - (b*E^(a + b^2/(4*c))*Sqrt[Pi]*Erf[(b - 2*c*x)/(2*Sqrt[c])])/(4*c^(3/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]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.11, size = 68, normalized size = 1.03 \begin {gather*} -\frac {e^{a+b x-c x^2}}{2 c}+\frac {b e^{a+\frac {b^2}{4 c}} \sqrt {\pi } \text {erf}\left (\frac {-b+2 c x}{2 \sqrt {c}}\right )}{4 c^{3/2}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 53, normalized size = 0.80

method result size
default \(-\frac {{\mathrm e}^{-c \,x^{2}+b x +a}}{2 c}-\frac {b \sqrt {\pi }\, {\mathrm e}^{a +\frac {b^{2}}{4 c}} \erf \left (-\sqrt {c}\, x +\frac {b}{2 \sqrt {c}}\right )}{4 c^{\frac {3}{2}}}\) \(53\)
risch \(-\frac {{\mathrm e}^{-c \,x^{2}+b x +a}}{2 c}-\frac {b \sqrt {\pi }\, {\mathrm e}^{\frac {4 c a +b^{2}}{4 c}} \erf \left (-\sqrt {c}\, x +\frac {b}{2 \sqrt {c}}\right )}{4 c^{\frac {3}{2}}}\) \(56\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.34, size = 98, normalized size = 1.48 \begin {gather*} \frac {{\left (\frac {\sqrt {\pi } {\left (2 \, c x - b\right )} b {\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 {3}{2}}} - \frac {2 \, c e^{\left (-\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}}{\left (-c\right )^{\frac {3}{2}}}\right )} e^{\left (a + \frac {b^{2}}{4 \, c}\right )}}{4 \, \sqrt {-c}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 57, normalized size = 0.86 \begin {gather*} \frac {\sqrt {\pi } b \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 \, c e^{\left (-c x^{2} + b x + a\right )}}{4 \, c^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} e^{a} \int x e^{b x} e^{- c x^{2}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 3.19, size = 58, normalized size = 0.88 \begin {gather*} -\frac {\frac {\sqrt {\pi } b \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 \, e^{\left (-c x^{2} + b x + a\right )}}{4 \, c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 3.47, size = 58, normalized size = 0.88 \begin {gather*} -\frac {{\mathrm {e}}^{b\,x}\,{\mathrm {e}}^a\,{\mathrm {e}}^{-c\,x^2}}{2\,c}-\frac {b\,\sqrt {\pi }\,{\mathrm {e}}^{\frac {b^2}{4\,c}}\,{\mathrm {e}}^a\,\mathrm {erfi}\left (\frac {b}{2\,\sqrt {-c}}+\sqrt {-c}\,x\right )}{4\,{\left (-c\right )}^{3/2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________