Extremum seeking control using a partial sum of input-output product