It's hard to give a general translation for this word, so it's translation will depend on the context therefore i would like to distinguish some of the meanings i found in an article (see my source below) and explain both words العذاب and العقاب and their origins.
The word العذاب in the Quran
On the meaning and origin of العذاب in Arabic language:
it means to cause hard/big pain and suffering, and it's used to
punish, some linguists say: it meant originally hitting or beating and was
expended to anything which refers to some kind of hardness or distress
up to torture!
In the Quran you'll find this word or a derivative of it like verbs (26 times), nouns and active participle (8) quoted in more then 300 times and with 9 different meanings according to tafsir sources:
- As the punishment in afterlife, and this is the most used meaning for example in the description of Jahanam and to qualify the punishment of afterlife as harder then the one in dunya.
- As the punishment in this life (dunya) like here
- As the punishment of zina here and here
- As transforming or defacing
- As killing and ablation
- As hunger and famine
- As despoil and loss of assets, fortune etc.
- As tearing out feathers and cutting a wing of the hoopoe (al-hudhud/hodhod) and finally
- As the torment of the grave
The word العقاب in the Quran
On the meaning and origin of العقاب in Arabic language:
the origin of this word is عقب which means succeeding or following. So
it's used to say that something will come later or to let something be
followed by an other. This is why our Messenger (peace be upon him)
was called العاقب because he was the last Prophet who came! On the
other hand it's also an expression of the hardness and difficulty
that's why العقبة (the steep path) which is usually in mountains is
called so as it's difficult to pass. Therefore it's also used to
express hardness and distress
In the Quran you will find this word as the noun "العقاب" and some of it's derivative like العاقبة, العقبى, and as a verb and they have been quoted with 6 different meanings:
- As العذاب and this is the most used meaning like in and in.
- As a gain or profit.
- As the killing.
- As the equivalent (in return) = To give back as you were given or return the like!
- As العاقبة = the aftereffect at the end of something.
- As العقبى = refuge
This was my translation, so take it with care!
And Allah knows best!
See also in this Source (in Arabic) for more information!