(x+y+1)²
=(x+y)²+2(x+y)+1
=x²+y²+2xy+2x+2y+1
(a-b-c)²
=(a-b)²-2c(a-b)+c²
=a²+b²-2ab-2ac+2bc+c²
=a²+b²+c²-2ab-2ac+2bc