Example 7.8.2. Producer surplus with numeric integration.

A store trying to sell t-shirts on campus has determined the supply and demand functions to be:
\begin{equation*} \text{supply price}(\quantity)=5+\ln (\quantity+10) \end{equation*}
\begin{equation*} \text{demand price}(\quantity)=10+100/(\quantity+2)\text{.} \end{equation*}
Find the equilibrium price and quantity. Find the producer and consumer surpluses when the shirts are sold at the equilibrium price.
Solution.
We load the supply and demand price functions into excel and use Goal Seek to find an equilibrium price. Rounding to the nearest unit for quantity and cent for price, we have an equilibrium price of $10.45 for a quantity of 222 shirts.
We then substitute these values into the equations for consumer and producer surplus.
\begin{align*} \text{consumer surplus}\amp = \int_0^{q_s} (\text{demand function}(q)- p_s )\, dq\\ \text{consumer surplus}\amp = \int_0^{222} ((10+100/(\quantity+2))- 10.45)\, dq\\ \text{producer surplus}\amp =\int_0^{q_s} ( p_s-\text{supply function}(q)) \, dq\\ \text{producer surplus}\amp =\int_0^{222} ( 10.45-(5+\ln (\quantity+10))) \, dq\text{.} \end{align*}
To evaluate these integrals we either use a Riemann sum approximation, like the one found on the example worksheet, or use Wolfram Alpha. In either case, rounded to the nearest dollar, we have a consumer surplus of $372 and a producer surplus of $191.
in-context