Let P(x,z)=zd+∑i=1dai(x)zd-i be a polynomial, where ai are real-analytic functions in an open subset U of Rn. If, for any x∈U, the polynomial z↦P(x,z) has only real roots, then we can write those roots as locally Lipschitz functions of x. Moreover, there exists a modification (a locally finite composition of blowups with smooth centers) σ:W→U such that the roots of the corresponding polynomial P~(w,z)=P(σ(w),z),w∈W, can be written locally as analytic functions of w. Let A(x),x∈U, be an analytic family of symmetric matrices, where U is open in Rn. Then there exists a modification σ:W→U such that the corresponding family A~(w)=A(σ(w)) can be locally diagonalized analytically (i.e., we can choose locally a basis of eigenvectors in an analytic way). This generalizes Rellich's well-known theorem (see [32]) from 1937 for 1-parameter families. Similarly, for an analytic family A(x),x∈U, of antisymmetric matrices, there exists a modification σ such that we can find locally a basis of proper subspaces in an analytic way