Why does $e^{-x}$ integrate to $1$ in interval $(0, \infty)$? My question is relatively elementary, but I haven't been able to find any clear explanations despite searching online so I decided to ask my own question.

I've always learned that
$$ \int_{0}^{\infty}e^{-x}dx = \int_{-\infty}^{0}e^xdx = 1$$
but I would like to specifically understand why this is the case, rather than just keeping the information stored in my head.
Would anybody be kind enough to explain why the function $f(x) = e^x$ integrates to $1$ in the given interval?

Thank you.
 A: Let $f(x) = e^x$ and $F(x) = e^x$. Then $F'=f$ and so
$$
\int_{t}^{0}e^x \,dx
= \int_{t}^{0}f(x) \,dx
= \int_{t}^{0}F'(x) \,dx
= F(x)|_{t}^{0}
= F(0) - F(t)
= 1 - e^t
$$
Therefore,
$$
\int_{-\infty}^{0}e^x \,dx
= \lim_{t\to-\infty} \int_{t}^{0}e^x \,dx
= \lim_{t\to-\infty} 1 - e^t
= 1 - \lim_{t\to-\infty} e^t
= 1 - 0
= 1
$$
A: Let's use the definition of Riemann sum for the integral:
$$\int_0^M e^{-x}dx=\lim_{N \to \infty} \frac{M}{N} \sum_{n=0}^N e^{-\frac{nM}{N}} $$
If we are familiar with the geometric sum formula (here $e$ is just a number and all we need to know is $e>1$), we can write:
$$\sum_{n=0}^N e^{-\frac{nM}{N}}=\frac{1-e^{-M \frac{N+1}{N}}}{1-e^{-\frac{M}{N}}}$$
Now we need to find the limit:
$$\lim_{N \to \infty} \frac{M}{N} \frac{1-e^{-M \frac{N+1}{N}}}{1-e^{-\frac{M}{N}}}=1-e^{-M }$$
We used the fact that for small $p$ we have $e^{-p} \approx 1-p$, which follows from any definition of the exponential function, for example the series definition.
Now we take the limit:
$$\lim_{M \to \infty} 1-e^{-M }=1$$

This may look fishy, as we brought both $N$ and $M$ to infinity, meanwhile we required before that $M \ll N$. However, it makes sense because Riemann sum requires us to subdivide the whole integration interval into many small pieces, so of course their number should be larger than the size of the interval, since we need their length to be $\frac{M}{N} \ll 1$.
A: We can just integrate it indefinitely and put the limits(by using the fundamental theorem of calculus), put $e^{-\infty} = 0$.
The explanation for the last step is that it is not actually putting $\infty$ in power, it is actually $\lim_{x \to -\infty}e^{x}$, which evaluates to $0$.
