# Convolute exponential with a gaussian

I have data measuring an exponential decay that is convoluted by a gaussian response function.

I have the measured shape of the gaussian, and want an analytical expression for the exponential post-convolution that I can use to compare to the data.

I need to calculate the following, but am having trouble.

$g(\tau) = \int_-^\infty \exp(-\lambda t) \exp(-\frac{(t-\tau)^2}{2\sigma^2} ) d \tau$

Where $\sigma$ is known.

$g(\tau) = \int_-^\infty \exp(-\lambda t -\frac{t^2}{2\sigma^2} +\frac{t \tau}{\sigma^2}) \exp(-\frac{\tau^2}{2\sigma^2} ) d \tau$

The last term looks like the Error function, but Im not sure is it.

• $\int_-^\infty \exp(-\lambda t) \exp(-\frac{(t-\tau)^2}{2\sigma} ) d \tau = \exp(-\lambda t) \int_-^\infty \exp(-\frac{(t-\tau)^2}{2\sigma} ) d \tau$ which can be expressed in terms of the standard normal cdf $\Phi$, but I doubt this is actually the expression you want as it contains $t$ but not $\tau$ – Henry Feb 21 '14 at 16:50
• I suspect where you have $d\tau$ you want $dt$ and where you have $2\sigma$ you want $2\sigma^2$. The way forward is to complete the square. – Henry Feb 21 '14 at 16:59
• @Henry, you're right about the $\sigma^2$, but not about the $d\tau$ – John Echo Feb 21 '14 at 17:17
• Then perhaps where you have $g(\tau)$ you want $g(t)$ or perhaps where you have $\exp(-\lambda t)$ you want $\exp(-\lambda \tau)$ – Henry Feb 21 '14 at 17:23
• Apologies, you are correct. – John Echo Feb 21 '14 at 17:36

Note that the algebraic identity $$\lambda t+\frac{(t-\tau)^2}{2\sigma^2}=\tau\lambda-\frac12\sigma^2\lambda^2+\frac{(t-\tau+\sigma^2\lambda)^2}{2\sigma^2}$$ and the change of variable $s=t-\tau+\sigma^2\lambda$ yield $$\int_{-\infty}^{\infty}\exp\left(-\lambda t\right)\,\exp\left(-\frac{(t-\tau)^2}{2\sigma^2}\right)\mathrm dt=\exp\left(-\tau\lambda+\frac12\sigma^2\lambda^2\right)\cdot\int_{-\infty}^{\infty}\exp\left(-\frac{s^2}{2\sigma^2}\right)\mathrm ds,$$ that is, $$g(\tau)=\sqrt{2\pi\sigma^2}\cdot\exp\left(-\tau\lambda+\frac12\sigma^2\lambda^2\right).$$ This assumes that the function $g$ is defined as $$g(\tau) = \int_{-\infty}^\infty \exp(-\lambda t) \exp\left(-\frac{(t-\tau)^2}{2\sigma^2} \right)\mathrm d t,$$ since the current formula in the question makes no sense (subscript $-$ in the integral, presumably instead of $-\infty$, $\mathrm d\tau$ to integrate a function of $t$, presumably instead of $\mathrm dt$).

• As TimeVariant's post correctly notes, the integral should be from 0 to $\infty$, not $-\infty$ to $\infty$; thus, this answer is incorrect. Notice, in particular, that the given expression for $g(\tau)$ is not integrable over its domain $(-\infty, \, +\infty)$. – Stefan Wager Jul 1 '15 at 21:04
• @StefanWager Let me suggest that you ponder more carefully your use of the word "incorrect". Please read slowly how this answer is written, how it refers to the question, and please indicate which part is "incorrect", if you still think so. – Did Jul 3 '15 at 10:37
• I think the expression $g(\tau) = \int_{-\infty}^\infty \exp(-\lambda t) \exp\left(-\frac{(t-\tau)^2}{2\sigma^2} \right)\mathrm d t$ should be replaced with $g(\tau) = \int_{0}^\infty \exp(-\lambda t) \exp\left(-\frac{(t-\tau)^2}{2\sigma^2} \right)\mathrm d t$; i.e., the lower end of the integral should be at 0. – Stefan Wager Jul 7 '15 at 17:51
• Usually, exponential decay means that we have a positive random variable $X$ whose density is given by $f(x) = \lambda e^{-t \lambda}$ for $x \geq 0$. The question asks about data "measuring an exponential decay"; the way I interpret this, I think it's unlikely that any of these decay times should be taken as negative. (To be fair, though, the original question doesn't explicitly say that it seeks a convolution of probability distributions; the answer by @Did is correct as a formal convolution of two non-normalizable functions.) – Stefan Wager Jul 7 '15 at 17:58
• FWIW, my first comment aptly summarizes my take on the pair of subsequent comments by user Stefan W. – Did Oct 22 '16 at 14:40

The answers are all helpful so far, but the original question was on the right track: there is indeed an error function that results. The reason is that the original integral, which Henry correctly pointed out is over t, not $\tau$, is from 0 to $\infty$, and not from $-\infty$ to $\infty$. This changes everything.

In what follows, I took the liberty of using an exponential and a Gaussian both of which are individually normalized to 1 when integrated over their full range. For instance, the original exponential must be multiplied by a $\lambda$. Similarly, the Gaussian is to be divided by $\sigma\sqrt{2\pi}$.

When you work it out, you see that the correct answer is, in this notation, $${\lambda\over 2}e^{\sigma^2\lambda^2\over 2}e^{-\lambda\tau} \left(1 - \hbox{erf}\left(\overline \tau\over\sigma\sqrt{2}\right)\right)$$ where $\overline \tau\equiv -(\tau - \sigma^2/\lambda)$.

It is easy to see that this gives the right answer, for instance, by taking the limit in which $\sigma\to 0$. In this limit the "erf" function is either -1 or +1. [Wikipedia gives a good definition of erf() with a nice plot.] And then you recover the exponential, as you should.

• Shouldn't $\overline{tau}$ be $\overline{\tau} = -(\tau+\sigma^2 \lambda)$ – Jannick Mar 22 '17 at 9:05