$a^{2}+b^{2}\leq a+b<=>(a-\frac{1}{2})^{2}+(b-\frac{1}{2})^{2}\leq \frac{1}{2}$
$vậy P=a+2b=(a-\frac{1}{2})+2(b-\frac{1}{2})+\frac{3}{2}$
$((a-\frac{1}{2})+2(b-\frac{1}{2}))^{2}\leq (1+2^{2})(a-\frac{1}{2})^{2}+(b-\frac{1}{2})^{2}\leq \frac{5}{2}$
$=>P\leq \frac{3+\sqrt{10} }{2}$
$dấu = xảy ra <=> (a,b)=(\frac{5+\sqrt{10} }{10};\frac{5+2\sqrt{10} }{10})$