rms and average value problems