Beginner

数值导数计算器

使用简单且精确的数值公式估算函数在任意点处的瞬时斜率。

Function f(x)

Pick a standard function
Evaluate the slope here
Small step for the difference quotient
Derivative f'(a)
4

Estimated slope of the tangent line at a

f(a)
4
Tangent slope
4
a
Step by step
  1. 1

    f(a)

    f(2) = 4
  2. 2

    f(a + h)

    f(2 + 0.00001) = 4.00004
  3. 3

    f(a − h)

    f(2 − 0.00001) = 3.99996
  4. 4

    Numerator f(a+h) − f(a−h)

    4.00004 − 3.99996 = 0.00008
  5. 5

    Derivative f'(a) = numerator ÷ (2h)

    0.00008 ÷ (2 × 0.00001) = 4
    Central difference: averaging forward and backward slopes cancels the leading error term.
结果仅为一般参考性的估算,并非专业建议——在依赖这些重要结果之前,请务必自行独立核实。 阅读完整免责声明.
快速解答

这个计算器是如何工作的?

本工具使用中心差分公式 f'(a) ≈ (f(a+h) − f(a−h)) / (2h) 估算函数在点 a 处的导数。选择函数、点和微小步长 h(默认 1e-5),返回切线斜率,精度为 h² 阶,无需符号微积分。

公式
f'(a) ≈ (f(a + h) − f(a − h)) / (2h)
How this is calculated

从列表中选择函数 f,输入要求斜率的点 a 和小步长 h。计算器在 a+h 和 a−h 处求函数值,然后应用中心差分公式 f'(a) ≈ (f(a+h) − f(a−h)) / (2h)。这平均了前向和后向斜率,消去了一阶误差项,使估计精度达到 h² 阶,远优于单侧差分。

中心差分无需符号代数:它只对函数采样。取 h ≈ 1e-5 可在截断误差(h 过大)和浮点舍入误差(h 过小)之间取得平衡。对于光滑函数,这通常能给出 6 位或更多的正确位数。结果是在 x = a 处 y = f(x) 切线的估计斜率。

假设条件:f 必须在 a、a+h 和 a−h 处有定义且有限。对于 ln x 和 sqrt x,点 a 必须为正数;对于 1/x,a 必须非零。在奇点、折点或极陡区域附近,由于函数在采样区间内不再光滑,估计值会变差。

常见问题

中心差分 (f(a+h) − f(a−h)) / (2h) 精度为 h² 阶,而前向差分 (f(a+h) − f(a)) / h 仅为 h 阶。在相同步长下,中心差分公式能给出更多正确位数。

对于大多数光滑函数,约 1e-5 效果很好。步长太大会增大近似误差;步长太小则浮点舍入误差占主导。若结果看起来有噪声,可尝试适当增大 h。

这些函数在其定义域之外无定义。ln x 和 sqrt x 要求 a > 0,1/x 要求 a ≠ 0。采样点 a±h 也必须在定义域内。

也称为

导数计算
数值导数
某点斜率
求导计算
瞬时斜率
数值求导

APA

TG we-Calculate Editorial Team. (2026). 数值导数计算器 [Online calculator]. TG we-Calculate. https://we-calculate.com/zh/calculator/numerical-derivative-calculator

Chicago

TG we-Calculate Editorial Team. "数值导数计算器." TG we-Calculate. 2026. https://we-calculate.com/zh/calculator/numerical-derivative-calculator.

IEEE

TG we-Calculate Editorial Team, "数值导数计算器," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/zh/calculator/numerical-derivative-calculator

BibTeX

@misc{wecalculate_numerical_derivative_calculator, title = {数值导数计算器}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/zh/calculator/numerical-derivative-calculator}}, year = {2026}, note = {TG we-Calculate} }

这个计算器对您有帮助吗?