Completed square form of quadratic functions