6. The maximum value of the function $y=\cos x+\sin x+\cos x \sin x$ is $\qquad$ .
6. $\frac{1}{2}+\sqrt{2} y=\sqrt{2} \sin \left(x+\frac{\pi}{4}\right)+\frac{1}{2} \sin 2 x \leqslant \sqrt{2}+\frac{1}{2}$, when $x=\frac{\pi}{4}$, $y=\sqrt{2}+\frac{1}{2}$, so $y_{\text {max }}=\frac{1}{2}+\sqrt{2}$