Linear demand curve q=mp+b. From the points (100,200) and (50,500):
m=50−100500−200=−6,200=−6⋅100+b⇒b=800⇒q=800−6p.
Profit:
π(p)=(p−40)(800−6p)=−6p2+1040p−32000.
Vertex (maximum):
p∗=−2⋅(−6)1040=121040=3260≈86.67 coins.
Quantity q=800−6⋅3260=800−520=280; profit
πmax=(3260−40)⋅280=3140⋅280=339200≈13066.67 coins.
p∗=3260≈86.67,q∗=280,πmax=339200≈13066.67