Both in the short run and in the long run, a firm maximizes its profits…