I don't understand why this example:
$$\int_{-\infty}^{\infty} \left(\ \delta(x)+ \frac{\delta(x-1)}{2} + \frac{\delta(x+1)}{2}\right)\ e^{-x} \ dx $$
Gives the following anwser:
$$ 1 \ + \ \frac{e^{-x}}{2} \ + \frac{e^{x}}{2} $$
Thanks for your answers
As others pointed out in the comments, this answer is certainly not correct because we expect a real number as the evaluation of the definite integral, not a function. The key is to apply the "sifting" property of the delta function: $$ \int_{-\infty}^\infty f(x)\delta(x-a)\,\mathrm{d}x = f(a). $$
Breaking up the integral with linearity, we get \begin{align*} \int_{-\infty}^{\infty} \Big[\delta(x)+ &\frac{\delta(x-1)}{2} + \frac{\delta(x+1)}{2}\Big] e^{-x}\,\mathrm{d}x \\ &=\int_{-\infty}^{\infty} \delta(x)e^{-x}\,\mathrm{d}x+ \int_{-\infty}^\infty\frac{\delta(x-1)}{2}e^{-x}\,\mathrm{d}x + \int_{-\infty}^\infty\frac{\delta(x+1)}{2}e^{-x}\,\mathrm{d}x. \end{align*} Applying the sifting property gives us the answer others have mentioned.