I assume given the nature of the question you are adept with the mathematics but I am unsure if you are dealing with a quantum or classical mechanics problem. If it is classical you need to use a Poisson bracket see http://ocw.mit.edu/ans7870/18/18.013a/textbook/chapter16/section03.html
If it is a quantum problem then decompose the matrix in Dirac bra and ket eigenvectors