Có \(\left(a-b\right)^2\ge0\Leftrightarrow a^2-2ab+b^2\ge0\)
\(\Rightarrow2a^2+2b^2\ge a^2+2ab+b^2\Leftrightarrow2a^2+2b^2\ge\left(a+b\right)^2\)
\(\Leftrightarrow2\left(a^2+b^2\right)\ge\left(a+b\right)^2\Leftrightarrow a^2+b^2\ge\frac{\left(a+b\right)^2}{2}\)
\(\Rightarrow a+b\ge\frac{\left(a+b\right)^2}{2}\Rightarrow2\ge a+b\)
\(S=\frac{a}{a+1}+\frac{b}{b+1}=\frac{a+1}{a+1}+\frac{b+1}{b+1}-\left(\frac{1}{a+1}+\frac{1}{b+1}\right)=2-\left(\frac{1}{a+1}+\frac{1}{b+1}\right)\)
AD BĐT: \(\frac{1}{x}+\frac{1}{y}\ge\frac{4}{x+y}\left(x,y\in Z^+\right)\)
\(\Rightarrow\frac{1}{a+1}+\frac{1}{b+1}\ge\frac{4}{a+b+2}\ge\frac{4}{4}=1\) ( vì \(2\ge a+b\) )
\(\Rightarrow S=2-\left(\frac{1}{a+1}+\frac{1}{b+1}\right)\le1\)
Dấu "=" xảy ra \(\Leftrightarrow a=b=1\)
Vậy \(S_{max}=1\Leftrightarrow a=b=1\)