# Integral of a piecewise continuous function

Consider a piecewise-continuous function at the origin $f(x)$, such that $\lim_{x\to0^\pm} f(x) = f_\pm$. Let us say that the domain of the function is ${\mathbb R} - \{0\}$. We are interested in the integral $$I = \int_{-\infty}^\infty f(x) \delta(x) dx$$ Does this evaluate to the following?? $$I = \frac{1}{2} \left( f_- + f_+ \right)$$ Now, let us extend this analysis. Suppose a function $f(x)$ is only defined in the positive real axis ${\mathbb R}_{>0}$, with $\lim_{x\to0^+} f(x) = f_+$. We are interested in the integral $$I = \int_{0}^\infty f(x) \delta(x) dx$$ Is it correct to say that this integral evaluates to $I = \frac{1}{2} f_+$?

-

The trick here is to remember how "integration against delta" is defined: it's defined by integrating against a box of with $a$ and height $1/a$, and taking the limit of the result as $a \to 0$. (If the limit doesn't exist, then the integral is meaningless). Since, in your first case, $f$ is continuous on both sides of the origin (I think that's what you mean) and has finite limits from both sides, your first conclusion is correct.
For the second case, there's a slight problem: you have to decide what you mean by the integral you've written. But a reasonable interpretation is "extend $f$ to be zero on the negative real axis, and then do the integral over the whole real line, falling back to the earlier definition." In that case your conclusion is correct. It also has the charm that if you split a function $f$ into two functions, $f^{+}$ and $f^{-}$, each defined on a half-axis, then $$\int_{-\infty}^{\infty} f \delta = \int_{-\infty}^{0} f^{-} \delta + \int_{0}^{\infty} f^{+} \delta,$$ which is sort of attractive.