Mathematics of pattern formation