How do I get from $x^4+2x^3y+3x^2y^2+2xy^3+y^4$ to $(x^2+xy+y^2)^2$? I was doing an example $$(x+y)^4+x^4+y^4$$ and I need to factor it. I've tried and couldn't really do much, so I checked if there was anything to help, and I came across a post asking about the same thing. But my question is how do I know that $$x^4+2x^3y+3x^2y^2+2xy^3+y^4=(x^2+xy+y^2)^2$$ without knowing the answer.
I know about $$(a+b+c)^2$$ but then how would i chose my $a, b$ and $c$?
There are many $xy$ combinations here, with different powers, so would I chose the lowest as my $b$, and $x^2$ as my $a$ and $y^2$ as my $c$, or perhaps is there another formula that can help me.

Note,
$$\begin{array}
& & x^4+2x^3y+3x^2y^2+2xy^3+y^4 \\
& =( x^4+ 2x^2y^2+y^4 )+ 2x^3y+x^2y^2+2xy^3\\
&=( x^2+y^2)^2+ (2x^3y+2xy^3) + x^2y^2 \\
&=( x^2+y^2)^2+ 2xy(x^2+y^2) + (xy)^2 \\
&=(x^2+xy+y^2)^2
\end{array}$$
