Extended mean value theorem