The "dismal science" reference traces back to an article Carlyle wrote, "Occasional Discourse on the Negro Question" published in Fraser's Magazine, December, 1849.
It deals with the labour situation in the West Indies where the white planters were complaining that following the emancipation of the slaves they were unable to obtain enough labour (at the prevailing wages and conditions of work) to carry on their business. Carlyle puts the view that 'work' is morally good and that if a "Black man" will not voluntarily work for the wages then prevailing he should be forced to work.
Carlyle was an unrepentant racist to the end. He believed that white and black were bound by their "mutual duties" - i.e. master and servant.
Which is why this is probably as opportune a moment as any to retire "dismal science" from our conversation. Enough said.