get extremas by newton's method and derivatives