\(t=g\left(x\right)=\sqrt{2x^2+3x+2}\)
\(g\left(0\right)=\sqrt{2};g\left(2\right)=4\Rightarrow\sqrt{2}\le t\le4\)
\(y=f\left(t\right)=2\left(2x^2+3x+2\right)+\sqrt{2x^2+3x+2}+2015=2t^2+t+2015\)
\(f\left(\sqrt{2}\right)=\sqrt{2}+2019;f\left(4\right)=2051\)
\(M=Max=2051\Leftrightarrow t=4\Leftrightarrow x=2\)
\(m=Min=\sqrt{2}+2019\Leftrightarrow t=\sqrt{2}\Leftrightarrow x=0\)
\(\Rightarrow M-m=\sqrt{2}+32\)