Definite integral of split function Given the split functions
$$f_{\lambda}(x) = \begin{cases}
       \lambda\exp(-\lambda x) &\quad\text{if } x>0\\
       0&\quad\text{otherwise.}\\
\end{cases}$$
The solution in my textbook to the definite integral $$\int_{-\infty}^{\infty}f_{\lambda}(x)dx$$ is the following
$$
\begin{aligned} \int_{-\infty}^{\infty} f_{\lambda}(x) d x &=\int_{0}^{\infty} \lambda \exp (-\lambda x) d x=[-\exp (-\lambda x)]_{0}^{\infty} \\ &=\lim _{s \rightarrow \infty}-\exp (-\lambda s)+\exp (0)=0+1=1 \end{aligned}
$$
But since the $\lambda\exp(-\lambda x)$ part of the split function isn't defined at 0 i am unsure as to why we can insert it into the function when we insert the boundaries to find the definite integral?
Meaning why is the solution not the following 
$$
\begin{aligned} \int_{-\infty}^{\infty} f_{\lambda}(x) d x &=\int_{0}^{\infty} \lambda \exp (-\lambda x) d x=[-\exp (-\lambda x)]_{0}^{\infty} \\ &=\lim _{s \rightarrow \infty}-\exp (-\lambda s)+0=0+0=0\end{aligned}
$$
 A: Note that $f_\lambda$ is actually defined st $0$ and we have $f_\lambda(0)=0$. It is however (unless $\lambda=0$) not continuous at $0$.
Since neither the Riemann nor the Lebesgue integral require the integrand to be continuous, this is still a very well-posed problem.
As a remark: The Riemann integral doesn‘t depend on the value of a function in a single point, so it doesn‘t matter what $f(0)$ is. In fact, if you are curious, you can look at the Lebesgue integral which doesn‘t depend on $f$ in any null set ($L^p$ spaces „use“ this fact.)

Edit:
Theorem: We have $\int_0^\infty f_\lambda(x) \, \mathrm dx$.
Proof. Define the function $$g(x)=\begin{cases}f_\lambda(x), &\text{if } x>0\\ \lambda, &\text{if } x=0\end{cases}.$$ Check that $g$ is continuous. Note that $g$ differs from $f$ only in one point. By this answer, we know that $$\int_0^\infty g(x)\,\mathrm dx=\int_0^\infty f(x) \,\mathrm dx.$$
Since $g$ has the anti-derivative $-\exp (-\lambda x)$, we have proven the Theorem. $\square$
Intuitively, this means that the integral is independent of the value of $f$ in a single point.
Edit 2: About "why can we use $\exp(0)$ when $f(0)\neq\exp(0)$?" Make sure not to mix up a function and its anti-derivative.
