Washington Irving is credited with having first used the term “the blues” in 1807, as a synonym for melancholy:
“He conducted his harangue with a sigh, and I saw he was still under the influence of a whole legion of the blues.”
His usage was a shortening of the phrase “the blue devils” which was a synonym that goes back to at least Elizabethan times to describe a baleful presence.
That being said, the word “blue” was used by Chaucer in his poem, Complaint of Mars — a transitional work that finds its fulfillment in Chaucer’s Canterbury Tales — to represent woe. The poem itself was written some time between 1375 and 1385.
The idiom was reinforced by the belief that anxiety and sadness produced a blue cast to the skin of those individuals affected by sadness that lingers.