Perfect competition 
Competitive firm:  Supply curve

Profit is maximised (or loss minimised) when a firm produces an output where marginal revenue equals marginal cost (more), provided marginal cost is rising and lies above minimum average variable cost AVC.

Under perfect competition, price P is equal to marginal revenue MR and average revenue AR (more).  The firm will therefore produce the quantity where P is equal to MC, provided that this occurs where P is equal to, or greater than, AVC (more)

 

If the price is P5, the firm will not produce at all as it cannot cover its variable costs. 

If the price is P4, the firm will be at its close-down point (b) and it is immaterial if it shuts down or continues operations.

If the price is P3 the firm will minimise its economic losses by producing a quantity Q3, corresponding to point c. 

If the price is  P2, the firm will make normal profit (ie it will break even) at point d, which corresponds to a quantity Q2

If the price is P1, the firm will maximise economic profit at point e, ie it will produce a quantity Q1.