Probability of finding the oscillator in some position in $[x,x + \mathrm d x]$ Given that the position of a one-dimensional harmonic oscillator is given by 

$$x(t) = Acos(\omega t + \phi)$$

where $A,\phi,\omega \geq 0$ are constants of real numbers I'm trying in some sense 

find the $p(x)\mathrm dx$ probability of finding the oscillator between position $x$ and $x+\mathrm d x$. 

There is a hint that this is the same as calculate $\mathrm dT/T$ where $T$ is the period of oscillation and $\mathrm dT $ is an interval of time within the period. 

My attempt: So, I'm trying to calculate using $\mathrm dT/T$ but I do not know how to do it. If we have that $x(t+T) = x(t)$ then we use $\mathrm dx / \mathrm dT = (\mathrm d x/\mathrm dt)(\mathrm dt/\mathrm dT )$ but this do not go much further. I also tryed to look at other derivatives as a trick of considering the constants as variables but for all the constants I got stuck in calculations that didn't go anywhere; for exemple for $\omega$ I just found $\mathrm d T/ T = -\mathrm d \omega/\omega$. Do not give a full answer, give just a hint so that I can conclude the question.

Physical concept involved: This is a statistical mechanics half-problem; the harmonic oscillator is one of the few examples of problems that it is possible to chek the validity of two important elements of the theory: Ergodic Hypothesis and equal-a-priori postulate. 
 A: Start with energy conservation
$$
\frac{1}{2} m \left(\frac{dx}{dt}\right)^2 + \frac{1}{2} k x^2 = E
$$
Note that the amplitude $A$ can be found from setting $dx/dt = 0$ in the above and solving for $x$.
Now solve the above for $dt$ and consider the motion from $x=-A$ to $x=+A$.
You should find that the probability density is
$$
p\left(x\right)dx = \frac{dt}{T/2} = \frac{1}{\pi A}\frac{dx}{\sqrt{1-\left(\frac{x}{A}\right)^2}}
$$
where $T$ is the period.
You should get the same result if you start with your expression for $x\left(t\right)$, note that $dt = -dx / \left[A \omega \sin\left(\omega t + \phi\right)\right]$, and use $\cos^2\theta + \sin^2\theta = 1$.
A: This can also be solved using the standard microcanonical method given in statistical mechanics textbooks. Start with the Hamiltonian:
$$ H = \frac{p^2}{2m} + \frac{1}{2} k x^2 $$
It gives us an ellipse in phase space as the phase trajectory. Calculate the total number of microstates ($\Sigma_{tot}$) with energy less than or equal to $E$, as the area inside the phase trajectory divided by $h$. This gives us:
$$ \Sigma_{tot} = \frac{\pi a b}{h} = \frac{2 \pi E}{h} \sqrt{ \frac{m}{k} } $$.
Then the total number of microstates ($\Omega_{tot}$) with energy between $E$ and $E + \delta E$ is
$$ \Omega_{tot} = \frac{\partial \Sigma_{tot}}{\partial E} = \frac{2 \pi }{h} \sqrt{ \frac{m}{k} } $$
Now we need the number of microstates with a position between $x$ and $x + dx$, $\Omega$ favourable. $\Sigma$ favourable is the region inside the ellipse positioned at $x$. This has to be divided by $h$. It has a width of $dx$, and the height is twice the height of the ellipse.
$$ \Sigma_{fav} = \frac{1}{h} dx \ 2 \sqrt{2mE-mkx^2} $$.
Then $\Omega_{fav}$ is equal to:
$$ \Omega_{fav} = \frac{\partial \Sigma_{fav}}{\partial E} = \frac{2mdx}{h \sqrt{2mE-mkx^2}} $$
Then the probability of the particle being between $x$ and $x+dx$ is
$$ p(x)dx = \frac{\Omega_{fav}}{\Omega_{tot}} = \frac{\sqrt{k} dx}{\sqrt{2} \pi \sqrt{E-\frac{1}{2}kx^2}} = \frac{dx}{\pi \sqrt{A^2-x^2}}$$
