P'(x)=52-0.8x is the marginal profit function.
The average marginal profit is P'(x)/x per unit. This is not the same as the average profit per unit.
So when x=40, P'(40)/40=(52-32)/40=20/40=0.5 per unit (barbecue).
However, the average is 35.6 based on summing P'(x) for x between 1 and 40 and dividing the result by 40.
The average can also be calculated:
∫[0,40](52-0.8x)dx=[52x-0.4x²]|⁴⁰₀=1440, then divide by 40=36.