Consumer Surplus
Computing consumer surplus from a linear inverse demand curve at a given price.
Question template
Sarah is considering investing in a home energy storage system. Her demand for such systems at any given price is expressed by the following demand function d function. The demand function gives the price P buyers are willing to pay as a function of the quantity Q (an inverse demand curve), and the good is treated as perfectly divisible. What is Sarah's consumer surplus if the price of the energy storage system is price?
Use it
from datasets import load_dataset
ds = load_dataset("narunraman/steer_me", "consumer_surplus")curl "https://steer-benchmark.cs.ubc.ca/api/sample?element_name=consumer_surplus&n=5&seed=42"
See the Reference for the parameters.