elucubrate
To solve, write or compose by working studiously at night; to study.
Near-synonym: pull an all-nighter
Where it comes from
From the past participle of Latin elucubrare (“compose by lamplight”).
Adapted from the Wiktionary entry elucubrate (CC BY-SA 4.0).