The law of comparative advantage is usually attributed to David Ricardo, who described the theory in "On the Principles of Political Economy and Taxation," published in 1817. However, the idea of comparative advantage may have originated with Ricardo's mentor, James Mill, who also wrote on the subject.