Lagrange was a favourite of the king, who frequently lectured him on the advantages of perfect regularity of life. The lesson was accepted, and Lagrange studied his mind and body as though they were machines, and experimented to find the exact amount of work which he could do before exhaustion. Every night he set himself a definite task for the next day, and on completing any branch of a subject he wrote a short analysis to see what points in the demonstrations or in the subject-matter were capable of improvement. He carefully planned his papers before writing them, usually without a single erasure or correction.