# Analytic integration of discontinuous function

I'm trying to calculate the convolution between a Gaussian and a discontinuous function: $$(f*g)(t)=\int_{-\infty}^\infty f(\tau)\,g(t-\tau)\,\mathrm{d}\tau$$

Where $$f(t\geq0)=\mathrm{exp}(-kt),\,f(t<0)=0$$
$$g(t)=\frac{1}{\sigma\sqrt(2\pi)}\mathrm{exp}(-\frac{1}{2}(\frac{t- \mu}{\sigma})^2)$$

I've managed to calculate the positive part by limiting the integral domain:

$$\int_0^\infty f(\tau)\,g(t-\tau)\,\mathrm{d}\tau =\frac{1}{2}\mathrm{exp}(-kt)\,\mathrm{exp}(\frac{k}{2}(k\sigma^2+2\mu))\,\left(\mathrm{erf}\left(\frac{t-\,k\,\sigma ^2-\,\mu}{\sqrt{2}\,\sigma }\right)+1\right)$$

Is there any way to calculate the negative part ?
Update: $$(f*g)(t)=\int_{-\infty}^\infty f(\tau)\,g(t-\tau)\,\mathrm{d}\tau=\int_{-\infty}^0 f(\tau)\,g(t-\tau)\,\mathrm{d}\tau+\int_{0}^\infty f(\tau)\,g(t-\tau)\,\mathrm{d}\tau=0+\int_{0}^\infty f(\tau)\,g(t-\tau)\,\mathrm{d}\tau$$

• What do you mean by "even $f(t)$ is zero, the integral is not"? – MSobak Aug 27 '18 at 15:58
• Maybe this will help. If $y<0$, then $f(y)=0$, so also $f(y)g(t-y)=0$, so $\int_{-\infty}^0 f(y)g(t-y)\text{d}y = 0$ – Jakobian Aug 27 '18 at 15:58
• @Sobi at t<0, g(t) still overlap with the positive part of f(t), note that the integration is not with respect to t. – 7E10FC9A Aug 27 '18 at 16:11
• @7E10FC9A But you're integrating with respect to $\tau$, and you have $f(\tau)$ in your integral. So when $\tau < 0,$ then $f(\tau) = 0$ and the integral is $0$. – MSobak Aug 27 '18 at 16:12

You have $$(f*g)(t) = \int_{-\infty}^\infty f(\tau)g(t-\tau) \, d\tau = \int_{0}^\infty f(\tau)g(t-\tau) \, d\tau + \int_{-\infty}^0 f(\tau)g(t-\tau) \, d\tau.$$ You already computed the first integral, and the second integral is $0$, since $f(\tau) = 0$ for all $\tau < 0$.