<s>[INST] Algebraic identities Given that $$a+b+c=2$$ and $$ab+bc+ca=1$$
Then the value of 
$$(a+b)^2+(b+c)^2+(c+a)^2$$ is how much?

Attempt:
Tried expanding the expression. Thought the expanded version would contain a term from the expression of $a^3+b^3+c^3-3abc$, but its not the case. 
 [/INST] Consider the monic polynomial with roots $a$, $b$, $c$
$$P(x)=(x-a)(x-b)(x-c)$$
Expanding out:
$$P(x)=x^{3}+x^{2}(-a-b-c)+x(ab+bc+ac)-abc$$
(This is essentially Vieta's formula).
Then plugging in your values this polynomial equals:
$$P(x)=x^{3}-2x^{2}+x-abc$$
Further, since $a$, $b$, $c$ are roots
$$P(a)=a(a^{2}-2a+1-bc)=0$$
$$P(b)=b(b^{2}-2b+1-ac)=0$$
$$P(c)=c(c^{2}-2c+1-ab)=0$$
We assume $a,b,c$ are non-zero. Then division gives us:
$$P(a)=a^{2}-2a+1-bc=0$$
$$P(b)=b^{2}-2b+1-ac=0$$
$$P(c)=c^{2}-2c+1-ab=0$$
Adding up the above three, and using $a+b+c=2$ and $ab+bc+ac=1$
$$a^{2}+b^{2}+c^{2}=2(a+b+c)-3+(ab+bc+ca)$$
$$=2$$
Now we can tackle your problem. Just expand:
$$(a+b)^{2}+(b+c)^{2}+(a+c)^{2}$$
$$=2(a^2+b^2+c^2)+2(ab+bc+ca)=2\cdot 2+2=6$$
</s>