Elementary equivalence of polynomial rings In his notes on the model theory of valued fields, Lou van den Dries mentions in bypassing that the polynomial ring over the complex numbers $\mathbb{C}$ is not elementarily equivalent to the polynomial ring over the algebraic numbers $\mathbb{Q}^{\text{alg}}$. That is, there is a sentence in the first order language of rings that holds in one structure but not in the other. The above should be true despite the fact that $\mathbb{Q}^{\text{alg}}$ and $\mathbb{C}$ do have the same first order theory - namely that of algebraically closed fields of characteristic zero.
How can we see this? What are other examples of elementarily equivalent rings whose polynomial rings are no longer elementarily equivalent?
(Here is a link to the notes)
 A: This is a really interesting fact. It has nothing to do with the fields being algebraically closed: the idea is that if $K$ is a field of characteristic $0$, then the transcendence degree of $K$ over $\mathbb{Q}$ is "definable" in $K[x]$.
Step 1: $K$ is definable in $K[x]$.
It's the set of units, plus $0$.
Step 2: In the polynomial ring $K[x]$, we can definably evaluate polynomials on elements of $K$.
Given any $f\in K[x]$ and $a,b\in K$, $f(a) = b$ if and only if $(x-a)\mid (f - b)$, and the latter is a definable condition.
Step 3: Given a definable subfield $k\subseteq K$, the subring $k[x]\subseteq K[x]$ is definable. 
The idea here is that a polynomial $f(x)\in K[x]$ is in $k[x]$ if and only if for all $a\in k$, $f(a)\in k$.
Now the real clever work happens.
Step 4: If $K$ is a field of characteristic $0$, $\mathbb{N}$ is definable in $K[x]$. 
I claim that $n\in K$ is a natural number if and only if for all $f\in K[x]\setminus K$, there exists an element $g\in K[x]$ such that $f\mid g$, and for all $c\in K$, $(f+c)\mid g$ implies $(f+c+1)\mid g$ or $c = n$. Indeed, if $n\in\mathbb{N}$, we can just take $g = f(f+1)\dots(f+n)$. But if $n\not\in\mathbb{N}$, a $g$ satisfying the statement above would have infinitely many distinct polynomial factors ($f\mid g$, so $f+1\mid g$, so $f+2\mid g$, etc.), which is impossible.
This is already very interesting/surprising, since it shows that $K[x]$ has a very complicated theory, even if $K$ is algebraically closed! Now the fact that $\mathbb{Q}^{alg}[x] \not\equiv \mathbb{C}[x]$ should be less unintuitive...
Step 5: Hence $\mathbb{Q}$ is definable in $K[x]$.
Step 6: Given $f_1,\dots,f_n \in K$, the subfield $\mathbb{Q}(f_1,\dots,f_n)$ is definable (uniformly for fixed $n$ in the parameters $f_1,\dots,f_n$).
By induction on $n$, with Step 5 as the base case. The idea is that it suffices to define $R = \mathbb{Q}(f_1,\dots,f_n)[f_{n+1}]$, since the desired field is the field of quotients of R. To define "$g\in R$", we express "there exists $h\in \mathbb{Q}(f_1,\dots,f_n)[x]$ such that $h(f_{n+1}) = g$", which we can do by Steps 2 and 3.
Step 7: There is a sentence $\phi_n$ such that $K[x]\models \phi_n$ if and only if $\text{tr.deg}_\mathbb{Q}(K)\leq n$.
We need to express "there exist $n$ elements $t_1,\dots,t_n\in K$ such that for all $a\in K$, $a$ is algebraic over $\mathbb{Q}(t_1,\dots,t_n)$", and the last bit is equivalent to "there exists $f(x)\in \mathbb{Q}(t_1,\dots,t_n)[x]$ such that $f(a) = 0$", which we can express by Steps 2, 3, and 6.
Now the sentences $\phi_n$ can be used to distinguish polynomial rings whose base fields have different transcendence degrees. In fact, for algebraically closed fields, this is the only obstruction.
Theorem: If $K$ and $L$ are algebraically closed fields of characteristic $0$, then $K[x]\equiv L[x]$ if and only if $\text{tr.deg}_\mathbb{Q}(K) = \text{tr.deg}_\mathbb{Q}(L) = n < \infty$ or both $K$ and $L$ have infinite transcendence degree.
Proof: If $K$ and $L$ have the same finite transcendence degree or both have infinite transcendence degree, use a back and forth argument to show elementary equivalence. If not, distinguish them using the $\phi_n$.
You can read more details (and find lots of facts along similar lines) in "Model Theoretic Algebra" by Jensen and Lenzing, pp. 36-38. (Google books doesn't let me see pp. 36-37, but I was able to access them using Amazon's "search inside this book" feature for "elementary equivalence of polynomial rings" and scrolling back a few pages.)

Edit: I've just noticed that I've been a bit sloppy here. Step 2 (and hence Step 3) assumes we have a name for $x$, and we'd prefer to show that $\mathbb{Q}^{alg}[x]\not\equiv\mathbb{C}[x]$ in the pure ring language, without $x$ named.
To fix this, notice that we didn't use Steps 2 and 3 in their full form in Steps 6 and 7, we just used assertions of the form "there exists a polynomial in $k(x)$ such that $k(a) = b$", where $k$ is a definable subfield.
This assertion can be expressed without a name for $x$ by universally quantifying out the $x$: $\forall (g\in K[x]\setminus K)\,\exists (f\in K[x])\,\forall (c\in k)\,\exists (d\in k)\, (g-c\mid f-d)\land (g-a\mid f-b)$. 
The idea is that whatever $g(x)$ is, $f(x)$ will be $\hat{f}(g(x))$, where $\hat{f}$ is the actual polynomial with $\hat{f}(a) = b$. The first conjunct expresses that $\hat{f}\in k(x)$ and the second expresses that $\hat{f}(a) = b$.
