y^2 -5y
Take the coefficient of the y term
-5
Divide by 2
-5/2
Square it
(-5/2) ^2 = 25/4
Add this
y^2 - 5y + 25/4
Factored is
(y - 5/2) ^2
x^2 + 5/4x
Take the coefficient of x
5/2
Divided by 2
5/4
Square it
(5/4)^2 = 25/16
Add this
x^2 + 5/4x + 25/16
Factored is
(x+5/4)^2