This monograph consists of three parts: - the abstract theory of Hilbert spaces, leading up to the spectral theory of unbounded self-adjoined operators; - the application to linear Hamiltonian systems, giving the details of the spectral resolution; - further applications such as to orthogonal polynomials and Sobolev differential operators. Written in textbook style this up-to-date volume is geared towards graduate and postgraduate students and researchers interested in boundary value problems of linear differential equations or in orthogonal polynomials