Nice applications of the spectral theorem? 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.
 A: *

*An operator-theoretic proof that the classical Hamburger moment problem admits a solution (see e.g.  Methods of modern mathematical physics by Reed and Simon, volume 2, Theorem X.4).

*Weyl's proof of the  Bohr analogue of  Parseval's identity for almost periodic functions. More precisely, let $f$ be a uniformly almost periodic $\mathbb C$-valued function on $\mathbb R$ and let 
$$a(\lambda)=\lim_{T\to\infty}\frac{1}{2T}\int_{-T}^{T}f(t)e^{-i\lambda t}dt.$$
It is known that the set $\{\lambda\in \mathbb R:\ a(\lambda)\neq 0\}$ is at most countable for any uniformly almost periodic function. Let $c_k=a(\lambda_k)\neq 0$ be the sequence of the nontrivial Fourier constants of the function $f$. Then 
$$\sum_{k}|c_k|^2=\lim_{T\to\infty}\frac{1}{2T}\int_{-T}^{T}|f(t)|^2dt.$$
The proof is based on the spectral analysis of the operator 
$$Au=\lim_{T\to\infty}\frac{1}{2T}\int_{-T}^{T}f(t-s)u(s)dt.$$
Weyl shows that $A$ is a normal compact operator on the space of uniformly almost periodic functions (endowed with the scalar product $(u,v)=\lim_{T\to\infty}\frac{1}{2T}\int_{-T}^{T}u(t-s)\overline{v(s)}dt$). The result then follows from a clever application of the spectral theorem. 
A detailed exposition of the proof can be found in Theory of linear operators in Hilbert space by Akhiezer and Glazman (see Section 57).
A: The space of newforms has a basis consisting of eigenforms, since the Hecke operators are a system of commuting self-adjoint operators.
A: I don't know if this is nontrivial enough (or sufficiently unrelated a priori), but one often sees the spectral theorem in proofs that any aperiodic, irreducible Markov chain with finitely many states converges to its stationary distribution. The fact that the spectral gap measures convergence speed is also an immediate and rewarding consequence, and one can illustrate this immediately with either simple (e.g. two-state) examples or various interesting Markov chains.
A standard statistical application of the fact that any positive operator has a unique square root is as follows. Suppose we have a column of data satisfying $\vec{y} = A \vec{x} + \vec{\epsilon}$, where the $\vec{\epsilon}$ have the correlation matrix $\mathbf{E}[ \vec{\epsilon} \vec{\epsilon}^T] = \Omega$ (of course, therefore positive definite). Then we can multiply on the left by $\Omega^{-1/2}$ and obtain (in transformed coordinates) a system with uncorrelated errors, which we can estimate using ordinary least squares. The resulting estimators therefore enjoy all the good properties of OLS. (See pages 2-3 of http://sociology.osu.edu/classes/soc703/Kaufman/Lec07_703.pdf)
These are not mathematically very high-powered applications, but ones hugely important in applied fields.
A: Selberg's Trace Formula, together with its avatars, gives strong information in a lot of topics: asymptotics of closed geodesics over manifolds of constant negative curvature, asymptotics of the number of classes of integral quadratic forms with given discriminant, and so on...
This formula relates the spectrum of a Laplace-Beltrami operator to geometric or algebraic objects. An other correspondance of the same kind, but with topologic objects, is the Atiyah-Singer Index Theorem.
A: You mention the proof of the mean ergodic theorem by Von Neumann. Here is another result from ergodic theory that makes use of the spectral theorem.
Theorem
Let $(X, {\cal T}, \mu)$ be a probability space, $T: X \rightarrow X$ a measure preserving transformation. The following properties are equivalent.
$\bullet$ For all $f,g \in L^2$,
$$
{1\over N}\sum_{k=1}^N \ \Bigl| \int f\circ T^n g \,d\mu -\int f d\mu \int g d\mu \Bigr| \rightarrow 0.
$$
$\bullet$ There is no function $f \in L^2$ and $\theta \in {\bf R}$ such that 
$$
f\circ T = e^{i\theta} f.
$$
If any of these properties is satisfied, the transformation $T$ is said to be weak-mixing.
I don't know of any proof of (2) => (1) that does not use some version of the spectral theorem. 
A: Sorry for the necromancy, but the most basic application of the spectral theorem has to be the second derivative test in multivariable calculus, no?
If $f:\mathbb{R}^n \to \mathbb{R}$ is a smooth function, then its Hessian $D^2f$ is a symmetric bilinear form at each point of $\mathbb{R}^n$.  By the spectral theorem, it has an orthogonal basis of eigenvectors.  At a critical point of $f$, the definiteness of this form tells you whether the critical point is a local max, min, or saddle.  By the spectral theorem, one can simply check the sign of the eigenvalues to determine this.
A: The spectral theorem in the finite-dimensional case is important in spectral graph theory: the adjacency matrix and Laplacian of an undirected graph are both symmetric, hence both have real eigenvalues and an orthonormal basis of eigenvectors, and this is important to many applications of these matrices, e.g. to the study of expander graphs.
A: The Peter-Weyl Theorem. This result is, more or less, equivalent to the statement that any compact Lie group $G$ admits an injective homomorphism to some $U(n)$ (feel free to say this is still a linear algebra result, because $U(n)$ shows up). The key is that $G$ has ''enough'' finite-dimensional representations. The proof in four lines:
The point is that $L^2 (G)$ is a unitary $G$-representation, but of course infinite dimensional. One finds a $G$-invariant, injective and compact operator $K:L^2 (G) \to L^2 (G)$. The eigenspaces of $K$ are finite-dimensional representations, and their sum spans $L^2 (G)$. This is not yet the result that $G$ injects into some $U(n)$, but the biggest step towards that goal.
