Có \(a^2-2ab+b^2=\left(a-b\right)^2\ge0\Rightarrow a^2+b^2\ge2ab\)
\(\Rightarrow2\left(a^2+b^2\right)>\left(a+b\right)^2\)
Mà \(a^2+b^2=a+b\Rightarrow2\left(a+b\right)\ge\left(a+b\right)^2\Rightarrow a+b\le2\)
Lại có : \(S=\frac{a}{a+1}+\frac{b}{b+1}=1-\frac{1}{a+1}+1-\frac{1}{b+1}=2-\left(\frac{1}{a+1}+\frac{1}{b+1}\right)\)
Áp dụng bất đẳng thức Svac - sơ ta có :
\(\frac{1}{a+1}+\frac{1}{b+1}\ge\frac{4}{a+1+b+1}=\frac{4}{a+b+2}\ge1\)
Vì vậy S = \(2-\left(\frac{a}{a+1}+\frac{b}{b+1}\right)\le2-1=1\)
=> Smax =1
Dấu = xảy ra khi a = b = 1