Burn the midnight oil
The phrase midnight oil was coined by Francis Quarles in his literary work Emblems in 1635. “We spend out midday sweat, our midnight oil; we tire the night in thought, the day in toil.” John Gay also used it in his fable The Shepherd and the Philosopher published in 1727, “Hath thy toil o’er books consumed the midnight oil?” Thus “spending” or “consuming” the midnight oil by thinking or working late into the night has been going on for quite some time, but the notion of “burning” it dates from the 19th century.