\(y=2cos^2x-1+cosx+1=2cos^2x+cosx\)
\(y=2\left(cosx+\frac{1}{4}\right)^2-\frac{1}{8}\ge-\frac{1}{8}\)
\(y_{min}=-\frac{1}{8}\) khi \(cosx=-\frac{1}{4}\)
\(y=2cos^2x+cosx-3+3=\left(cosx-1\right)\left(2cosx+3\right)+3\)
Do \(-1\le cosx\le1\Rightarrow\left\{{}\begin{matrix}cosx-1\le0\\2cosx+3>0\end{matrix}\right.\)
\(\Rightarrow\left(1-cosx\right)\left(2cosx+3\right)\le0\Rightarrow y\le3\)
\(y_{max}=3\) khi \(cosx=1\)
\(\Rightarrow-\frac{1}{8}\le y\le3\)