Consider the simple harmonic oscillator $\frac{d^2p}{dt^2}=-p$ as a Hamiltonian system with Hamiltonian given by $H=\frac{1}{2}p^2+\frac{1}{2}q^2$. The famous Liouville theorem for integrable systems then says this system can be integrated by ''quadrature.'' I have searched high and low on the internet for a decent explanation of what this means and can't really turn up much other than it is some process involving integrals of known functions and ''algebraic'' operations (Note: The quotations around quadrature and algebraic is directly from Arnold's book on classical mechanics.) My questions is the following: the harmonic oscillator is probably the first and easiest example of a Hamiltonian system then how do you arrive at the solution to the harmonic oscillator using ''quadrature.'' Or should I think of solvable by quadrature as an existence theorem to an ODE.
The Hamilton equations of motion are $$\frac{dx}{dt} = p$$ $$\frac{dp}{dt} = -x$$ The Hamiltonian $H = \frac{1}{2}(x^2 + p^2)$ is conserved, so along a solution it is some constant, say $E$. Then we can solve for $p$: $$p = \sqrt{2E - x^2}$$ Then Hamilton's equations reduce to $$\frac{dx}{dt} = \sqrt{2E - x^2}$$ which is a separable first order ODE. We obtain $$\int \frac{dx}{\sqrt{2E - x^2}} = \int dt$$ which is a solution in "quadratures" (explicit integrals of known functions). The Liouville theorem for integrable systems should be thought of as a generalization of separable ODEs.