結果 : finding maximum and minimum of a function