In a situation when a firm is operating in a perfectly competitive firm and the…