lucubrating

verb
  1. to study or work hard, especially late into the night; to labor over written work
  2. Usage: formal; literary; often implies intense intellectual effort

Examples