Answer
The required demand function is $N(P)=-12P+160$.
The revenue, $R$ generated is as follows:
For $P=5$, $R=500$;
For $P=6$, $R=528$;
For $P=7$, $R=532$;
For $P=8$, $R=512$;
For $P=9$, $R=468$;
For $P=10$, $R=400$.
The maximum revenue is generated when price is $P=7$ dollars.
Work Step by Step
Let the number of pies sold $N(P)=m\cdot P+b$ when price per pie is $P$ dollars.
Now, we have $N(5)=100$ pies and $N(10)=40$ pies, so, we get $100=5m+b$ and $40=10m+b$.
Subtract the equations, to get $60=-5m$, or, $m=-12$. Substitute $m=-12$ in second equation to get $40=-120+b$, or, $b=160$.
Therefore, the demand function is $N(P)=-12P+160$.
The revenue function, $R(P)=N(P)\times P=(-12P+160)\times P=-12P^{2}+160P$.
Now, we have
$R(5)=-12(5)^{2}+160(5)=500$;
$R(6)=-12(6)^{2}+160(6)=528$;
$R(7)=-12(7)^{2}+160(7)=532$;
$R(8)=-12(8)^{2}+160(8)=512$;
$R(9)=-12(9)^{2}+160(9)=468$;
$R(10)=-12(10)^{2}+160(10)=400$.
Thus, the maximum revenue is generated for price $P=7$ dollars.