x + 2*cosx from 0 to pi