# Using calculus and formulas (don’t just build a table in a spreadsheet as in the previous lesson), what is the total profit at the optimal integer output level?

# Suppose a competitive firm has as its total cost function:TC=29+2q2

Suppose the firm’s output can be sold (in integer units) at $77 per unit.

**Using calculus and formulas (don’t just build a table in a spreadsheet as in the previous lesson), what is the total profit at the optimal integer output level?**

Please specify your answer as an integer. In the case of equal profit from rounding up and down for a non-integer initial solution quantity, proceed with the higher quantity.

**Hint 1:** The first derivative of the total cost function, which is cumulative, is the marginal cost function, which is incremental. The narrated lecture and formula summary explain how to compute the derivative.

Set the marginal cost equal to the marginal revenue (price in this case) to define an equation for the optimal quantity q.

**Hint 2:** When computing the total cost component of total profit for a candidate quantity, use the total cost function provided in the exercise statement (rather than summing the marginal costs using the marginal cost function).