[tex](x-y)^2 \\\\\\= (x-y)(x-y)\\\\= x * x + (x)(-y)+(-y)(x) +(-y)(-y)\\\\ = x^2 -xy-xy + y^2\\\\=x^2-2xy + y^2[/tex]
Hope that helps!