# Proving Product of two Gaussian is a Scaled Gaussian

Problem: It is required to show that the product of two univariate Gaussian distributions $$N(x | \mu_1, \sigma_1^2)$$ and $$N(x | \mu_2, \sigma_2^2)$$ is a scaled Gaussian $$N(x | \mu_3, \sigma_3^2)$$ by $$Z$$:

$$N(x | \mu_1, \sigma_1^2) N(x | \mu_2, \sigma_2^2) = Z N(x | \mu_3, \sigma_3^2)$$

where $$\mu_3 = \sigma_3^2 (\sigma_1^{-2} \mu_1 + \sigma_2^{-2} \mu_2)$$

$$\sigma_3^2 = \frac{1}{\sigma_1^{-2} + \sigma_2^{-2}}$$

$$Z = \frac{1}{\sqrt{2 \pi (\sigma_1^2 + \sigma_2^2)}} e^{-\frac{1}{2 (\sigma_1^2 + \sigma_2^2)} (\mu_1 - \mu_2)^2 } = N(\mu_1 | \mu_2, \sigma_1^2 + \sigma_2^2)$$ and

$$N(x | \mu, \sigma^2) = \frac{1}{ \sqrt{2 \pi \sigma^2} } e^{ - \frac{1}{2 \sigma^2} (x - \mu)^2}$$.

i.e.

$$(\frac{1}{\sqrt{2\pi \sigma_1^2}} e^{- \frac{1}{2 \sigma_1^2} (x - \mu_1)^2})(\frac{1}{\sqrt{2\pi \sigma_2^2}} e^{- \frac{1}{2 \sigma_2^2} (x - \mu_2)^2}) = ({\frac{1}{\sqrt{2\pi (\sigma_1^2 + \sigma_2^2)}} e^{- \frac{1}{2 (\sigma_1^2 + \sigma_2^2)} (\mu_1 - \mu_2)^2}}) (\frac{1}{\sqrt{2\pi \sigma_3^2}} e^{- \frac{1}{2 \sigma_3^2} (x - \mu_3)^2})$$

I tried to expand the equation separately by its LHS and RHS with its probability density function for 3 or 4 hours to check if there's any steps mistaken but have really no clues.

Are there any tricks/clues to prove it, or in fact the "equation" above is itself not in equality?

Thank you very much!

EDIT: With @lisyarus 's hint for completing the square on the exponent, I got:

\begin{align} \text{LHS exponent} &= -\frac{1}{2} (\frac{1}{\sigma_1^2} (x - \mu_1)^2 + \frac{1}{\sigma_2^2} (x - \mu_2)^2) \\ &= -\frac{1}{2} [(\frac{x - \mu_1} {\sigma_1})^2 + (\frac{x - \mu_2}{\sigma_2})^2] \\ &= -\frac{1}{2} [(\frac{x - \mu_1}{\sigma_1})^2 + 2\frac{x - \mu_1}{\sigma_1}\frac{x - \mu_2}{\sigma_2} + (\frac{x - \mu_2}{\sigma_2})^2] - 2\frac{x - \mu_1}{\sigma_1}\frac{x - \mu_2}{\sigma_2} ] \\ &= -\frac{1}{2} [(\frac{x - \mu_1}{\sigma_1} + \frac{x - \mu_2}{\sigma_2})^2 - 2\frac{x - \mu_1}{\sigma_1}\frac{x - \mu_2}{\sigma_2}] \end{align}.

• Hint: write down the product of probability densities, and complete the square in the exponent. Sep 13, 2019 at 11:48
• @lisyarus I got LHS exponent$= -\frac{1}{2} (\frac{1}{\sigma_1^2} (x - \mu_1)^2 + \frac{1}{\sigma_2^2} (x - \mu_2)^2) = -\frac{1}{2} [(\frac{x - \mu_1}{\sigma_1})^2 + (\frac{x - \mu_2}{\sigma_2})^2] = -\frac{1}{2} [(\frac{x - \mu_1}{\sigma_1})^2 + 2\frac{x - \mu_1}{\sigma_1}\frac{x - \mu_2}{\sigma_2} + (\frac{x - \mu_2}{\sigma_2})^2] - 2\frac{x - \mu_1}{\sigma_1}\frac{x - \mu_2}{\sigma_2} ] = -\frac{1}{2} [(\frac{x - \mu_1}{\sigma_1} + \frac{x - \mu_2}{\sigma_2})^2 - 2\frac{x - \mu_1}{\sigma_1}\frac{x - \mu_2}{\sigma_2}]$. Should I try to cancel out the x for finding $(\mu_1 - \mu_2)^2$? Sep 13, 2019 at 12:51
• Now I realized there's more than one way to interpret "completing the square" here. I'll just write an answer, I guess. Sep 13, 2019 at 13:39

I'll write only the exponent of the product of PDF's, omitting the $$-\frac{1}{2}$$ factor.

$$\left(\frac{x-\mu_1}{\sigma_1}\right)^2+\left(\frac{x-\mu_2}{\sigma_2}\right)^2 = \\ = x^2 \left(\frac{1}{\sigma_1^2}+\frac{1}{\sigma_2^2}\right) - 2x\left(\frac{\mu_1}{\sigma_1^2}+\frac{\mu_2}{\sigma_2^2}\right)+\left(\frac{\mu_1^2}{\sigma_1^2}+\frac{\mu_2^2}{\sigma_2^2}\right) = (1)$$

Denote

$$\Sigma = \left(\frac{1}{\sigma_1^2}+\frac{1}{\sigma_2^2}\right)^{-\frac{1}{2}} = \sigma_3$$

Now,

$$(1) = \frac{1}{\sigma_3^2}\left[x^2-2x\left(\frac{\mu_1}{\sigma_1^2}+\frac{\mu_2}{\sigma_2^2}\right)\Sigma^2 \color{blue}{+\left(\frac{\mu_1}{\sigma_1^2}+\frac{\mu_2}{\sigma_2^2}\right)^2\Sigma^4}\color{red}{-\left(\frac{\mu_1}{\sigma_1^2}+\frac{\mu_2}{\sigma_2^2}\right)^2\Sigma^4}\right]+\left(\frac{\mu_1^2}{\sigma_1^2}+\frac{\mu_2^2}{\sigma_2^2}\right) = \\ = \color{green}{\frac{1}{\Sigma^2}(x-M)^2+C}$$

Where

$$M = \left(\frac{\mu_1}{\sigma_1^2}+\frac{\mu_2}{\sigma_2^2}\right)\Sigma^2 = \mu_3$$

and

$$C = -\left(\frac{\mu_1}{\sigma_1^2}+\frac{\mu_2}{\sigma_2^2}\right)^2\Sigma^2 + \left(\frac{\mu_1^2}{\sigma_1^2}+\frac{\mu_2^2}{\sigma_2^2}\right)$$

• Thank you very much! I continued to work on it, and finally arrived the RHS. Sep 13, 2019 at 18:40