Checking to see if Utility is maximized in an economics problem