# Hamiltonian formalism and the phase space

In my book, it says that Hamilton's equations of motion are equations of the first order in the time and that they describe the motion of the system in the $$2S$$-dimensional phase space. Could someone explain clearly what this means, and what exactly a phase space is?

If we have a set of $$S$$ generalized coordinates $$q_i$$ along with the corresponding conjugate momentum $$p_i=\frac{\partial L}{\partial \dot {q_i}}$$
then we can obtain the Hamiltonian $$H=\sum_ip_i\dot q_i-L$$
And the following equations can be obtained: $$\dot p_i=-\frac{\partial H}{\partial q_i}$$ $$\dot q_i=\frac{\partial H}{\partial p_i}$$
The phase space is just a term used to describe all "coordinates" $$\left(q_1,q_2,...,q_S,p_1,p_2,...,p_S\right)$$. Therefore, the phase space consists of $$2S$$ dimensions ($$S$$ generalized coordinates and $$S$$ conjugate momenta), and we have $$2S$$ first order equations in time to describe our trajectories in this phase space.