Deriving profit with respect to A