.
The demand function is the number of sold items as a function of price.
The slope of the demand function is the ratio of the increment of the number of the sold items to the increment of the price.
In this case, the increment of the number of the sold items is 5 - 15 = -10 and
the increment of the price is 37-17 = 20 dollars.
Therefore, the slope is
= -0.5 item per dollar.
Hence, the requested demand function is d(p) = 5 - 0.5*(p-37). (1)
CHECK. At p = 37, d(p) = d(37) = 5 - 0.5*(37-37) = 5 - 0.5*0 = 5 - 0 = 5 items. ! Correct !
At p = 17, d(p) = d(17) = 5 - 0.5*(17-37) = 5 - 0.5*(-20) = 5 + 0.5*20 = 5 + 10 = 15 items. ! Correct !
Notice. You may transform the found function (1) to any other equivalent form.