∴y=cosθ+sinθ=sin(θ+).而≤θ+≤,
故当θ+=,即θ=时,sin(θ+)取得最大值1.
∴ymax=,此时x=cos=;
又当θ+=,即θ=π时,sin(θ+)取得最小值-,
∴ymin=-1,此时x=cosπ=-1.