How to complete the square