# 二次公式

二次公式是二次方程解的闭式表达式，它直接用系数表示方程 \( ax^{2} + bx + c = 0 \)（其中 \( a \neq 0 \)）的根，即 \( x = \frac{-b \pm \sqrt{b^{2} - 4ac}}{2a} \)。<sup>[1](https://www.math.utah.edu/online/1010/formula/)</sup> 该公式通过对一般方程配方得到，而根号下的量，即判别式 \( b^{2} - 4ac \)，决定了存在多少个实解以及解的性质。<sup>[1](https://www.math.utah.edu/online/1010/formula/)</sup><sup> • </sup><sup>[2](https://openstax.org/books/college-algebra-2e/pages/2-5-quadratic-equations)</sup>

| 关键事实 | 详情 |
|---|---|
| 公式 | 对于 \( ax^{2} + bx + c = 0 \)，\( a \neq 0 \)，有 \( x = \frac{-b \pm \sqrt{b^{2} - 4ac}}{2a} \)<sup>[1](https://www.math.utah.edu/online/1010/formula/)</sup> |
| 推导 | 对一般方程配方：除以 \( a \)，加上 \( \left(\frac{b}{2a}\right)^{2} \)，开平方，解出 \( x \)<sup>[3](https://tutorial.math.lamar.edu/classes/alg/solvequadraticeqnsii.aspx)</sup> |
| 判别式 \( b^{2} - 4ac \) | 为正：两个实解（若为完全平方数则为有理数，否则为无理数）；为零：一个二重解；为负：两个复解<sup>[2](https://openstax.org/books/college-algebra-2e/pages/2-5-quadratic-equations)</sup> |
| 历史跨度 | 古巴比伦时期（约公元前1800年）已求解等价于二次方程的问题；现代符号形式的公式则是公元18世纪的发展<sup>[4](https://mathvoices.ams.org/featurecolumn/2020/11/01/fc-2020-10-2/)</sup> |
| 关键代数恒等式 | 两根满足 \( x_{1} \cdot x_{2} = c/a \)（韦达关系），这是第二个根数值稳定计算的基础<sup>[5](https://metaphor.ethz.ch/x/2018/hs/401-0663-00L/NCSE18.pdf)</sup> |
| 数值注意事项 | 当 \( b^{2} \gg 4ac \) 时，教科书公式会因灾难性抵消而损失精度；稳定的实现先计算良态的那个根，再由 \( x_{1} \cdot x_{2} = c/a \) 导出另一个根<sup>[6](https://www.mycplus.com/programming/solve-the-quadratic-equation-using-c/)</sup> |
| 典型应用 | 抛体运动、电路中的电流，以及工程课程中的等效电阻<sup>[7](https://www.oreilly.com/library/view/introductory-mathematics-for/9781118141809/Text/chap002.xhtml)</sup> |

## 公式及其推导

该公式来自对系数用符号表示的 \( ax^{2} + bx + c = 0 \) 配方，步骤与数值例子完全相同。具体为：两边除以 \( a \) 使首项系数为1，将常数移到右边，两边加上 \( \left(\frac{b}{2a}\right)^{2} = \frac{b^{2}}{4a^{2}} \) 使左边成为平方 \( \left(x + \frac{b}{2a}\right)^{2} \)，开平方，解出 \( x \)，得到 \( x = -\frac{b}{2a} \pm \frac{\sqrt{b^{2} - 4ac}}{2a} \)。<sup>[3](https://tutorial.math.lamar.edu/classes/alg/solvequadraticeqnsii.aspx)</sup> 犹他大学数学1010课程的讲义给出了同样的推导链，并将最后一行称为二次公式，还补充说应用时需先将方程化为标准形式，再代入 \( a \)、\( b \)、\( c \) 的值。<sup>[1](https://www.math.utah.edu/online/1010/formula/)</sup>

配方是生成该公式的核心要素，而在公式出现之前的漫长岁月里，它正是求解二次方程的方法。<sup>[4](https://mathvoices.ams.org/featurecolumn/2020/11/01/fc-2020-10-2/)</sup> 这一操作最初具有明确的几何意义：数被等同于面积，一个L形多边形被补成一个几何正方形。<sup>[4](https://mathvoices.ams.org/featurecolumn/2020/11/01/fc-2020-10-2/)</sup>

## 判别式

根号下的表达式 \( D = b^{2} - 4ac \) 称为判别式。它决定了方程解的数量及其性质。<sup>[1](https://www.math.utah.edu/online/1010/formula/)</sup> 对于实系数，情形如下：<sup>[2](https://openstax.org/books/college-algebra-2e/pages/2-5-quadratic-equations)</sup>

- \( b^{2} - 4ac > 0 \)：两个实解，若判别式为完全平方数则为有理数，否则为无理数。
- \( b^{2} - 4ac = 0 \)：一个有理解，计为两次（二重解）。
- \( b^{2} - 4ac < 0 \)：两个复解，构成共轭对。<sup>[1](https://www.math.utah.edu/online/1010/formula/)</sup>

## 应用

二次方程广泛出现在物理、工程和金融领域，而该公式是求解它们的标准工具之一。<sup>[8](https://isu.pressbooks.pub/eset1140/chapter/unit-10-4-practical-applications-of-quadratic-equations/)</sup>

**抛体运动。** 抛向空中的物体的高度遵循抛物线轨迹，在简单情形下，时刻 \( t \) 的高度是二次多项式 \( at^{2} + bt + c \)。<sup>[9](https://courses.lumenlearning.com/aacc-collegealgebrafoundations/chapter/read-projectiles/)</sup> 一个标准的工程例子以 \( h(t) = 96t - 16t^{2} \) 建模以96英尺/秒向上抛出的球，求 \( h(t) = 80 \) 英尺的时刻，这是一个形如 \( ax^{2} + bx + c = 0 \) 的方程，可通过因式分解、二次公式和配方求解。<sup>[7](https://www.oreilly.com/library/view/introductory-mathematics-for/9781118141809/Text/chap002.xhtml)</sup> 在 OpenStax 的一个物理例子中，初竖直速度为14.3米/秒、落点在起点下方20.0米的抛体导出 \( (4.90)t^{2} - (14.3)t - 20.0 = 0 \)；二次公式给出 \( t = 3.96 \) 秒和 \( t = -1.03 \) 秒，其中负值代表运动开始之前的事件，被舍去。<sup>[10](https://openstax.org/books/college-physics-2e/pages/3-4-projectile-motion)</sup>

**电路及其他工程问题。** 一本工程数学教材用三种方法求解灯泡电流方程 \( I^{2} - 6I + 5 = 0 \)，每种方法都得到 \( I = 1, 5 \) 安，并将抛体运动、灯泡电流和等效电阻列为其二次方程应用。<sup>[7](https://www.oreilly.com/library/view/introductory-mathematics-for/9781118141809/Text/chap002.xhtml)</sup>

## 历史

二次方程自古巴比伦时期（约公元前1800年）起就被考虑和求解，但今天学生背诵的公式是公元18世纪的发展。<sup>[4](https://mathvoices.ams.org/featurecolumn/2020/11/01/fc-2020-10-2/)</sup> 巴比伦书吏使用了一种本质上就是配方的算法，麦克图托（MacTutor）的巴比伦数学史指出，他们求解二次方程时本质上使用了标准公式；然而他们的问题只有正（无符号）答案，因为通常的答案是长度。<sup>[11](https://mathshistory.st-andrews.ac.uk//HistTopics/Babylonian_mathematics/)</sup><sup> • </sup><sup>[12](https://mathshistory.st-andrews.ac.uk//HistTopics/Quadratic_etc_equations/)</sup> 2013年的一项历史研究认为，二次方程的第一个精确解法使用了“共轭法则”或配方，两者最终都基于正方形的某种分割，而对此类解法的需求不晚于公元前三千纪下半叶在美索不达米亚出现。<sup>[13](https://research.chalmers.se/en/publication/193131)</sup>

**花拉子米与中世纪传统。** 穆罕默德·伊本·穆萨·花拉子米（Muhammad ibn Musa al-Khwarizmi，约780–约850）撰写了关于二次方程的《还原与对消计算概要》（*The Compendious Book on Calculation by Completion and Reduction*，الكتاب المختصر في حساب الجبر و المقابلة），约于825年出版；该书将“代数”一词赋予了欧洲语言。<sup>[14](https://webspace.science.uu.nl/~wepst101/wisl901/goodpractices/2010-Khwarizmi.pdf)</sup><sup> • </sup><sup>[12](https://mathshistory.st-andrews.ac.uk//HistTopics/Quadratic_etc_equations/)</sup> 他给出了所有可能类型二次方程的完整解法，每种类型都有规则，本质上是以数值例子给出的熟悉的二次公式，随后是几何配方的证明。<sup>[12](https://mathshistory.st-andrews.ac.uk//HistTopics/Quadratic_etc_equations/)</sup> 印度数学家将巴比伦方法推进一步：婆罗摩笈多（Brahmagupta，598–665）给出了一种几乎现代的、允许负量的方法。<sup>[12](https://mathshistory.st-andrews.ac.uk//HistTopics/Quadratic_etc_equations/)</sup> 亚伯拉罕·巴尔·希亚·哈-纳西（Abraham bar Hiyya Ha-Nasi）的《测量之书》（*Liber embadorum*）于1145年出版，是欧洲出版的第一本给出二次方程完整解法的书。<sup>[12](https://mathshistory.st-andrews.ac.uk//HistTopics/Quadratic_etc_equations/)</sup>

**现代符号形式。** 勒内·笛卡尔（René Descartes）的《几何学》（*La Géométrie*，1637）引入了幂的指数和平面坐标，使得一般二次方程可以写成 \( ax^{2} + bx + c = 0 \)，其解可视为抛物线与x轴的交点。<sup>[4](https://mathvoices.ams.org/featurecolumn/2020/11/01/fc-2020-10-2/)</sup> 在《代数基础》（*Elements of Algebra*，1770）中，欧拉（Euler）将方程写成 \( ax^{2} \pm bx \pm c = 0 \)，化简为 \( x^{2} + px = q \)，以纯代数方式配方，得到 \( x = -\frac{1}{2}p \pm \sqrt{\frac{1}{4}p^{2} + q} \)，这一解与二次公式完全等价；至此，为该操作提供了约2500年依据的几何图形已经消失。<sup>[4](https://mathvoices.ams.org/featurecolumn/2020/11/01/fc-2020-10-2/)</sup>

## 数值稳定性

代数上精确的公式在浮点运算中仍可能产生糟糕的数值结果。当 \( ac \) 相对于 \( b^{2} \) 很小时，\( b \) 的量级与 \( \sqrt{b^{2} - 4ac} \) 大致相同，因此两个根之一被计算为两个几乎相等的数之差，舍入误差破坏了该根的精度。<sup>[15](https://people.csail.mit.edu/bkph/articles/Quadratics.pdf)</sup> 这就是灾难性抵消：两个大而几乎相等的量相减，留下的结果只有少数可靠数字，当 \( b^{2} \gg 4ac \) 时，教科书公式可能使一个根的精度损失很大一部分。<sup>[6](https://www.mycplus.com/programming/solve-the-quadratic-equation-using-c/)</sup>

**稳定的替代方案。** 标准的补救方法与威廉·卡汉（William Kahan）相关，他是加州大学伯克利分校数学荣休教授、1989年ACM图灵奖得主。该方法先计算不发生抵消的那个根，使用 \( q = -\frac{1}{2}\left(b + \operatorname{sign}(b)\sqrt{D}\right) \) 使 \( b \) 与根式始终相加而非相减，然后由 \( x_{1} \cdot x_{2} = c/a \) 得到另一个根。<sup>[16](https://www.daniweb.com/programming/software-development/threads/484304/quadratic-equation)</sup><sup> • </sup><sup>[17](https://www.worldprogramming.org/posts/the-quadratic-formula-is-algebraically-right-and-numerically-fragile-wdwulf)</sup> 卡汉本人的笔记将求解二次方程视为一个案例，说明当无法获得比数据更精确的算术时，计算成本会如何膨胀，并表明除非以更宽的浮点格式累加判别式，否则即使采用双精度，接近重合的根也可能损失算术所携带的约一半有效数字。<sup>[18](https://people.eecs.berkeley.edu/~wkahan/Qdrtcs.pdf)</sup>

该问题也有理论极限。马斯特罗纳尔迪（Mastronardi）和范多伦（Van Dooren）证明，\( ax^{2} + bx + c = 0 \) 的根可以按逐元素混合稳定的方式计算，这一性质强于范数意义下的后向稳定性但弱于逐元素后向稳定性，并且没有任何方法能在逐元素后向稳定的意义下计算这些根。<sup>[19](https://arxiv.org/abs/1409.8072)</sup>

## 教学与学习

二次方程是中学代数的固定内容，其教学方式因课程而异：韩国教科书比美国教科书更早开始这一主题，瑞典教科书比波兰教科书更少关注因式分解而更多关注二次公式，香港课程总共用19小时通过因式分解、作图和二次公式求解二次方程。<sup>[20](https://link.springer.com/article/10.1007/s10649-026-10493-6)</sup> 一项对实证研究的系统综述报告了一个建议：在官方课程和教科书中使用一般二次公式而非仅使用简化公式，可能提高学生求解二次方程的能力。<sup>[20](https://link.springer.com/article/10.1007/s10649-026-10493-6)</sup> 一些教师对记忆持相反观点：犹他大学的讲义认为，理解配方并从头求解更高效、更不易出错，因为记忆的公式可能在不利的时刻失效。<sup>[1](https://www.math.utah.edu/online/1010/formula/)</sup>

## References

1. [Math 1010 on-line: The Quadratic Formula, University of Utah](https://www.math.utah.edu/online/1010/formula/)
2. [2.5 Quadratic Equations, College Algebra 2e, OpenStax](https://openstax.org/books/college-algebra-2e/pages/2-5-quadratic-equations)
3. [Algebra: Quadratic Equations, Part II, Paul's Online Math Notes, Lamar University](https://tutorial.math.lamar.edu/classes/alg/solvequadraticeqnsii.aspx)
4. [Completing the Square, Feature Column, American Mathematical Society (Tony Phillips, Stony Brook University)](https://mathvoices.ams.org/featurecolumn/2020/11/01/fc-2020-10-2/)
5. [Numerical Methods for Computational Science and Engineering, ETH Zürich lecture notes](https://metaphor.ethz.ch/x/2018/hs/401-0663-00L/NCSE18.pdf)
6. [Quadratic Equation Solver in C++, C, C#, Java & Python, MyCPlus](https://www.mycplus.com/programming/solve-the-quadratic-equation-using-c/)
7. [Chapter 2: Quadratic Equations in Engineering, Introductory Mathematics for Engineering Applications (Rattan & Klingbeil, Wiley, 2014), O'Reilly](https://www.oreilly.com/library/view/introductory-mathematics-for/9781118141809/Text/chap002.xhtml)
8. [Unit 10.4 Practical Applications of Quadratic Equations, ESET1140: Intermediate Technical Algebra](https://isu.pressbooks.pub/eset1140/chapter/unit-10-4-practical-applications-of-quadratic-equations/)
9. [Applications With Quadratics: Projectiles, College Algebra Foundations, Lumen Learning](https://courses.lumenlearning.com/aacc-collegealgebrafoundations/chapter/read-projectiles/)
10. [3.4 Projectile Motion, College Physics 2e, OpenStax](https://openstax.org/books/college-physics-2e/pages/3-4-projectile-motion)
11. [Babylonian mathematics, MacTutor History of Mathematics, University of St Andrews](https://mathshistory.st-andrews.ac.uk//HistTopics/Babylonian_mathematics/)
12. [Quadratic etc equations, MacTutor History of Mathematics, University of St Andrews](https://mathshistory.st-andrews.ac.uk//HistTopics/Quadratic_etc_equations/)
13. [Jöran Friberg, Geometric division problems, quadratic equations, and recursive geometric algorithms in Mesopotamian mathematics, Archive for History of Exact Sciences](https://research.chalmers.se/en/publication/193131)
14. [Historical Background: Al-Khwarizmi (2010 course paper, Utrecht University)](https://webspace.science.uu.nl/~wepst101/wisl901/goodpractices/2010-Khwarizmi.pdf)
15. [Numerically Stable Method for Solving Quadratic Equations, B. K. P. Horn, MIT CSAIL](https://people.csail.mit.edu/bkph/articles/Quadratics.pdf)
16. [Quadratic equation (numerically stable Kahan scheme), DaniWeb programming forum](https://www.daniweb.com/programming/software-development/threads/484304/quadratic-equation)
17. [The Quadratic Formula Is Algebraically Right—and Numerically Fragile, World Programming](https://www.worldprogramming.org/posts/the-quadratic-formula-is-algebraically-right-and-numerically-fragile-wdwulf)
18. [W. Kahan, On the Cost of Floating-Point Computation Without Extra-Precise Arithmetic (Qdrtcs), UC Berkeley](https://people.eecs.berkeley.edu/~wkahan/Qdrtcs.pdf)
19. [Nicola Mastronardi and Paul Van Dooren, Revisiting the stability of computing the roots of a quadratic polynomial, arXiv:1409.8072](https://arxiv.org/abs/1409.8072)
20. [Empirical findings on the teaching and learning of quadratic equations: a systematic review, Educational Studies in Mathematics, Springer](https://link.springer.com/article/10.1007/s10649-026-10493-6)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; 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/quadratic-formula

English original: https://www.edgepedia.org/quadratic-formula
