During his imprisonment in Mandalay, Tilak wrote his famous commentary on the Bhagavad Gita, titled 'Shrimad Bhagavad Gita Rahasya'.