One of two identical-looking coins is picked from a hat randomly, where one coin has probability $p_1$ of Heads and the other has probability $p_2$ of Heads. Let $X$ be the number of Heads after flipping the chosen coin n times. Find the variance of $X$.
I not exactly sure how to represent this mathematically because there are variances from both coins. Can I just sum up the variances? That is,
$$Var(X) = \frac{1}{2} Var(X \mid C_1) + \frac{1}{2} Var(X \mid C_2)$$
Here $C_j$ is the event that coin $j$ is chosen where $j \in {1,2}$. And $X \mid C_j \sim Binom(n,p_j)$. This results in:
$$Var(X) = \frac{1}{2}(np_1(1-p_1)+np_2(1-p_2))$$
This is not the same as the solution, the solution is:
$$Var(X) = \frac{1}{2}(np_1(1-p_1)+np_2(1-p_2)) + \frac{1}{4}n^2(p_1-p_2)^2$$
Can anyone please explain why my method did not work? Seems like it's missing a $\frac{1}{4}n^2(p_1-p_2)^2$ term.