Variance A + variance B and portfolio variance

From Variance (A+B) = variance A + variance B + 2 covariance(x,y)

and the portfolio variance consisting of stock A and B equally weighted.

= weight2( variance A) + weight2(variance B) + 2 (weight A)(weight B)( covariance)

i try using the same number for both of the equation but doesn’t yield the same result. Are those two formula the same?

thank you

In the first formula I presume that you mean:

Variance (A+B) = variance A + variance B + 2covariance( A , B )

In the second formula I presume that you mean:

Variance (A+B) = (weight A )2(variance A) + (weight B )2(variance B) + 2(weight A)(weight B)[covariance( A , B )]

The first formula is wrong, as it assumes that A has 100% weight and B has 100% weight.