In my class notes my teacher defined a polynomial with coefficients in a ring $R$ as:
If $R$ is a ring a polynomial with coefficients in a ring $R$ is a formal expression: $$a_o + a_1 x + ... + a_n x^n$$ with $n \in \mathbb N_0$ and $a_i \in R$
I also checked the definition given in some Abstract algebra books and all of them defined it as a formal expression. Why is that so? Isn't just enough to say that a polynomial if a function:$$f:R\to R$$ $$x \mapsto a_0 + a_1x+...+a_nx^n$$
Why define a polynomial as a formal expression?