Cumulative distribution function

This is my first post on MHF, hello everyone.

I need to determine continuous random variable distribution function $\displaystyle f(x)$ based on its cumulative distribution function $\displaystyle

F(x) = \left\{\begin{array}{cc}0&x<0 \\sin(x)&0\leq x \leq \frac{\pi}{2}\\1&x>\frac{\pi}{2}\end{array}\right.

$

Having $\displaystyle F'(x)=f(x)$ (fundamental theorem of calculus) I would say that distribution function should look like this:

$\displaystyle

f(x) = \left\{\begin{array}{cc}cos(x)&0\leq x \leq \frac{\pi}{2}\\0&else\end{array}\right.

$

Is this correct, and is this formula sufficient?