Đặt \(sinx+cosx=\sqrt{2}sin\left(x+\dfrac{\pi}{4}\right)=t\Rightarrow t\in\left[-\sqrt{2};\sqrt{2}\right]\)
\(t^2=1+2sinx.cosx\Rightarrow sinx.cosx=\dfrac{t^2-1}{2}\)
\(\Rightarrow y=t+\dfrac{t^2-1}{2}=\dfrac{1}{2}t^2+t-\dfrac{1}{2}\)
Xét hàm \(y=f\left(t\right)=\dfrac{1}{2}t^2+t-\dfrac{1}{2}\) trên \(\left[-\sqrt{2};\sqrt{2}\right]\)
\(-\dfrac{b}{2a}=-1\in\left[-\sqrt{2};\sqrt{2}\right]\)
\(f\left(-\sqrt{2}\right)=\dfrac{1-2\sqrt{2}}{2}\) ; \(f\left(-1\right)=-1\) ; \(f\left(\sqrt{2}\right)=\dfrac{1+2\sqrt{2}}{2}\)
\(\Rightarrow y_{min}=-1\) ; \(y_{max}=\dfrac{1+2\sqrt{2}}{2}\)