【函數及圖像 Functions and Graphs:定義域、對應域、值域】Functions and Graphs: Domain, Codomain, Range, Independent and Dependent Variables

SketchMath 數學團隊 SketchMath Maths Team | 更新 Updated 2026-10-20

函數及其圖像 Functions and Graphs 係數學 DSE 必考課題,就咁聽大家未必知係咩,但當中嘅「f(x) = y」概念卻係經常應用於二次或三次方程之中!重點技巧包括定義域 domain、對應域 codomain、值域 range、自變量 independent variable、應變量 dependent variable 等。A function gives exactly one output y = f(x) for every input x. Many inputs may give the same output, but one input may never give two. The domain is the set of allowed inputs and the range is the set of outputs that actually occur.

用 AI 逐步解函數及圖像題目 Solve it with AI練習 38 條 DSE 模擬題 Practise 38 DSE-style questions

DSE 數學 AI 導師 · DSE Math AI Tutor

函數一覽 Functions at a Glance

函數Function每個 input x 只對應一個 output y = f(x)Each input x has exactly one output y = f(x)
垂直線測試法Vertical line test垂直線與圖像最多相交一點A vertical line must meet the graph at most once
定義域Domain所有容許的 input xAll allowed inputs x
值域Range實際出現的所有 output yAll outputs y that actually occur
↑ 返回頁頂 Back to top

函數 Functions

同學可以想像「函數 Function」係一部只會單方向運作嘅「機器」,佢能夠將你輸入嘅「資料 Input」經過一套預先設定嘅計算步驟之後,得出「結果 Output」。例如完整嘅水果係 Input,經過一個負責「將啲水果切片」嘅盒,最後就生成出切咗片嘅水果 Output(啲水果切完片係唔會可以黐得返埋,所以部機淨係可以單向運作)。

依家我哋重新代入返去數學嘅概念,假設 Function 執行嘅程序係將 Input 先乘 2 再加 3,設 Input 為「x」,Output 為「y」,我哋就可以得知其實成條 Function 可以寫成「2x + 3 = y」。

Think of a function as a machine that works in one direction only: it takes an input, runs a preset set of steps, and gives an output. For example, whole fruit goes in, a slicer cuts it, and sliced fruit comes out (sliced fruit cannot be stuck back together, so the machine only works one way).

In maths, suppose the function multiplies the input by 2 and then adds 3. Let the input be x and the output y; then the function is 2x + 3 = y.

↑ 返回頁頂 Back to top

變量 Variables

  • 變量 Variable:即 Input 及 Output(因為如果我哋改變 input 嘅數值,output 都會因此而改變,兩者均為可變量)。
  • 自變量 Independent Variable:即 Input(由於 Function 係唔會逆向運作,所以實際可以改變嘅數值就只有 input)。
  • 應變量 Dependent Variable:即 Output(透過改變 input 嘅數值,output 嘅數值都會被迫改變,所以係「因應別人而變嘅量」)。
  • 函數 Function:自變量與應變量之間嘅關係(一套已固定嘅計算步驟)。
  • Variable: the input and the output (if you change the input, the output changes too, so both can vary).
  • Independent variable: the input (a function does not run backwards, so the only thing you can actually change is the input).
  • Dependent variable: the output (changing the input forces the output to change: it varies in response to the other).
  • Function: the relationship between the independent and dependent variables (a fixed set of calculation steps).
↑ 返回頁頂 Back to top

判斷函數 Determination of Function Determination of a Function

用返啱先嘅水果故事去講,我扔個橙入去,一定係出返橙嘅切片,絕對無可能出到西瓜切片。函數同樣道理:喺一個 input「x」與 output「y」嘅關係裡面,對於每一個 x 值,都只有一個對應嘅 y 值。我哋可以咁樣去表達:f(x) = y。比如 f(x) = 2x + 3,扔數值 4 入去:f(4) = 2(4) + 3 = 11:

Input「x」456
Output「y」111315

如果條式係 f(x) = x² = y 又得唔得呢?扔 −2 及 2 入去,都會得出 4;扔 −3 及 3 入去,都會得出 9。答案係——佢依然屬於函數!唔同嘅 input 但得出相同 output,都係無問題。咁點先叫有問題?就例如 x = y²:扔 4 入去,y = 2 或 y = −2,每一個 input 都出咗 2 個 output,所以呢條函數就唔成立。

  1. 一個 input 只對應一個 output ✓
  2. 多個 input 對應同一個 output ✓
  3. 一個 input 對應多於一個 output ✗

Back to the fruit: if I throw in an orange, I always get orange slices, never watermelon slices. A function works the same way: in a relationship between input x and output y, for every x there is only one matching y. We write f(x) = y. For f(x) = 2x + 3, f(4) = 2(4) + 3 = 11:

Input x456
Output y111315

Is f(x) = x² = y still a function? Put in −2 and 2 and both give 4; −3 and 3 both give 9. It is still a function: different inputs may give the same output (an apple and a red apple both give apple slices). What is not allowed is x = y²: putting in 4 gives y = 2 or y = −2, so one input gives two outputs.

  1. one input, one output ✓
  2. many inputs, the same output ✓
  3. one input, more than one output ✗
↑ 返回頁頂 Back to top

垂直線測試法 Vertical Line Test

當需要判別方程是否函數時,可以於座標上劃出一條垂直線,從左至右橫掃整個圖形。如果直線在任何一個地方與圖形交疊多於一點,則該方程「不是函數」。

To tell whether a graph is a function, draw a vertical line on the coordinate plane and sweep it from left to right across the whole graph. If the line meets the graph at more than one point anywhere, the relation is not a function.

移動垂直線:它與 y = x² 只相交一點(是函數),與 x = y² 則相交兩點(不是函數)。 Slide the vertical line: it meets y = x² once (a function) but x = y² twice (not a function).
↑ 返回頁頂 Back to top

定義域 domain、對應域 codomain、值域 range Domain, Codomain and Range

我哋又去返一開始個例子 f(x) = 2x + 3,假設我哋今次俾個故事佢:枱面有 4 款水果:橙 (2 磅)、蘋果 (3 磅)、菠蘿 (5 磅)、西瓜 (7 磅),我哋想將佢哋全部切件,咁費用就係「水果重量 2 倍 + 俾 3 蚊師傅切」,於是乎 f(2) = 7、f(3) = 9、f(5) = 13、f(7) = 17 元。

  • 定義域 domain:可以入嘅 input。呢度淨係得 4 款生果,所以 input 只有 2、3、5、7。
  • 對應域 codomain:將最細數 2 到最大數 7 代入函數,得出嘅範圍「7 至 17」。
  • 值域 range:實際上嘅 output 只有 4 個,分別為 7、9、13、17,我哋特別標示呢四個數出嚟,稱之為「值域」。

如果題目沒有限制 input 的數量,在這情況下,對應域 codomain = 值域 range。

Go back to f(x) = 2x + 3 with a story: on the table are 4 fruits, an orange (2 lb), an apple (3 lb), a pineapple (5 lb) and a watermelon (7 lb), and the cost to slice each is "twice the weight plus $3 for the cutter". So f(2) = 7, f(3) = 9, f(5) = 13 and f(7) = 17 dollars.

  • Domain: the inputs you are allowed to use. Here only 4 fruits, so the inputs are 2, 3, 5, 7.
  • Codomain: the set the outputs are allowed to lie in. Putting the smallest input 2 and the largest 7 in gives the interval 7 to 17.
  • Range: the outputs that actually occur: 7, 9, 13 and 17 only.

When a question puts no limit on the inputs, the codomain and range are treated as the same set.

沿 f(x) = √x − 1 移動 x:input 由 0 開始(定義域 x ≥ 0),output 由 −1 開始(值域 y ≥ −1)。 Slide x along f(x) = √x − 1: the inputs start at 0 (domain x ≥ 0) and the outputs start at −1 (range y ≥ −1).
↑ 返回頁頂 Back to top

求定義域及值域的例子 Finding Domain and Range

試找出以下函數的定義域 domain、值域 range(以下問題沒有限制 input 的數量):

  1. f(x) = 1/x:∵ 分母不能為 0。∴ 定義域:除 0 之外的所有實數;值域:除 0 之外的所有實數。
  2. f(x) = √x − 1:∵ 開方內不能為負數,但可以為 0。∴ 定義域:所有非負實數。∵ x 的最少值為 0,計算後的 output 為 −1。∴ 值域:−1 及以上的所有實數。
  3. f(x) = 1/(x − 2):∵ 分母不能為 0,所以 x ≠ 2。∴ 定義域:除了 2 之外的所有實數;值域:除 0 之外的所有實數。

Find the domain and range of each function (no limit on the inputs):

  1. f(x) = 1/x: the denominator cannot be 0. Domain: all real numbers except 0. Range: all real numbers except 0.
  2. f(x) = √x − 1: what is under the root cannot be negative, but can be 0. Domain: all non-negative real numbers. The smallest x is 0, giving output −1. Range: −1 and above.
  3. f(x) = 1/(x − 2): the denominator cannot be 0, so x ≠ 2. Domain: all real numbers except 2. Range: all real numbers except 0.
↑ 返回頁頂 Back to top

函數圖像 Functions and Graphs

我哋可以將方程以圖像嘅方式表達出嚟,咁就可以輕鬆搵到定義域 domain、值域 range:定義域是圖像覆蓋的 x 值,值域是圖像覆蓋的 y 值。

You can draw a function as a graph, and then read the domain and range straight off it: the domain is the set of x-values the graph covers, and the range is the set of y-values it covers.

↑ 返回頁頂 Back to top

函數及圖像例題詳解 Worked Examples

例題 1 Example 1:求函數值 Evaluating a function

f(x) = 3x − 5。求 f(4),及使 f(x) = 10 的 x。f(x) = 3x − 5. Find f(4) and the value of x for which f(x) = 10.

  1. f(4) = 3(4) − 5 = 7
  2. 3x − 5 = 10, so x = 5

答案: Answer: f(4) = 7,x = 5。f(4) = 7, x = 5.

↑ 返回頁頂 Back to top

✏️ 自我測試:互動練習 Self-Test: Interactive Practice

溫習方法:點擊以下任何題目,即時在坐標網格載入並核對計算步驟。How to study: click any question to load it on the coordinate grid and check your steps.

(定義域 Domain)求 f(x) = √(x − 3)/(x − 5) 的定義域。Find the domain of f(x) = √(x − 3)/(x − 5).
(垂直線測試法 Vertical line test)y² = x 是 x 的函數嗎?Is y² = x a function of x?
↑ 返回頁頂 Back to top

函數及圖像練習題(DSE 模擬題) Exercises: DSE-Style Practice

SketchMath 題庫內的 DSE 風格練習,選擇題及長題目均附解答。 DSE-style practice from the SketchMath question bank, with solutions for every MC and long question.

函數及其圖像 · 中四
34 條選擇題 34 MC · 4 條長題目 4 long questions

常見問題 Frequently Asked Questions

↑ 返回頁頂 Back to top

相關主題 Related Topics

一元二次方程 Quadratic Equations in One Unknown更多關於函數圖像 More about Graphs of FunctionsHKDSE 數學全部課題 HKDSE Math: all topicsDSE 數學公式表(全課題) HKDSE Maths Formula SheetDSE 數學練習(按年級) DSE Maths Practice by Form
函數及圖像 DSE 練習題 Try a DSE Practice Question