How do we find the number to make the perfect square?

For any two non null real numbers a and b, a perfect square can be represented by:
[tex](a+b)^2=a^2+2ab+b^2[/tex]Then, if a = y, we must find a number b such as:
[tex]2yb=4y[/tex]Then, b = 2, and b² = 4
Therefore:
[tex]y^2+4y+2^2[/tex]