Answer:

profit= price - total cost
P = price ( GIVEN IN THE QUESTION )
Total cost = (Average cost) * Quantity ( Because AC = TC/Q )
TC= Q^3 - 8Q^2 + 36Q + 3
TC is also equal to Q * P
Therefore Q *( P ) = Q^3 - 8Q^2 + 36Q +3
now you can solve ( if necessary apply derivatives )