I have this formulation and want to calculate its derivatives using a mathematical software, either Matlab, Mathematica or anything else.Is there any way by which I can obtain the second equation form the upper one? Note that $\omega$ is constant. 
Calculating derivatives
matlab;mathematica