Marginal costs function: $c'(x)=20+0.2x$ where $x$ is the quantity sold. Fixed cost:500

Demand function is linear :At the price of $78$, 30 units were sold. At the price of $58$,$50$ units were sold.

Find the following

a) Assume that the relationship between price $p$ and demand $x$ is linear . Express $p$ as a function of $x$.

b)Find the total cost function

c)Find the profit function

d)The level of production in which profit is maximized.

e) The maximum profit, price per unit, total revenue and total cost when profit is maximized.

f) Find the change in total profit when production level increases from 50 units to 60 units. Interpret your results.

My attempt,

a) $p=mx+b$

$m=\frac{50-78}{58-30}=-1$

$p=-x+b$

$50=-58+b$

So, $p=-x+108$

b)Total cost function$=\int 20+0.2xdx$

$20x+\frac{0.2x^2}{2}+500=0.1x^2+20x+500$

c)$P(x)=xp(x)-c(x)=x(-x+108)-(0.1x^2+20x+500)$

$P(x)=-1.1x^2+88x-500$

d)$\frac{dP}{dx}=0$

$\frac{d}{dx}(-1.1x^2+88x-500)=0$

$88-2.2x=0$

$x=40$

Am I correct for my attempts? How to proceed for e) ? Can anyone give me some tips for me? Thanks