💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
## A.2 Functions Very simply, a ***function** f* of one variable is a rule or law that associates with a value *x* a unique value *f* (*x*). For example, the function *f* that associates the square of a real number with a given real number *x* is ![](https://box.kancloud.cn/672f90366ce4e3a2e09ea81d2435b091_89x23.jpg) A function determines a set of ordered pairs. For example, the function *f* (*x*) = *x*2 determines all the ordered pairs (*x*, *x*2). A ***graph*** of a function is the set of all ordered pairs determined by the function. The graph of the function *f* (*x*) = *x*2 appears in [Figure A.1](#ap-afig01). [![Click To expand](https://box.kancloud.cn/2297692e7d54a5f838095ee7bc18898b_350x423.jpg)](figap-a-1_0.jpg) Figure A.1: The graph of the function *f* (*x*) = *x*2. The ordered pair (2, 4) is illustrated. The function, ![](https://box.kancloud.cn/0fb3ae68a71e3882182bb531bea78af1_80x40.jpg) is defined only if *x* ≠ 0. The ***domain*** of a function is the set of values for which the function is defined. For example, the domain of *f* (*x*) = 1/*x* is all real numbers other than 0, whereas the domain of *f* (*x*) = *x*2 is all real numbers. Notice that the function ![](https://box.kancloud.cn/8315c59871e7ecc1b5680f468b968474_83x23.jpg) can assume only nonnegative values. By "nonnegative values" we mean values greater than or equal to 0, whereas by "positive values" we mean values strictly greater than 0. The ***range*** of a function is the set of values that the function can assume. The range of *f* (*x*) = *x*2 is the nonnegative reals, the range of *f* (*x*) = 1/*x* is all real numbers other than 0, and the range of *f* (*x*) = (1/*x*)2 is all positive reals. We say that a function is *from* its domain and *to* its range. For example, the function *f* (*x*) = *x*2 is from the reals to the nonnegative reals.