Đặt \(2017=a\)
=>\(2018=a+1\)
Với mọi \(a\in N\) có:\(\sqrt{1+a^2+\frac{a^2}{\left(a+1\right)^2}}=\sqrt{\frac{\left(a+1\right)^2+a^2\left(a+1\right)^2+a^2}{\left(a+1\right)^2}}=\sqrt{\frac{a^2+2a+1+a^2\left(a^2+2a+1\right)+a^2}{\left(a+1\right)^2}}=\sqrt{\frac{2a^2+2a+1+a^4+2a^3+a^2}{\left(a+1\right)^2}}=\sqrt{\frac{\left(a^4+2a^2+1\right)+2a\left(a^2+1\right)+a^2}{\left(a+1\right)^2}}\)
=\(\sqrt{\frac{\left(a^2+1\right)^2+2a\left(a^2+1\right)+a^2}{\left(a+1\right)^2}}=\sqrt{\frac{\left(a^2+a+1\right)}{\left(a+1\right)^2}}=\left|\frac{a^2+a+1}{a+1}\right|\)(do \(a\ge0\))
=\(\frac{a\left(a+1\right)+1}{a+1}=a+\frac{1}{a+1}\)
=> \(\sqrt{1+a^2+\frac{a^2}{\left(a+1\right)^2}}=a+\frac{1}{a+1}\)
Thay a=2017 có:
\(\sqrt{1+2017^2+\left(\frac{2017}{2018}\right)^2}=2017+\frac{1}{2017+1}=2017+\frac{1}{2018}\)
=>\(\sqrt{1+22017^2+\left(\frac{2017}{2018}\right)^2}+\frac{2017}{2018}=2017+\frac{1}{2018}+\frac{2017}{2018}\)
<=> M=2017+1=2018
Vậy M=2018