Published in Andrew Heiss's blog
Author Andrew Heiss
(See this notebook on GitHub) A year ago, I wrote about how to use R to solve a typical microeconomics problem: finding the optimal price and quantity of some product given its demand and cost. Doing this involves setting the first derivatives of two functions equal to each other and using algebra to find where they cross.