---
tag: J45F4F13VB
kind: problem
name: Hilbert's seventeenth problem
msc: ["12D15", "11E25", 14P05]
uses: [08J2M1JYAG, 0Q9EZS90GY, 0WCZH4AFMT, X32TSWJSYT, 778KFSM09P]
about: [X32TSWJSYT, 778KFSM09P]
sources:
  - url: https://en.wikipedia.org/wiki/Hilbert%27s_seventeenth_problem
same_as:
  wikidata: Q2496877
  wikipedia: Hilbert's seventeenth problem
history:
  posed_by: "David Hilbert"
  first_stated: "1900"
---

## Problem

Let $n \ge 1$ and let $f \in \R[x_1, \dots, x_n]$ be a polynomial with real coefficients such that $f(a) \ge 0$ for every $a \in \R^n$.
Is $f$ a sum of squares of [[rational functions|0WCZH4AFMT]], that is, are there $g_1, \dots, g_m \in \R(x_1, \dots, x_n)$ with $f = g_1^2 + \cdots + g_m^2$?

## Remarks

Emil Artin answered the question positively in 1927.
His proof uses the theory of [[formally real fields|X32TSWJSYT]] and [[real closures|778KFSM09P]].
If $f$ were not a sum of squares, some ordering of $\R(x_1, \dots, x_n)$ would make $f$ negative.
Passing to a real closure then yields a real point where $f < 0$.
Rational functions are needed: a nonnegative polynomial need not be a sum of squares of polynomials.
An example is the Motzkin polynomial $x^4 y^2 + x^2 y^4 - 3x^2 y^2 + 1$, which is not a sum of squares of polynomials.
It is nonnegative by the inequality of arithmetic and geometric means applied to $x^4 y^2$, $x^2 y^4$ and $1$.
Hilbert showed that every nonnegative polynomial is a sum of squares of polynomials exactly in these cases: one variable, degree $2$, or two variables and degree $4$.
Pfister showed that $2^n$ squares of rational functions always suffice.

## Explanations

### L1 human

A sum of squares of real numbers is never negative.
Hilbert asked for the converse for polynomials: if a polynomial never takes a negative value, can one see this by writing it as a sum of squares?
With fractions allowed, the answer is yes, and a certificate of positivity always exists.
With polynomials only, the answer is no in general.
