Integrating $\int_0^{500}e^{\frac{(x-a)^2}{b^2}} dx$ Well the title says it all: 
Can someone please help me integrate:
$$\int_0^{500} e^{\frac{-(x-a)^2}{b^2}} \, dx$$
I need to understand how $e$ can be integrated when it is to the power of a polynomial. Another example that would help with my understanding is how someone would integrate:
$$\int_0^{500} e^{\frac{-x^2 + 4ax - 2a^2}{b^2}} \, dx$$
$a$ and $b$ are constants in this case.
Any help would be appreciated.
 A: Later note: I see that while I was writing this, the question got edited so that now it's a definite integral rather than an indefinite integral, and also it's being suggested that maybe there should be a minus sign in the exponent.  Clive Newstead's comment what written while the exponent still had $+1$ as the leading coefficient; I don't know whether the question will be further edited to change that.
end of later note
One question that's probably been asked here many times is how to find the value of the Gaussian integral
$$
\int_{-\infty}^\infty e^{-x^2/2} \, dx = \sqrt{2\pi\,{}}.\tag{1}
$$
(Or maybe it didn't have the division by $2$ in the denominator---a difference trivially dealt with.)  I'd start by searching on the term "Gaussian integral" for that one.
The next question is: what happens if instead of $-x^2/2$ the exponent is some other quadratic polynomial in $x$.  The answer is that those are reduced to $(1)$ by means of (a) completing the square, and (b) trivial algebra, and (c) remembering the simplest integrations by substitution.  Ask about details of (a), (b), and (c) if you're interested.
Next we have
$$
\int_{-\infty}^x e^{-u^2/2} \, du.
$$
As a function of $x$, this is the antiderivative that your question asks about (general quadratic polynomials with a negative leading coefficient are reducible to this by means of (a), (b), and (c) mentioned above).  Conventionally, one uses the capital Greek letter $\Phi$ as follows:
$$
\Phi(x) = \frac{1}{\sqrt{2\pi}} \int_{-\infty}^x e^{-u^2/2} \, du,
$$
so that $\Phi(x)\to0$ as $x\to-\infty$ and $\Phi(x)\to1$ as $x\to\infty$.  Thus we have
$$
\int e^{-x^2/2} \, dx = \sqrt{2\pi\,{}}\, \Phi(x) + \text{constant}.
$$
This function $\Phi$ is not an "elementary function", i.e. it can't be built from the sorts of functions one typically encounters in first-year calculus by using the operations normally used there.  The proof that it is not elementary seems not to be known to most mathematicians even though everyone knows the statement.
With more general quadratic polynomials in the exponent, one can readily reduce the problem to this one, provided the leading coefficient is negative.  If the leading coefficient is non-negative, then we have
$$
\int_{-\infty}^x \cdots\cdots \,du = \infty,
$$
but there is still an antiderivative:
$$
x\mapsto \int_0^x e^{au^2+bu+c}\,du+\text{constant}.\tag{2}
$$
But again, this is a non-elementary function.
Now here's a question that had not occurred to me until I read Clive Newstead's comment above: Can the function $(2)$, with $a>0$ rather than $a<0$, really be reduced to some expression involving the function $\Phi$ merely by routine substitutions?  I don't know the answer to that one; maybe I missed something obvious.  (It's easy to see what happens when $a=0$?)
A: You can use the error function to evaluate the integral
$$ \int_0^{500} e^{\frac{-(x-a)^2}{b^2}} \, dx= b\int _{-{\frac {a}{b}}}^{-{\frac {-500+a}{b}}}\!{{\rm e}^{-{t}^{2}}}{
dt}
=\frac{1}{2}\,{{\rm erf}\left({\frac {a}{b}}\right)}\sqrt {\pi }b-\frac{1}{2}\,
{{\rm erf}\left({\frac {-500+a}{b}}\right)}\sqrt {\pi }b \,,$$
where the change of variables $ t=\frac{x-a}{b} $ has been used.
