I was studying polynomial rings over commutative rings from the book Topics in Algebra by I.N Herstein.
From there what I understood was, that:
If $R$ be a commutative ring with a unit element then $R[x]$ is defined to be the set of all symbols $a_nx^n+a_{n-1}x^{n-1}+\cdots+a_0$ where, $a_0,a_1,...,a_n\in R$ and $x$ is called an indeterminate.
However, I have a doubt regarding, what is meant by the word "indeterminate". It seems to me that in those set of symbols that are present in $R[x]$ of the form mentioned in the above lines, the symbol $x$ can be any element in the set $R.$ I think it's the same way we worked with polymials over the set of real numbers in early courses, i.e, a polynomial in $\Bbb R$ is defined as the set of all symbols or precisely set of mappings $f$ from $\Bbb R$ into itself such that $f(x)=a_nx^n+a_{n-1}x^{n-1}+\cdots+a_0$ where, $a_0,a_1,...,a_n\in \Bbb R$ and $x$ is just a "variable" that can take any value in the domain of $f$ which is $\Bbb R$ in this case.
(All is clear up until now, atleast to me. If I understood something wrong please do point it out.)
Now, the thing that creates the confusion is, the book goes on to define polynomials as follows:
We now define the ring of polynomials in the n-variables $x_1,\cdots,x_n$ over $R,$ $R[x_1,\cdots,x_n],$ as follows:
Let $R_1 = R[x_1], R_2 = R_1 [x_2 ],$ the polynomial ring in $x_2$ over $R_1,\cdots, R_n = R_{n-1}[x_n].$ $R_n$ is called the ring of polynomials in $x_1,\cdots,x_n$ over $R.$ Its elements are of the form $\sum a_{i_1i_2i_3\cdots i_n}x_1^{i_1}x_2^{i_2}\cdots x_n^{i_n}$ where equality and addition are defined coefficientwise and where multiplication is defined by use of the distributive law and the rule of exponents ...
So, what does $R_1[x_2]$ mean? I think what it refers is, the set of symbols of the form $$(a_{p_1}x_1^{p_1}+a_{p_1-1}x_1^{p_1-1}+\cdots+a_0)x_2^n+(a^{(1)}_{p_2}x_1^{p_2}+a^{(1)}_{p_2-1}x_1^{p_2-1}+\cdots+a_0^{(1)})x_2^{n-1}+...+(a^{(n)}_{p_{n+1}}x_1^{p_{n+2}}+a^{(n)}_{p_{n+1}-1}x_1^{p_{n+1}-1}+\cdots+a_0^{(n)}).$$ Now, can the variable $x_2$ take any of the symbols in $R_1$ as it's "value" ?
Continuing like this, we can definitely say that elements of $R_n$ are of the form $\sum a_{i_1i_2i_3\cdots i_n}x_1^{i_1}x_2^{i_2}\cdots x_n^{i_n},$ where $x_1\in R,x_2\in R_1,x_3\in R_2,...,x_n\in R_{n-1}.$
However, I need some clarifications regarding these two apparent issues stated above, i.e whether my understanding is correct or not. In case, my understanding is wrong, please do provide with an explanation for the correct interpretation while precisely stating the correct interpretation.
EDIT: A user named Stéphane Jaouen provided an answer. It seems to give a better definition for the polynomials over a commutative ring in general. But certainly, though it might be helpful but considering the definition of polynomials that I am working on, i.e Herstein's definition, this seems to be slightly drifting from the context. What I mean, is that I want the clarifications to the above questions with respect to the definition of the polynomials as the set of all symbols mentioned at the beginning of this post. I understand, that I should have been more precise, but sorry for the inconvenience caused.
To say "R[x] is defined to be the set of all symbols..." is not clear. What is a symbol?
More formally, a polynomial is a sequence $$(a_0,a_1, a_2,...)$$ where the $a_i \in R$ are almost all zero, which means that there exists an $n$ such that $$\forall m>n, a_m=0$$ The indeterminate $X$ is defined as $$\boxed{X:=(0,1,0,0,0,0,0,0,...)}$$
Then, very classically, you define an addition and multiplication on $R[X]$, which makes $(R[X],+,\times)$ is a ring.
With the definition of the multiplication chosen, it is easy to verify that $$X^2=(0,0,1,0,0,0,0,0,....)$$$$X^3=(0,0,0,1,0,0,0,0,....)$$$$...$$ and finally$$(a_0,a_1, a_2,...)=a_0+a_1X+a_2X^2+a_3X^3+...$$
Then $R_1:=R[X]$ being itself a ring, you can by the previous construction build $R_1[X_2]$... It's just a formal construction for the two-variable polynomials we're all used to. For example, $2XY+X^2=X^2+2X.Y=a_0+a_1Y$, with $a_0=X^2, a_1=2X$