Solving System of differential equation by diagonlizing a matrix