The maximum profit occurs when MC = MR, so we need to determine when MC = 10.
We cannot determine the marginal cost for unit 21 (we have no data for the total cost for 20 units).
The marginal cost for unit 22 is $145 − $138 = $7.
The marginal cost for unit 23 is $154 − $145 = $9.
The marginal cost for unit 24 is $165 − $154 = $11.
Thus, marginal profit for unit 23 is positive ($10 − $9 = $1), but marginal profit for unit 24 is negative ($10 − $11 =−$1). Thus, 24 units is too many; produce and sell 23.