Most books and courses on linear algebra or functional analysis present at least one version of the spectral theorem (either in finite or infinite dimension) and emphasize its importance to many mathematical disciplines in which linear operators to which the spectral theorem applies arise. One finds quite quickly that the theorem is a powerful tool in the study of normal (and other) operators and many properties of such operators are almost trivial to prove once one has the spectral theorem at hand (e.g. the fact that a positive operator has a unique positive square root). However, as hard as it is to admit, I barely know of any application of the spectral theorem to areas which a-priori have nothing to do with linear algebra, functional analysis or operator theory.

One nice application that I do know of is the following proof of Von Neumann's mean ergodic theorem: if $T$ is an invertible, measure-preserving transformation on a probability space $(X,\mathcal{B},\mu)$, then $T$ naturally induces a unitary operator $T: L^2(\mu) \to L^2(\mu)$ (composition with $T$) and the sequence of operators $\frac{1}{N}\sum_{n=1}^{N}T^n$ converges to the orthogonal projection on the subspace of $T$-invariant functions, in the strong operator topology. The spectral theorem allows one to reduce to the case where $X$ is the unit circle $\mathbb{S}^1$, $\mu$ is Lebesgue measure and $T$ is multiplication by some number of modulus 1. This simple case is of course very easy to prove, so one can get the general theorem this way. Some people might find this application a bit disappointing, though, since the mean ergodic theorem also has an elementary proof (credited to Riesz, I believe) which uses nothing but elementary Hilbert space theory.

Also, I guess that Fourier theory and harmonic analysis are intimately connected to the spectral theory of certain (translation, convolution or differentiation) operators, and who can deny the usefulness of harmonic analysis in number theory, dynamics and many other areas? However, I'm looking for more straight-forward applications of the spectral theorem, ones that can be presented in an undergraduate or graduate course without digressing too much from the course's main path. Thus, for instance, I am not interested in the use of the spectral theorem in proving Schur's lemma in representation theory, since it can't (or shouldn't) be presented without some prior treatment of representation theory, which is a topic in itself.

This book by Matousek is pretty close to what I'm looking for. It presents simple and short (but nevertheless impressive and nontrivial) applications of linear algebra to other areas. I'm interested in the more specific question of applications of the spectral theorem, in one of its versions (in finite or infinite dimension, for compact or bounded or unbounded operators, etc.), to areas which are not directly related to the theory of linear operators. Any suggestions will be appreciated.