See Psychology of Invention in the Mathematical Field Jacques Hadamard, published around 1900. Once you have immersed yourself in a problem, going about normal daily tasks not related to the problem allows your mind to churn and make connections. Sudden (Gestalt like) insight may occur.