Find all critical points of the function