Probability of position in linear shm?

The problem that got me thinking goes like this:-

Find $dp/dx$ where $p$ is the probability of finding a body at a random instant of time undergoing linear shm according to $x=a\sin(\omega t)$. Plot the probability versus displacement graph. $x$=Displacement from mean.

My work:

$$v=dx/dt=\omega \sqrt{a^2-x^2}$$

Probability of finding within $x$ and $x+dx$ is $dt/T$ where dt is the time it spends there and T$$is the total period. Therefore$$dp=dt/T=\frac{dx}{\pi \sqrt{a^2-x^2}}$$because t=2\pi /\omega and the factor 2 is to account for the fact that it spends time twice in one oscillation. The answer matches the answer and also the condition that integration -a to a of dp =1. But when i try to find p as a function of x to plot the graph I get$$p=\frac{1}{\pi}\arcsin(x/a)+C.$$But then I get stuck as there is no way to find C (except the fact that for C=0 the probability at the mean position is 0 and hence C cannot equal 0) which I know of. So how can I get a restraint on C to find its value and hence to properly graph it with the condition that the probability from -a to a be 1? - add comment 2 Answers The differential dp(x) is the probability of finding the body in an interval of length dx centered at x. The quantity p you are looking for is the cumulative distribution function,$$P(x)=\int_{-\infty}^x \frac{dp}{dx}(x) dx, which is the probability that the particle will be to the left of the point $x$. Since the particle cannot be to the left of $-a$ you can fix $C$ by requiring that $P(-a)=0$. This will then give $P(0)=1/2$ as expected.

It's just a matter of being precise as to exactly what you are calculating.

-
In your notation, $dp/dx$ is your probability density. $p(x)$ is your cumulative probability density, the probability that the particle is to the left of $x$ at a given time. Knowing this, there are at least three ways you can reason. As Emilio Pisanty pointed out in his answer, you can require that $p(-a) = 0$ (ie, that the particle cannot be to the left of $-a$. In addition to that, you can require that $p(a) = 1$ (ie, that the particle cannot be to the right of $a$), or you can require that $p(0) = 0.5$, because the system is symmetric about the origin. All of those should give you the same value for $C$.