IMO 1979 LL HUN38

Prove the following statement: If a polynomial f(x) with

IMO 1979 LL HUN38

Origin: HUN

Problem

Prove the following statement: If a polynomial f(x) with real coefficients takes only nonnegative values, then there exists a positive integer n and polynomials g1(x), g2(x), . . . , gn(x) such that f(x) = g1(x)2 + g2(x)2 + \cdot \cdot \cdot + gn(x)2.