2. Find the maximum and minimum values of $y=\sin ^{2} x+2 \sin x \cdot \cos x+3 \cos ^{2} x$.
2. The original function can be rewritten as $y=2+\sin 2 x+\cos 2 x$, so we only need to find the maximum and minimum values of $y^{\prime}=\sin 2 x+\cos 2 x$.

Construct vectors $\vec{a}=(\sin 2 x, \cos 2 x), \vec{b}=(1,1)$, then $|\sin 2 x+\cos 2 x|=|\vec{a} \cdot \vec{b}| \leqslant|\vec{a}| \cdot|\vec{b}|=\sqrt{2}$, hence $y_{\text {max }}=$ $2+\sqrt{2}, y_{\min }=2-\sqrt{2}$.