Step 1: Begin with the variance definition.
\( \text{Var}(Z) = E[(Z - E[Z])^2] \). Let \( Z = X-Y \).
Step 2: Apply the definition to \( \text{Var}(X-Y) \).
\( E[X-Y] = E[X] - E[Y] \). Define \( \mu_X = E[X] \) and \( \mu_Y = E[Y] \).\[ \text{Var}(X-Y) = E[((X-Y) - (\mu_X - \mu_Y))^2] \]\[ = E[((X-\mu_X) - (Y-\mu_Y))^2] \]
Step 3: Expand the squared term.\[ = E[(X-\mu_X)^2 - 2(X-\mu_X)(Y-\mu_Y) + (Y-\mu_Y)^2] \]
Step 4: Use the linearity of expectation.\[ = E[(X-\mu_X)^2] - 2E[(X-\mu_X)(Y-\mu_Y)] + E[(Y-\mu_Y)^2] \]
Step 5: Identify variance and covariance.\[ E[(X-\mu_X)^2] = \text{Var}(X) \]\[ E[(Y-\mu_Y)^2] = \text{Var}(Y) \]\[ E[(X-\mu_X)(Y-\mu_Y)] = \text{Cov}(X,Y) \]Substituting these yields the final formula:\[ \text{Var}(X-Y) = \text{Var}(X) + \text{Var}(Y) - 2\text{Cov}(X,Y) \]