Optimal. Leaf size=134 \[ -\frac {b e^{a+b x-c x^2}}{4 c^2}-\frac {e^{a+b x-c x^2} x}{2 c}-\frac {b^2 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 {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]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 134, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 4, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {2273, 2272,
2266, 2236} \begin {gather*} -\frac {\sqrt {\pi } b^2 e^{a+\frac {b^2}{4 c}} \text {Erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{5/2}}-\frac {\sqrt {\pi } e^{a+\frac {b^2}{4 c}} \text {Erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{4 c^{3/2}}-\frac {b e^{a+b x-c x^2}}{4 c^2}-\frac {x e^{a+b x-c x^2}}{2 c} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2236
Rule 2266
Rule 2272
Rule 2273
Rubi steps
\begin {align*} \int e^{a+b x-c x^2} x^2 \, dx &=-\frac {e^{a+b x-c x^2} x}{2 c}+\frac {\int e^{a+b x-c x^2} \, dx}{2 c}+\frac {b \int e^{a+b x-c x^2} x \, dx}{2 c}\\ &=-\frac {b e^{a+b x-c x^2}}{4 c^2}-\frac {e^{a+b x-c x^2} x}{2 c}+\frac {b^2 \int e^{a+b x-c x^2} \, dx}{4 c^2}+\frac {e^{a+\frac {b^2}{4 c}} \int e^{-\frac {(b-2 c x)^2}{4 c}} \, dx}{2 c}\\ &=-\frac {b e^{a+b x-c x^2}}{4 c^2}-\frac {e^{a+b x-c x^2} x}{2 c}-\frac {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}}+\frac {\left (b^2 e^{a+\frac {b^2}{4 c}}\right ) \int e^{-\frac {(b-2 c x)^2}{4 c}} \, dx}{4 c^2}\\ &=-\frac {b e^{a+b x-c x^2}}{4 c^2}-\frac {e^{a+b x-c x^2} x}{2 c}-\frac {b^2 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 {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.20, size = 79, normalized size = 0.59 \begin {gather*} \frac {e^a \left (-2 \sqrt {c} e^{x (b-c x)} (b+2 c x)+\left (b^2+2 c\right ) e^{\frac {b^2}{4 c}} \sqrt {\pi } \text {erf}\left (\frac {-b+2 c x}{2 \sqrt {c}}\right )\right )}{8 c^{5/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.02, size = 111, normalized size = 0.83
method | result | size |
default | \(-\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}} \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}} \erf \left (-\sqrt {c}\, x +\frac {b}{2 \sqrt {c}}\right )}{4 c^{\frac {3}{2}}}\) | \(111\) |
risch | \(-\frac {{\mathrm e}^{-c \,x^{2}+b x +a} x}{2 c}-\frac {b \,{\mathrm e}^{-c \,x^{2}+b x +a}}{4 c^{2}}-\frac {b^{2} \sqrt {\pi }\, {\mathrm e}^{\frac {4 c a +b^{2}}{4 c}} \erf \left (-\sqrt {c}\, x +\frac {b}{2 \sqrt {c}}\right )}{8 c^{\frac {5}{2}}}-\frac {\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}}}\) | \(113\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.35, size = 151, normalized size = 1.13 \begin {gather*} -\frac {{\left (\frac {\sqrt {\pi } {\left (2 \, c x - b\right )} b^{2} {\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 {5}{2}}} - \frac {4 \, b c e^{\left (-\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}}{\left (-c\right )^{\frac {5}{2}}} - \frac {4 \, {\left (2 \, c x - b\right )}^{3} \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 {5}{2}}}\right )} e^{\left (a + \frac {b^{2}}{4 \, c}\right )}}{8 \, \sqrt {-c}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 72, normalized size = 0.54 \begin {gather*} \frac {\sqrt {\pi } {\left (b^{2} + 2 \, 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 (2 \, c^{2} x + b c\right )} e^{\left (-c x^{2} + b x + a\right )}}{8 \, c^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} e^{a} \int x^{2} e^{b x} e^{- c x^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 2.98, size = 80, normalized size = 0.60 \begin {gather*} -\frac {\frac {\sqrt {\pi } {\left (b^{2} + 2 \, 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 {\left (2 \, x - \frac {b}{c}\right )} + 2 \, b\right )} e^{\left (-c x^{2} + b x + a\right )}}{8 \, c^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.72, size = 80, normalized size = 0.60 \begin {gather*} \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^2+2\,c\right )}{8\,{\left (-c\right )}^{5/2}}-\frac {x\,{\mathrm {e}}^{-c\,x^2+b\,x+a}}{2\,c}-\frac {b\,{\mathrm {e}}^{-c\,x^2+b\,x+a}}{4\,c^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________