Equilibrium of firm Perfect Competition and Monopoly