I'm trying to understand this part of the proof:

I didn't understand why not all coefficients of $f_2,\ldots,f_n$ can lie in the maximal ideal, maybe I'm forgetting something, it should be a very easy thing, but I couldn't understand why, even though it's an doubt in elementary abstract algebra.
I need help.
Thanks in advance.
Suppose that $f_2,\dots,f_n\in\mathfrak m[x]$. From $\sum_{i=1}^ng_if_i=1$ we get $g_1f_1-1\in\mathfrak m[x]$. Let's write $f_1=x^n+a_{n-1}x^{n-1}+\cdots+a_0$ and $g_1=b_mx^m+b_{m-1}x^{m-1}+\cdots+b_0$. Then we get $$g_1f_1-1=b_mx^{n+m}+(b_{m-1}+b_ma_{n-1})x^{n+m-1}+\cdots+(b_0+b_1a_{n-1}+\cdots+b_ma_{n-m})x^n+\cdots+(b_0a_0-1).$$ (If $n<m$, then the last term in the coefficient of $x^n$ is $b_na_0$.)
This entails that all the coefficients of $g_1$ belong to $\mathfrak m$ and $b_0a_0-1\in\mathfrak m$, a contradiction.