# 变量（数学）

在数学中，变量是一个字母或符号，代表一个数值可能发生变化的量；与之相对的是常量，其数值保持不变。<sup>[1](https://openstax.org/books/elementary-algebra-2e/pages/1-2-use-the-language-of-algebra)</sup>变量是代数的基本构件：它们让一个表达式或一个方程就能同时描述某一问题的全部情形，因此像二次方程这样的一个公式便可涵盖其所有具体的数值实例。<sup>[2](https://sites.math.rutgers.edu/~cherlin/History/Papers2002/vieta.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | 变量是代表数值可能变化的量的字母；常量是数值始终保持不变的量<sup>[1](https://openstax.org/books/elementary-algebra-2e/pages/1-2-use-the-language-of-algebra)</sup> |
| 最早的字母记号 | 弗朗索瓦·韦达于1591年首次在代数方程中用字母同时表示未知数与常量，元音字母表示未知数，辅音字母表示已知数<sup>[3](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/variables/)</sup> |
| 现代惯例 | 勒内·笛卡尔的《几何学》（1637年）确立了以字母表开头的字母（a、b、c）表示已知量、以末尾的字母（z、y、x）表示未知数的惯例，这一惯例沿用至今<sup>[3](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/variables/)</sup><sup> • </sup><sup>[4](https://nrich.maths.org/articles/development-algebra-2)</sup> |
| 带符号的量 | 笛卡尔只用字母表示正数；约翰·哈德于1657年首次让字母可以表示正数或负数<sup>[3](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/variables/)</sup> |
| 在函数中 | 对于 \( y = f(x) \)，\( x \) 是自变量，可取定义域中的任意值；\( y \) 是因变量，其值取决于 \( x \)<sup>[5](https://openstax.org/books/intermediate-algebra-2e/pages/3-5-relations-and-functions)</sup> |
| 在逻辑中 | 被全称量词或存在量词约束的变量是约束变量；一个谓词只有在其所有变量都被约束时才算作命题<sup>[6](https://www.ams.org/bookstore/pspdf/text-73-prev.pdf)</sup> |

## 变量的作用

变量占据的是一个可能随情形不同而变化的数值的位置。<sup>[7](https://math.libretexts.org/Bookshelves/Applied_Mathematics/Introductory_Quantitative_Reasoning_%28Quantway_Core%29/05%3A_Fundamentals_Lessons_1_to_27_-_Student_Lessons/5.21%3A_Fundamentals_20_-_AlgebraBasics)</sup>一个标准的教科书例子：若格雷格的年龄记作 \( g \)，而亚历克斯始终比他大3岁，则表达式 \( g + 3 \) 对每一个 \( g \) 值都表示亚历克斯的年龄；年龄在变，而相差的3岁是一个常量。<sup>[1](https://openstax.org/books/elementary-algebra-2e/pages/1-2-use-the-language-of-algebra)</sup>初等代数中最常用于变量的字母是 \( x \)、\( y \)、\( a \)、\( b \) 和 \( c \)。<sup>[1](https://openstax.org/books/elementary-algebra-2e/pages/1-2-use-the-language-of-algebra)</sup>

有一种教科书定义明确指出了取值范围：变量是一个字母或符号，代表两个或多个数构成的集合中的任一成员；而常量代表一个特定的数，无论已知还是未知。<sup>[8](https://math.libretexts.org/Bookshelves/Algebra/Elementary_Algebra_%28Ellis_and_Burzynski%29/02%3A_Basic_Properties_of_Real_Numbers/2.02%3A_Symbols_and_Notations)</sup>按照这种处理，若 \( x \) 代表35、25或10英里/小时的车速限制，它就是变量；而一个只能取5890这一数值的字母 \( h \)（乞力马扎罗山的高度，单位为米）则是常量，尽管它的值一开始并未说明。<sup>[8](https://math.libretexts.org/Bookshelves/Algebra/Elementary_Algebra_%28Ellis_and_Burzynski%29/02%3A_Basic_Properties_of_Real_Numbers/2.02%3A_Symbols_and_Notations)</sup>

**变量与未知数。** 这两种角色相关但有区别。未知数是一个有待求出的特定量，例如 \( x \) 代表某个方程的解。变量则更宽泛地表示一个可以取一系列值的量，如在公式或函数中那样。记号史家约瑟夫·马祖尔（《启明的符号》一书的作者，该书是一部数学记号史）将笛卡尔所用的靠后字母描述为表示“可以取一系列值的变量或未知数”，在一个惯例中兼顾了这两种角色。<sup>[9](https://www.jstor.org/stable/j.ctt5hhpnp)</sup>

## 历史发展

**韦达的字母记号，1591年。** 在十六世纪末以前，代数学家使用具体的数和文字规则进行运算。弗朗索瓦·韦达（1540—1603），一位如今被称为现代代数记号之父的法国数学家，迈出了决定性的一步：在《分析术引论》（1591年）中，他使用字母表中的字母——他称之为“种”（species）——来表示所有方程中的常量项和变量项。<sup>[2](https://sites.math.rutgers.edu/~cherlin/History/Papers2002/vieta.html)</sup>他按字母类别区分二者，写道未知量应以字母A或其他元音字母（E、I、O、U、Y）表示，而已知量应以B、G、D或其他辅音字母表示。<sup>[3](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/variables/)</sup>他将这种以字母为基础的新代数命名为“符号逻辑学”（logistica speciosa），以区别于在数中进行运算的旧“数字逻辑学”（logistica numerosa）。<sup>[10](https://www.math.mcgill.ca/darmon/courses/history/katz.pdf)</sup>

其收益在于一般性。有了代表数值常量的字母，韦达就能处理一般实例而非具体实例，给出公式而非规则；不必把 \( 5 + 3 \) 替换为8，像 \( B + D \) 这样的表达式会保留在展示的公式中，从而使其与原始常量的关系仍然可见。<sup>[10](https://www.math.mcgill.ca/darmon/courses/history/katz.pdf)</sup>字母记号使得研究对象不再限于像 \( 6x^2 - 5x - 1 = 0 \) 这样的单个方程，而可以是二次方程 \( ax^2 + bx + c = 0 \) 本身。<sup>[2](https://sites.math.rutgers.edu/~cherlin/History/Papers2002/vieta.html)</sup>韦达的记号仍处于过渡阶段：他用文字或缩写书写幂（写作A quadratum，即“A的平方”，而非 \( A^2 \)），用“相等”（aequetus）一词代替等号，并坚持齐次律，即方程中所有项必须具有相同的几何次数。<sup>[10](https://www.math.mcgill.ca/darmon/courses/history/katz.pdf)</sup>

**笛卡尔的惯例，1637年。** 勒内·笛卡尔的《几何学》（1637年）引入了今天所用的安排：字母表开头的字母表示已知量，靠近末尾的字母——尤其是z——表示未知数。<sup>[2](https://sites.math.rutgers.edu/~cherlin/History/Papers2002/vieta.html)</sup>麦克塔特数学符号史在引用弗洛里安·卡约里的经典综述时指出，在为未知数选择与已知量符号a、b、c相配的符号时，笛卡尔把字母表的最后一个字母z分配给第一个未知数，然后向前依次用y和x表示第二和第三个未知数。<sup>[3](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/variables/)</sup>在《几何学》第三卷的方程中，x占据主导地位，笛卡尔引入了至今仍用于描述直线方程的 \( ax + by = c \) 形式。<sup>[3](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/variables/)</sup>马祖尔的记述补充说，《几何学》把开头的字母留给固定的已知量，把p之后的靠后字母留给变量或未知数，这种字母表的划分至今仍是大致的标准规则。<sup>[9](https://www.jstor.org/stable/j.ctt5hhpnp)</sup>

x何以成为标准未知数，尚无定论。约翰逊的数学史中记载的一则印刷工轶事称，在排印《几何学》期间，印刷工的z和y活字不够用了，笛卡尔说这无关紧要，于是印刷工选了在法语文本中出现较少的x。<sup>[3](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/variables/)</sup>《牛津英语词典》则径直把z、y、x的排序归功于笛卡尔。<sup>[3](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/variables/)</sup>根据卡约里和《牛津英语词典》的说法，较早的假说——认为x源自阿拉伯语中表示“事物”的词，或源自拉丁语res或radix的缩写——都找不到支持证据。<sup>[3](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/variables/)</sup>

**后来的改进。** 托马斯·哈里奥特（1560—1621）用小写元音字母表示未知数、小写辅音字母表示已知量，笛卡尔似乎沿用了这一做法，尽管他否认见过哈里奥特的著作。<sup>[3](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/variables/)</sup><sup> • </sup><sup>[9](https://www.jstor.org/stable/j.ctt5hhpnp)</sup>笛卡尔把字母限制为表示正量，负数写作 \( -b \)；约翰·哈德（1633—1704）于1657年在《方程化简论》中首次允许一个字母表示正数或负数。<sup>[3](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/variables/)</sup>乔纳斯·摩尔的《算术》（1660年）建议用辅音字母或字母表靠前的字母标记已知量，用元音字母或z、y、x等末尾字母表示所求量，以免在工作中造成混淆。<sup>[3](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/variables/)</sup>

在数学上，笛卡尔的《几何学》在变量方面同样具有创新性：它创造了一种线段代数，一种纯粹以符号而非数值进行运算的代数，其中几何量的联合变化——限于尺规作图所允许的范围——通过用符号书写的方程来刻画。数学史家认为，这是微分学创立之前对变量进行数学处理的一个根本性步骤。<sup>[11](https://arxiv.org/abs/2208.09035)</sup>

## 函数中的变量

在函数记号 \( y = f(x) \) 中，字母 \( x \) 表示输入值，即自变量，可取定义域中的任意值；\( y \) 或 \( f(x) \) 表示输出值，即因变量，其值取决于 \( x \)。<sup>[5](https://openstax.org/books/intermediate-algebra-2e/pages/3-5-relations-and-functions)</sup>例如，在 \( f(x) = 4x - 5 \) 中，在 \( x = 2 \) 处求值得到 \( f(2) = 3 \)；\( f(x) \) 中的括号并不表示乘法。<sup>[5](https://openstax.org/books/intermediate-algebra-2e/pages/3-5-relations-and-functions)</sup>函数的输入不必是数；一个函数可以以一个月份的名称作为输入，返回该月的天数作为输出。<sup>[12](https://openstax.org/books/college-algebra/pages/3-1-functions-and-function-notation?modal=MH)</sup>

在应用中，建模者常常用让人联想到所测数量的字母来代替 \( x \) 和 \( y \)，例如温度换算 \( F = \frac{9}{5}C + 32 \) 中的 \( C \) 和 \( F \)，这样变量就能提醒读者所测的是什么。<sup>[13](https://openstax.org/books/college-algebra-corequisite-support-2e/pages/4-2-modeling-with-linear-functions)</sup>

## 自由变量与约束变量

在逻辑学以及分析学和计算机科学的部分领域中，变量被分为自由的或约束的。被“对所有”或“存在”这类量词约束的变量是约束变量；未被约束的变量是自由变量。<sup>[6](https://www.ams.org/bookstore/pspdf/text-73-prev.pdf)</sup>这一区分之所以重要，是因为带有自由变量的谓词尚不是具有真值的陈述：“对所有 \( x \)，\( x > 0 \)”若量词的范围是整数 \( \mathbb{Z} \) 则为假，而在自然数 \( \mathbb{N} \) 上则为真，因此必须指明自由变量可取值所构成的集合。<sup>[6](https://www.ams.org/bookstore/pspdf/text-73-prev.pdf)</sup>要成为命题，一个谓词的所有变量都必须被约束。<sup>[6](https://www.ams.org/bookstore/pspdf/text-73-prev.pdf)</sup>量词并非唯一约束变量的符号；微积分中的求和记号同样约束其索引变量。<sup>[14](https://www.cs.utexas.edu/~vl/teaching/311/ln1.pdf)</sup>

## 建模中的变量

数学建模始于识别某一情境中的变量，并选出那些代表其本质特征的变量；随后建模者以几何、图形、表格、代数或统计的形式表述这些变量之间的关系，对其进行分析，结合原始情境解释结果，并据此验证模型。<sup>[15](https://www.thecorestandards.org/Math/Content/HSM/)</sup>在这一循环中，技术对于改变假设、探索后果以及将预测与数据进行比较很有价值。<sup>[15](https://www.thecorestandards.org/Math/Content/HSM/)</sup>

## References

1. [Use the Language of Algebra, Elementary Algebra 2e, OpenStax](https://openstax.org/books/elementary-algebra-2e/pages/1-2-use-the-language-of-algebra)
2. [Vieta, the Father of Modern Algebraic Notation, Rutgers University](https://sites.math.rutgers.edu/~cherlin/History/Papers2002/vieta.html)
3. [Earliest Uses of Symbols for Variables, MacTutor History of Mathematics, University of St Andrews](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/variables/)
4. [The Development of Algebra – 2, NRICH, University of Cambridge](https://nrich.maths.org/articles/development-algebra-2)
5. [Relations and Functions, Intermediate Algebra 2e, OpenStax](https://openstax.org/books/intermediate-algebra-2e/pages/3-5-relations-and-functions)
6. [Introduction to Quantification, American Mathematical Society](https://www.ams.org/bookstore/pspdf/text-73-prev.pdf)
7. [Algebra Basics, Quantway Core, Mathematics LibreTexts](https://math.libretexts.org/Bookshelves/Applied_Mathematics/Introductory_Quantitative_Reasoning_%28Quantway_Core%29/05%3A_Fundamentals_Lessons_1_to_27_-_Student_Lessons/5.21%3A_Fundamentals_20_-_AlgebraBasics)
8. [Symbols and Notations, Elementary Algebra (Ellis and Burzynski), Mathematics LibreTexts](https://math.libretexts.org/Bookshelves/Algebra/Elementary_Algebra_%28Ellis_and_Burzynski%29/02%3A_Basic_Properties_of_Real_Numbers/2.02%3A_Symbols_and_Notations)
9. [Enlightening Symbols: A Short History of Mathematical Notation and Its Hidden Powers, JSTOR](https://www.jstor.org/stable/j.ctt5hhpnp)
10. [A History of Mathematics (Katz), McGill University course text](https://www.math.mcgill.ca/darmon/courses/history/katz.pdf)
11. [An introduction to the concept of function within Descartes's algebra of segments, arXiv](https://arxiv.org/abs/2208.09035)
12. [Functions and Function Notation, College Algebra, OpenStax](https://openstax.org/books/college-algebra/pages/3-1-functions-and-function-notation?modal=MH)
13. [Modeling with Linear Functions, College Algebra with Corequisite Support 2e, OpenStax](https://openstax.org/books/college-algebra-corequisite-support-2e/pages/4-2-modeling-with-linear-functions)
14. [Lecture Notes on Logic, University of Texas at Austin](https://www.cs.utexas.edu/~vl/teaching/311/ln1.pdf)
15. [High School: Modeling, Common Core State Standards Initiative](https://www.thecorestandards.org/Math/Content/HSM/)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/variable-mathematics

English original: https://www.edgepedia.org/variable-mathematics
