Final answer:
A perfectly competitive firm maximizes profit by producing at the quantity where marginal revenue equals marginal cost. If the market price is above average total cost at that quantity, the firm will realize an economic profit.
Step-by-step explanation:
A perfectly competitive firm will find its profit-maximizing level of output where marginal revenue (MR) is equal to marginal cost (MC). In perfect competition, marginal revenue is equal to price (MR = P), which means that the profit-maximizing rule for a perfectly competitive firm is to produce at the quantity of output where P = MC.
When a perfectly competitive firm is producing at the profit-maximizing output level, it can realize an economic profit if the market price faced by the firm is above the average total cost (ATC) at that output. This means that total revenue will exceed total cost at the profit-maximizing output level and the firm will earn profits.