# How to find the MGF of the difference of 2 random variables

Let $$X\sim N(12,4)$$ and $$Y \sim N(3,1)$$

Let $$Z = X - Y$$

Find the Moment Generating Function of $$Z$$.

I tried finding the expected value of $$e$$ to the power of $$tz$$, but this isn't possible to separate in the expected value function. I know how to use find the MGF when it is a sum of 2 random variables, but what is the technique when it is a difference like this?

• Use $-Y \sim N(-3,1)$ and add.
– whuber
Jan 20, 2020 at 20:52
• Why is the variance not also negative? Jan 20, 2020 at 21:26
• There's no such thing as a negative variance. Negating a variable doesn't change the amount it varies around its mean, so the variance remains the same.
– whuber
Jan 21, 2020 at 0:25
• @whuber Nowhere does the OP say that the random variables are jointly normal Feb 15, 2021 at 0:17
• @Dilip That is true and well worth remembering. But that point has been made here on CV ad nauseam, so it would suffice for a respondent to make the assumption explicit and move on.
– whuber
Feb 15, 2021 at 13:35

Continuing from @whuber's comment, $$-Y$$ has normal distribution with mean $$-3$$ and variance $$1$$. So $$Z = X - Y = X + (-Y)$$ has normal distribution with mean $$12-3=9$$ and variance $$4+1=5$$. The moment generating function of a normal distribution with mean $$\mu$$ and variance $$\sigma^2$$ is $$e^{\mu t + \sigma^2 t^2/2}$$, and so the moment generating function of $$Z$$ is $$e^{9t + \frac52 t^2}.$$