In 1770, Joseph Louis Lagrange proved that every positive integer can be expressed as the sum of four squares of integers. Adrien-Marie Legendre improved on the theorem in 1798 by stating that a positive integer can be expressed as the sum of three squares if and only if it is not of the form
. His proof was incomplete, leaving a gap which was later filled by Carl Friedrich Gauss. We consider a generalization of Lagrange's result which has applications to Polynomial Identity algebras (PI algebras). This work is joint with Amitai Regev. No background is needed to follow the talk, in particular none in Number Theory or in PI algebras.