結果 : finding maximum and minimum value of a function