Solving by Completion of squares method