# Covariance of Sum of Random Variables [closed]

Let $$a_1,a_2,b,c_1,c_2,d$$ be constants and assume $$X_1, X_2, Y_1, Y_2$$ are Random Variables.

I am trying to prove $$Cov(a_1X_1+a_2X_2+b, c_1Y_1+c_2Y_2+d)= a_1c_1Cov(X_1,Y_1)+a_1c_2Cov(X_1,Y_2)+a_2c_1Cov(X_2,Y_1)+a_2c_2Cov(X_2,Y_2)$$

I am confused how you would go about proving this formally.

So far I have tried to expand $$Cov(X,Y)= E(XY)-E(X)E(Y)$$ given $$X=a_1X_1+a_2X_2+b$$ and $$Y=c_1Y_1+c_2Y_2+d$$ but I hit a dead end.

It'd be simplest to prove $$\operatorname{cov}(X,Y+Z)=\operatorname{cov}(X,Y)+\operatorname{cov}(X,Z)$$ first and go from there.
\begin{align}\operatorname{cov}(X,Y+Z)&=\mathbb{E}[X(Y+Z)]-\mathbb E[X]\mathbb E[Y+Z]\\&=\mathbb E[XY]+\mathbb E[XZ]-\mathbb E[X]\mathbb E[Y]-\mathbb E[X]\mathbb E[Z]\\&=(\mathbb E[XY]-\mathbb E[X]\mathbb E[Y])+(\mathbb E[XZ]-\mathbb E[X]\mathbb E[Z])\\&=\operatorname{cov}(X,Y)+\operatorname{cov}(X,Z)\end{align}
The proof can be followed by assigning temporary variables to the expressions inside the expression, i.e. $$X=a_1X_1+a_2X_2+b$$ and $$Y=c_1Y_1, Z=c_2Y_2+d$$, and apply this property repeatedly, together with the property $$\operatorname{cov}(X,Y)=\operatorname{cov}(Y,X)$$ when necessary.