\(y=\frac{3x^2+2x+1}{x^2-2x+3}\Leftrightarrow y.x^2-2yx+3y=3x^2+2x+1\)
\(\Leftrightarrow\left(y-3\right)x^2-2\left(y+1\right)x+3y-1=0\)
\(\Delta'=\left(y+1\right)^2-\left(y-3\right)\left(3y-1\right)\ge0\)
\(\Leftrightarrow y^2-6y+1\le0\)
\(\Rightarrow3-2\sqrt{2}\le y\le3+2\sqrt{2}\)
\(\Rightarrow a^2+b^2+ab=35\)