a) Ta có : \(A=\sqrt{x}-2x+2=-2\left(x-2\sqrt{x}.\frac{1}{4}+\frac{1}{16}\right)+\frac{1}{8}+2=-2\left(\sqrt{x}-\frac{1}{4}\right)^2+\frac{17}{8}\le\frac{17}{8}\)
Vậy Max A = \(\frac{17}{8}\Leftrightarrow\sqrt{x}=\frac{1}{4}\Leftrightarrow x=\frac{1}{16}\)
b) Ta phải có \(x\le2\)
Đặt \(y=\sqrt{2-x},y\ge0\Rightarrow x=2-y^2\)
\(\Rightarrow B=x+\sqrt{2-x}=2-y^2+y=-\left(y^2-2.y.\frac{1}{2}+\frac{1}{4}\right)+2+\frac{1}{4}=-\left(y-\frac{1}{2}\right)^2+\frac{9}{4}\le\frac{9}{4}\)
Do đó Max B = \(\frac{9}{4}\Leftrightarrow y=\frac{1}{2}\Leftrightarrow x=\frac{7}{4}\)