My opinion is in some cases those three might mean exactly the same thing. However generally speaking I think there's enough difference between these to straightforwardly state some differences. First of all, if you look up "derogatory" in dictionaries you'll get something like the following:
1. Disparaging; belittling: a derogatory comment.
2. Tending to detract or diminish.
American English Ditionary
tending or intended to detract, disparage, or belittle;
Collins English Dictionary
The meanings of "derogatory" imply "to belittle", "to disparage", or to "derogate" (to take away, detract, discredit. link) .
To do any of these things should be considered at least slightly different from "to offend". People are offended much more often without intent by the offender than they are offended without intent by the derogator. As to this last point, it's interesting that the Collins Dictionary definition mentioned specifically "intentionally offensive." Another difference I can see is that people can take offence to things that aren't directed at them, but to things that may just be a breach of civility or custom. Take for example:
"I found his behaviour toward his mother to be really offensive."
found his behaviour toward his mother to be really derogatory."
or even better:
"I found his table manners to be really offensive."
"I found his table
manners to be really derogatory." (little sense as far as I can see)
This is clearly a shade of meaning to be recognised.
Take also the example sentences:
"Those comments he made on the radio about Chinese people are really
"Those comments he made on the radio about Chinese
people are really offensive."
I believe a listener or reader of these would take the "derogatory" sentence to mean it's offensive to Chinese people", whereas the "offensive" sentence may be taken to mean it's both offensive to Chinese people, but in addition to that, may be seen as offensive on a more general scale; that is, offensive to people at large because racial intolerance is offensive to everyone. Therefore "derogatory" may be badmouthing or depreciating a person or group, but "offensive" may be a breach against societal or human sensibilities.
Now to vulgar. The etymology doesn't matter too much, but it may help. It comes from the Latin:
vulgus, the common people
American Heritage Dictionary
That's why vulgar can mean related to the masses of people, or "common". Link
I know that's not the way in which you intended the word, but it may be helpful to point out that it's highly likely that the word "vulgar" came to have the meaning of crude or offensive and:
b. Deficient in taste, consideration, or refinement
American Heritage Dictionary
because the masses of people were considered crude and boarish as opposed to the elite/nobility/aristocratic/educated/privileged/wealthy.
However, you obviously want to know about "vulgar" to mean to swear or say something off-colour, and how it differs from the other two words. As this answer is long enough, I'll just try to illustrate an obvious difference with an example.
A team of builders are working on a site, and every fifth word that comes out of their mouths is the 'F' word. This is, by definition, a case of rather vulgar behaviour, but there would be nothing offensive about it. That is of course, unless people found that tradesmen talking to each other in this way was offensive.
I'm tempted to think that a simple way of putting it is that something being offensive means that the derogation or vulgar offends somebody, though I'm not sure about this.
When I started off by saying that the three words may in some contexts have the same meaning or be indistinguishable is because someone may say:
"He spent the whole time at the party drinking and making vulgar
And you wouldn't know (from the sentence itself) whether he spent his whole time making rude jokes inappropriately (vulgar), making hateful comments against Mexicans (being derogatory), or was just talking in a way that the others found offensive (being offensive).
But, there are distinctions among the words in many/most cases, I hope I've shown some.