Q:

Why quadratic hamiltonians have exact solutions? 

I am studying Static Perturbation Theory and when I am dealing with a hamiltonian of the form:
\begin{equation}
\hat{H}=\frac{\hat{P}^{2}}{2m}+\frac{1}{2}m\omega^{2}\hat{X}^{2}+\xi\hat{X} \ | \ \xi\in\mathbb{R}
\end{equation}
the book that I am using says that we know there is an exact solution for that kind of hamiltonian because it is quadratic. 
I would like to know why it is that every quadratic hamiltonian has an exact solution. 

A:

From what you suggest, the book does not claim that every quadratic Hamiltonian has an exact solution.   Moreover, it’s not clear what is mean by “exact”.   
If you consider the Hamiltonian with arbitrary quadratics 
$$
\hat H=\sum_{ij} c_{ij} \hat L_i\hat L_j
$$
you could find an arbitrarily accurate numerical solution by diagonalizing within each $(2\ell+1)\times (2\ell+1)$ subspace but for arbitrary coefficients no analytical solution exists for general $\ell$: even for $\ell=1$ you would need to expand $\hat H$ in terms of angular momenta and quadrupole operators, and find the $SU(3)$ rotation to diagonalise this, which amounts to solving $8$ non-linear coupled equations. 
In your specific case, your Hamiltonian can be rewritten as a shifted harmonic oscillator, i.e. a harmonic oscillator with potential $\frac{1}{2}m\omega^2 (\hat X-a\hat 1)^2 + b\hat 1$ and the solution this problem is inferred from that of the unshifted harmonic oscillator.   There a deep reason for this linked to the action of the symplectic group on $p^2$, $xp+px$, $x^2$ (which close on an algebra as operators under commutation) $x$ and $p$ (and of course the unit), which also close on an algebra.  
There is no known analytical solution for potential with cubic terms in $\hat X^3$ besides the series solution provided by the perturbation method.