Limiting approximation in large deviations theory I started reading a book on Large Deviations and I can't quite follow a particular calculation in the motivating example.
Suppose that $S_n = \frac{1}{n}\sum_{i=1}^n X_i$ where the $X_i$'s are $N(0,1)$ independent. We then obtain that $P(|S_n| > \delta) = 1 - \frac{1}{\sqrt{2\pi}} \int_{-\delta \sqrt{n}}^{\delta \sqrt{n}} e^{-x^2/2} \,dx$.
The book then says that as $n\rightarrow \infty$, $\frac{1}{n} \log P(|S_n| \ge \delta) \rightarrow -\frac{\delta^2}{2}$.
I am not sure how you can get this result. First of all, what approximations can I apply to the integral $\int_{-\delta \sqrt{n}}^{\delta \sqrt{n}} e^{-x^2/2} \,dx$? Also, how does the $\frac{1}{\sqrt{2\pi}}$ disappear?
Help appreciated.
 A: Note that you can rewrite
$$
\mathbb{P}\{ \lvert S_n\rvert > \delta\}
= \frac{1}{\sqrt{2\pi}}\int_{\mathbb{R}} e^{-x^2/2}dx - \frac{1}{\sqrt{2\pi}}\int_{-\delta\sqrt{n}}^{\delta\sqrt{n}} e^{-x^2/2}dx
= \frac{2}{\sqrt{2\pi}}\int_{\delta\sqrt{n}}^{\infty} e^{-x^2/2}dx
$$
so that
$$
\frac{1}{n}\log\mathbb{P}\{ \lvert S_n\rvert > \delta\}
= \frac{1}{n}\log \sqrt{\frac{2}{\pi}}\int_{\delta\sqrt{n}}^{\infty} e^{-x^2/2}dx = \frac{1}{n}\log  \mathrm{erfc}\!\left(\delta\frac{\sqrt{n}}{\sqrt{2}}\right) \tag{1}
$$
where $\mathrm{erfc}$ is the complementary error function. Now, using the "standard fact" that the asymptotics of this functions as $x\to\infty$ is
$$
\mathrm{erfc}(x) = \left(\frac{1}{x\sqrt{\pi}}+o\left(\frac{1}{x}\right)\right)e^{-x^2} \tag{2}
$$
we get, as $n\to\infty$,
$$
\frac{1}{n}\log  \mathrm{erfc}\!\left(\delta\frac{\sqrt{n}}{\sqrt{2}}\right) = \frac{1}{n}\log\left(\left(\frac{\sqrt{2}}{\delta\sqrt{n\pi}}+o\left(\frac{1}{\sqrt{n}}\right)\right)e^{-\delta^2n/2}\right)
= -\frac{\delta^2}{2} + \underbrace{\frac{1}{n}\log\left(\frac{\sqrt{2}}{\delta\sqrt{n\pi}}+o\left(\frac{1}{\sqrt{n}}\right)\right)}_{\to 0}
$$
yielding the result; where we used $\log(1b) = \log a+\log b$, and, to conclude, that $\frac{1}{n}\log n \to 0$.
A: One way to see it directly, without relying on a "canned result" from asymptotics, is to write:
$$\int_M^\infty e^{-x^2/2} dx = \int_M^\infty e^{-x^2/2} \frac{x}{x} dx = \left. \frac{-e^{-x^2/2}}{x} \right |_{x=M}^{x \to \infty} - \int_M^\infty \frac{e^{-x^2/2}}{x^3} dx \\
= \frac{e^{-M^2/2}}{M} - \int_M^\infty \frac{e^{-x^2/2}}{x^3} dx.$$
Thus the desired quantity, $\frac{2}{\sqrt{2\pi}} \int_{\delta \sqrt{n}}^\infty e^{-x^2/2} dx$, is bounded above by 
$$\frac{2}{\sqrt{2 \pi}} \frac{e^{-\delta^2 n/2}}{\delta \sqrt{n}}$$
which is obtained by simply approximating the second term by $0$. Taking the logarithm and dividing by $n$ leaves a term $\frac{1}{n} \log \left ( \frac{2}{\sqrt{2 \pi} \delta \sqrt{n}} \right )$ which goes to zero, as well as the dominant term which is $-\delta^2/2$.
You can get a lower bound by pulling the same trick a second time: multiply by $\frac{x}{x}$, keep the $x$ in the numerator to use for a $u$-substitution, and then end up with another integral but with a $+$ sign and an $x^5$ in the denominator. Now approximate that integral by just $0$ to get a bound. It will have the same exponential scaling behavior as this upper bound does, as you can see without actually carrying out the full computation.
A way with less mechanical calculation is to use Cramer's theorem, which directly furnishes the rate function for a sum of iid random variables whose underlying distribution has a well-defined moment generating function.
