It is possible or not using formulas to penetrate the most intimate sphere of human cognitive functions – his creative laboratory. After all, even the air in this sphere filled with ambiguity and improvisation. In the last three-five years, such attempts are verysuccessfully taken by the physiologists, psychologists and experts in nonlinear physics. In this article we look at two examples of creative processes – writing poems and jazz improvisation. From a mathematical point of view, these processes have much in common and are based on universal principles of mental dynamics.