# Confusion about convolution. Are the integrals equivalent?

The formula for a convolution is given by

$$f*g(t,x)=\int_{\mathbb{R}}f(t-u)g(u) \ du. \tag1$$

My question is, is the following equally correct?

$$f*g(t,x)=\int_{\mathbb{R}}f(u)g(t-u) du.\tag2$$

I'm asking because in my case I got

$$f(t,x)=\frac{1}{x^2+1} \quad \text{and} \quad g(t,x)=\frac{e^{-x^2/4t}}{\sqrt{4\pi t}}.\tag3$$

So I get two very different integrals.

• try doing a change of variables in the integration, $v=t-u$ – yohBS Mar 20 '19 at 17:14
• I suggest using different letters for the variables of integration in the two integrals: $$\int_{\mathbb R} f( t - u) \; g(u) \; du,$$ $$\int_{\mathbb R} f( w ) \; g(t - w) \; dw.$$ Do we obtain the second integral from the first by the variable change $u = t - w$ or any other variable change? I doubt it. That would explain the difference between the two integrals you are getting. – avs Mar 20 '19 at 17:17
• @avs - Are you concluding that $g*f \neq f*g ?$ – Parseval Mar 20 '19 at 17:23
• No. Convolution is commutative. – avs Mar 20 '19 at 17:47
• @DavidC.Ullrich, I was wondering about the role of $x$, and I think it's part of the OP's overall source of confusion: which symbols denote which variables. – avs Mar 20 '19 at 18:41

Yes, since we get: $$(f*g)(t) = \int_{-\infty}^\infty \ f(t-u)g(u) \ du = -\int_{\infty}^{-\infty} \ f(v)g(v-t) \ dv = (g*f)(t)$$ So the convolution product is commutative.
• So in my case, if I were to use $(1)$ I get $$\int_{\mathbb{R}}\frac{1}{1+(x-u)^2}\frac{e^{-(u)^2/4t}}{\sqrt{4\pi t}} \ du.$$ But If I choose (2) I get instead $$\int_{\mathbb{R}}\frac{1}{1+u}\frac{e^{-(x-u)/4t}}{\sqrt{4 \pi t}} \ du.$$ Are both correct? – Parseval Mar 20 '19 at 17:31
• Yes, they will both be correct because of the above, and furthermore you can switch between them by using a change of variables, the first integral is the second with $v=x-u$, although in your second integral you missed a square on the $u$ and a square on $(x-u)$ in the exponential. – Kyle C Mar 20 '19 at 17:52