Note that the polynomial $ x^2+2xy+y^2 $ is a perfect square trinomial, so we will use the following formula.
$$ A^2 + 2AB + B^2 = (A + B)^2 $$In this example we have $ \color{blue}{ A = x } $ and $ \color{red}{ B = y } $ so,
$$ x^2+2xy+y^2 = ( \color{blue}{ x } + \color{red}{ y } )^2 $$