Pythagorean number in Artin's theorem on nonnegative rational fractions Emil Artin's theorem on nonnegative rational fractions says that a rational fraction $Q$ with $n$ variables with real coefficients which is non-negative on $\mathbb R^n$ is a sum of squares of rational fractions:
$$
Q=\sum_{1\le j\le N} Q_j^2,\quad Q_j\in \mathbb R(X_1,\dots, X_n).
$$
My question: what is known on the size of the Pythagorean number $N$ (how many squares are needed?). I guess that it should depend on the number of variables $n$ and also on the degree $d$ of $Q$. Are there upper and lower bounds, statements or conjectures on this topic?
 A: Apparently, we have $N \leq 2^n$. See these slides by Jean-Louis Colliot-Thélène, belonging to a lecture he gave in Leiden in 2011:
http://www.math.u-psud.fr/~colliot/Kloostermanlezing.pdf
First, he writes regarding the situation over $\mathbf{Q}$:

In the field $\mathbf{Q}(x_1,\ldots,x_n)$, $n \geq 2$, and more generally in a function field in $n$ variables over $\mathbf{Q}$, any positive rational function may be written as a sum of $2^{n+1}$ squares.

Apparently, this is quite a recent (and highly technical) result. Over $\mathbf{R}$, there is a somewhat sharper result, from around 1970, and due to Pfister:

Let $X$ be an irreducible $\mathbf{R}$-variety of dimension
$n$. If $f \in \mathbf{R}(X)$ is positive on $X(\mathbf{R})$ wherever it is defined, then it is a sum of $2^n$ squares in $\mathbf{R}(X)$. 

For a proof, see Pfister's book Quadratic forms with applications to algebraic geometry and topology (section 6.3). Apparently, the following question is a "long-standing open problem":

For $n\geq 3$, is there a sum of $2^n$ squares in $\mathbf{R}(x_1,\ldots,x_n)$ which cannot be written as a sum of a smaller number of squares? 

As regards lower bounds, Colliot-Thélène also remarks (i) that $1+x_1^2+\ldots+x_n^2$ is not a sum of $n$ squares in $\mathbf{R}(x_1,\ldots,x_n)$, which appears to be a result due to Cassels, and (ii) in $\mathbf{R}(x_1,x_2)$, a sum of $4$ squares need not be a sum of $3$ squares.
