رَبِّ اغْفِرْ لِي.
My Lord, forgive me.
The verb ighfir has an imperative morphological form, but a servant addressing the Lord performs supplication (duʿāʾ), not a superior's command. Morphological category and rhetorical speech act must be separated.
اُكْتُبْ جَوَابَكَ.
Write your answer.
An instructor addressing a student can use the same general imperative shape as a straightforward direction. Similar verb morphology does not entail identical communicative force.