  Positivstellensatz is a fundamental result in real algebraic geometry
providing algebraic certificates for positivity of polynomials on semialgebraic
sets. In this article Positivstellens\"atze for trace polynomials positive on
semialgebraic sets of $n\times n$ matrices are provided. A Krivine-Stengle-type
Positivstellensatz is proved characterizing trace polynomials nonnegative on a
general semialgebraic set $K$ using weighted sums of hermitian squares with
denominators. The weights in these certificates are obtained from generators of
$K$ and traces of hermitian squares. For compact semialgebraic sets $K$
Schm\"udgen- and Putinar-type Positivstellens\"atze are obtained: every trace
polynomial positive on $K$ has a sum of hermitian squares decomposition with
weights and without denominators. The methods employed are inspired by
invariant theory, classical real algebraic geometry and functional analysis.
  Procesi and Schacher in 1976 developed a theory of orderings and positivity
on central simple algebras with involution and posed a Hilbert's 17th problem
for a universal central simple algebra of degree $n$: is every totally positive
element a sum of hermitian squares? They gave an affirmative answer for $n=2$.
In this paper a negative answer for $n=3$ is presented. Consequently, including
traces of hermitian squares as weights in the Positivstellens\"atze is
indispensable.

Rings and Algebras