Any element of K(X) which is not in K is transcendental over K I was solving this exercise from Hungerford but apparently I couldn't understand it properly since I have a counter example(?).
The proposition is this:

Now, when I choose $K = \mathbf{Q}$ and $K(x_1,...,x_n) = \mathbf{Q}$($\sqrt{2}$), then $p(x)=x$ and $q(x)=1$ are both in $\mathbf{Q}[x]$, so $p(\sqrt{2})q^{-1}(\sqrt{2}) = \sqrt{2} ∈ \mathbf{Q}$($\sqrt{2})$. Clearly, $\sqrt{2} ∉ \mathbf{Q}$. So, according to the exercise $\sqrt{2}$ is transcendental over $\mathbf{Q}$. However that is not true since it is root of $f(x) = x^2-2$ which is in $\mathbf{Q}[x]$.
What am I missing here? I'd appreciate if you can help me.
 A: What you are missing is that the $x$ in $\mathbb{Q}(x)$ is just a symbol, not a variable you can replace by a real number of your choice. That field is the set of formal quotients of polynomials with rational coefficients.
The   polynomial $x^2 -2$ has no roots in the field
$\mathbb{Q}(x)$ so the fact that those roots are algebraic  and not transcendental (in some other extension of the rationals) does not provide a counterexample.
A: I prefer using capital letters for indeterminates to avoid such confusions between the variable and some element of the field.
The elements of $\mathbb{Q}(X) \setminus \mathbb{Q}$ are the non-constant rational fractions. Such a fraction can be written $F=A/B$ where $A$ and $B$ are two relatively prime polynomials, with $A$ or $B$ non constant, and $B$ monic.
Let $P = a_0 + a_1X \cdots + a_dX^d \in \mathbb{Q}(X)$ with degree $d$. Then $P(F) = a_0 + a_1F \cdots + a_dF^d$.
If $B$ is non constant, $P(F)=C/B^d$, where
\begin{eqnarray*}
C &=& a_0B^d + a_1AB^{d-1} + \cdots + a_{d-1}A^{d-1}B + a_dA^d \\
&=& B(a_0B^{d-1} + a_1AB^{d-2}+\cdots+a_{d-1}A^{d-1})+a_dA^d.
\end{eqnarray*}
The numerator $C$ is relatively prime with $B$. Hence $P(F) \ne 0$.
If $B$ is non constant, then $B=1$ since $B$ is monic, and the degree of $A$ is at least $1$, Hence $P(F) = P(A) \ne 0$, since the degree of $P(A)$ is $d \times \mathrm{deg}(A)$.
Hence $F$ is transcendental over $\mathbb{Q}$.
As you see, this fact involves rational fractions and polynomial and not particular elements of $\mathbb{Q}$.
