Tutorials › Measure Theory › Convolution of Gaussian Functions

Applications of Fubini: Change of Variables and Convolution · Tutorial 442 of 798

Convolution of Gaussian Functions

Learn how the convolution of two Gaussian functions is computed exactly, and how its scale and total integral follow from the completing-the-square formula.

Advanced 10 min read

What You'll Learn

  • Define the convolution convention used for functions on the real line.
  • Complete the square in the exponent of two Gaussian functions.
  • Derive the exact convolution formula for positive parameters.
  • Check the formula in equal-parameter and unequal-parameter examples.
  • Determine the total integral of the convolution using Tonelli's theorem.
  • Compute the convolution of normalized Gaussian densities.

Why Gaussian Convolution Has an Exact Formula

Convolution combines two functions by averaging products of translated values. For Gaussian functions, the resulting integral can be evaluated exactly: the output is again a Gaussian, but its exponent parameter is determined by both inputs. The key is to complete the square in the variable being integrated, while keeping separate the factor that depends only on the output point.

Throughout, integrals on \(\mathbb{R}\) are with respect to Lebesgue measure \(m\). The measure space is \((\mathbb{R},\mathcal{L},m)\), and all functions in the main calculation are real-valued, measurable, nonnegative, and integrable. For \(a>0\), let \(G_a(x)=e^{-ax^2}\). The one-dimensional Gaussian integral gives \(\int_{\mathbb{R}}G_a\,dm=\sqrt{\pi/a}<\infty\), so \(G_a\in L^1(m)\). We use the convention

$$ (f*g)(x)=\int_{\mathbb{R}}f(y)g(x-y)\,dy. $$

For general \(L^1(m)\) functions, convolution is defined almost everywhere as an integrable function; the standard \(L^1\) convolution result guarantees this. In the Gaussian calculation below, the integral is finite for every \(x\in\mathbb{R}\), and the formula identifies the convolution everywhere, not merely almost everywhere.

Completing the Square

Theorem: Let \(a,b>0\), and define \(G_a(x)=e^{-ax^2}\) and \(G_b(x)=e^{-bx^2}\) on \(\mathbb{R}\). For every \(x\in\mathbb{R}\), their convolution with respect to Lebesgue measure is $$ (G_a*G_b)(x)=\sqrt{\frac{\pi}{a+b}}\exp\!\left(-\frac{ab}{a+b}x^2\right). $$

Proof. Fix \(x\in\mathbb{R}\). By the definition of convolution, its value is the integral of \(e^{-ay^2-b(x-y)^2}\) over \(y\in\mathbb{R}\). Since \(a,b>0\), the coefficient \(a+b\) is positive. Expanding and completing the square gives

$$ \begin{aligned} ay^2+b(x-y)^2 &=ay^2+bx^2-2bxy+by^2\\ &=(a+b)y^2-2bxy+bx^2\\ &=(a+b)\left(y-\frac{b}{a+b}x\right)^2 +\left(b-\frac{b^2}{a+b}\right)x^2\\ &=(a+b)\left(y-\frac{b}{a+b}x\right)^2 +\frac{ab}{a+b}x^2. \end{aligned} $$

The last equality follows because \(b-b^2/(a+b)=ab/(a+b)\). The second term is independent of \(y\), so it factors out of the integral. With the translation \(u=y-bx/(a+b)\), Lebesgue measure is translation invariant, and the remaining integral is the one-dimensional Gaussian integral with parameter \(a+b>0\):

$$ \begin{aligned} (G_a*G_b)(x) &=e^{-\frac{ab}{a+b}x^2} \int_{\mathbb{R}}e^{-(a+b)(y-\frac{b}{a+b}x)^2}\,dy\\ &=e^{-\frac{ab}{a+b}x^2} \int_{\mathbb{R}}e^{-(a+b)u^2}\,du\\ &=\sqrt{\frac{\pi}{a+b}}e^{-\frac{ab}{a+b}x^2}. \end{aligned} $$

The Gaussian integral is finite, so the defining convolution integral is finite for this fixed \(x\). Since \(x\) was arbitrary, the identity holds for every \(x\in\mathbb{R}\). \(\square\)

The coefficient \(ab/(a+b)\) is the output exponent parameter; it is not \(a+b\). The factor \(\sqrt{\pi/(a+b)}\) is the output amplitude. Both arise from the same square completion: the completed square controls the integral in \(y\), while the remaining \(x\)-term controls the output's dependence on \(x\).

Worked Example: Convolving Two Identical Gaussians

Take \(a=b=1\), so \(G_1(x)=e^{-x^2}\). Substituting these parameters into the theorem gives \(a+b=1+1=2\) and \(ab/(a+b)=(1\cdot1)/2=1/2\). Therefore

$$ (G_1*G_1)(x)=\sqrt{\frac{\pi}{2}}e^{-x^2/2}. $$

At \(x=0\), the original convolution integral is \(\int_{\mathbb{R}}e^{-y^2}e^{-(-y)^2}\,dy=\int_{\mathbb{R}}e^{-2y^2}\,dy\). The Gaussian integral evaluates it as \(\sqrt{\pi/2}\), which equals the displayed formula at \(x=0\).

Check by total integrals: each input has integral \(\sqrt{\pi/1}=\sqrt{\pi}\), so their product is \(\pi\). The output's integral is \(\sqrt{\pi/2}\int_{\mathbb{R}}e^{-x^2/2}\,dx=\sqrt{\pi/2}\sqrt{2\pi}=\pi\), in agreement.

The Total Integral of the Convolution

The formula also has the expected total integral. The relevant general fact uses nonnegativity to justify the order of integration.

Proposition: If \(f,g:\mathbb{R}\to[0,\infty]\) are measurable and integrable with respect to \(m\), then \(f*g\) is defined as a nonnegative measurable function up to equality almost everywhere, and $$ \int_{\mathbb{R}}(f*g)(x)\,dx =\left(\int_{\mathbb{R}}f(y)\,dy\right) \left(\int_{\mathbb{R}}g(z)\,dz\right). $$

Proof. The function \((x,y)\mapsto f(y)g(x-y)\) is nonnegative and measurable on \(\mathbb{R}^2\). Tonelli's theorem applies to this nonnegative function, without requiring its integral to be known finite in advance. It gives

$$ \begin{aligned} \int_{\mathbb{R}}(f*g)(x)\,dx &=\int_{\mathbb{R}}\int_{\mathbb{R}}f(y)g(x-y)\,dy\,dx\\ &=\int_{\mathbb{R}}f(y)\left(\int_{\mathbb{R}}g(x-y)\,dx\right)\,dy. \end{aligned} $$

For each fixed \(y\), the substitution \(z=x-y\) is a translation, so \(\int_{\mathbb{R}}g(x-y)\,dx=\int_{\mathbb{R}}g(z)\,dz\). This value is finite because \(g\) is integrable. Substituting it into the preceding expression gives the stated product, which is finite because \(f\) is also integrable. Thus the convolution is integrable, with the claimed integral. \(\square\)

For the Gaussian inputs, the proposition says that the output integral is \(\sqrt{\pi/a}\sqrt{\pi/b}=\pi/\sqrt{ab}\). This provides a useful independent check on the explicit formula.

Worked Example: Unequal Parameters at a Nonzero Point

Let \(a=1\) and \(b=3\), and evaluate the convolution at \(x=1\). The square identity in this case is

$$ y^2+3(1-y)^2 =4\left(y-\frac34\right)^2+\frac34. $$

Indeed, expanding the right side gives \(4y^2-6y+9/4+3/4=4y^2-6y+3\), and expanding the left side gives \(y^2+3-6y+3y^2=4y^2-6y+3\). Hence

$$ \begin{aligned} (G_1*G_3)(1) &=\int_{\mathbb{R}}e^{-y^2-3(1-y)^2}\,dy\\ &=e^{-3/4}\int_{\mathbb{R}}e^{-4(y-3/4)^2}\,dy\\ &=e^{-3/4}\sqrt{\frac{\pi}{4}} =\frac{\sqrt{\pi}}{2}e^{-3/4}. \end{aligned} $$

The general formula gives \(\sqrt{\pi/(1+3)}\,e^{-(1\cdot3)/(1+3)}=(\sqrt{\pi}/2)e^{-3/4}\), the same value. For an integral check, the input integrals are \(\sqrt{\pi}\) and \(\sqrt{\pi/3}\), whose product is \(\pi/\sqrt{3}\). The formula gives \((\sqrt{\pi}/2)\int_{\mathbb{R}}e^{-3x^2/4}\,dx=(\sqrt{\pi}/2)\sqrt{4\pi/3}=\pi/\sqrt{3}\).

Normalized Gaussian Densities

The functions \(G_a\) have different total integrals as \(a\) varies. Their normalized versions are \(p_a(x)=\sqrt{a/\pi}\,e^{-ax^2}\), which have integral one for every \(a>0\). Applying the convolution formula and multiplying by the two normalization constants yields

$$ \begin{aligned} (p_a*p_b)(x) &=\sqrt{\frac{a}{\pi}}\sqrt{\frac{b}{\pi}} \sqrt{\frac{\pi}{a+b}} e^{-\frac{ab}{a+b}x^2}\\ &=\sqrt{\frac{c}{\pi}}e^{-cx^2}, \qquad c=\frac{ab}{a+b}. \end{aligned} $$

The last equality holds because \(c/\pi=ab/(\pi(a+b))\). Thus the convolution is itself a normalized Gaussian: its exponent parameter is \(c=ab/(a+b)>0\). This conclusion concerns the exact density formula; no probabilistic interpretation is needed.

Worked Example: Convolving Two Normalized Gaussians

Set \(a=1/2\) and \(b=1/3\). Their combined parameter is \(c=ab/(a+b)=((1/2)(1/3))/(1/2+1/3)=(1/6)/(5/6)=1/5\). Consequently,

$$ (p_{1/2}*p_{1/3})(x) =\sqrt{\frac{1/5}{\pi}}e^{-x^2/5} =\frac{1}{\sqrt{5\pi}}e^{-x^2/5}. $$

For a direct coefficient check, the normalization factors of the inputs multiply to \(1/(\sqrt{6}\pi)\). The unnormalized convolution factor is \(\sqrt{\pi/(5/6)}=\sqrt{6\pi/5}\). Their product is \((1/(\sqrt{6}\pi))\sqrt{6\pi/5}=1/\sqrt{5\pi}\), as in the formula.

Check by integration: \(\int_{\mathbb{R}}e^{-x^2/5}\,dx=\sqrt{5\pi}\), so the displayed output has integral \((1/\sqrt{5\pi})\sqrt{5\pi}=1\). This also agrees with the proposition, since each normalized input has integral one.

A Common Error and the Role of the Assumptions

A frequent error is to keep the coefficient \(a+b\) from the completed square as the coefficient of \(x^2\) in the final answer. For \(a=1\), \(b=3\), this incorrect calculation would give \(\sqrt{\pi/4}\,e^{-4x^2}\). At \(x=1\), it predicts \((\sqrt{\pi}/2)e^{-4}\). But direct square completion gives \((\sqrt{\pi}/2)e^{-3/4}\), since the \(x\)-dependent remainder is \(abx^2/(a+b)=3/4\). The coefficient \(a+b\) multiplies the square in the integration variable; the coefficient of \(x^2\) is \(ab/(a+b)\). Confusing those two terms changes the output substantially.

The strict conditions \(a>0\) and \(b>0\) ensure both inputs are in \(L^1(m)\), and ensure the completed-square integral has a positive quadratic coefficient. If \(a=0\), then \(G_a\) is the constant function \(1\), which is not integrable on \(\mathbb{R}\); the \(L^1\) convolution theorem and the present statement do not apply, even though some pointwise integrals against another Gaussian can still be finite. If either parameter is negative, the corresponding exponential grows in at least one tail and is not integrable. The positive-parameter theorem should therefore not be applied outside its stated assumptions.

The result is useful whenever Gaussian kernels are combined by convolution: it supplies the exact shape and amplitude without approximation. The square-completion proof also makes the bookkeeping transparent. The output parameter comes from the leftover \(x\)-term, the amplitude comes from integrating the translated Gaussian, and Tonelli's theorem independently checks the total mass for these nonnegative functions.

Check Your Understanding

Use the theorem and its hypotheses to work through these questions.

  1. For \(a=2\) and \(b=6\), write the exact formula for \(G_a*G_b\), including both the amplitude and exponent parameter.
  2. Complete the square in \(2y^2+5(x-y)^2\), showing the term that depends only on \(x\).
  3. For positive \(a,b\), use the formula to verify that \(\int_{\mathbb{R}}(G_a*G_b)\,dm=\pi/\sqrt{ab}\).
  4. Why does the proof use \(a+b>0\) when evaluating the integral in the translated variable?
  5. If \(p_a(x)=\sqrt{a/\pi}e^{-ax^2}\), state the parameter of \(p_a*p_b\) and verify that its integral is one.