透過 MCP 連接 →

輸入計算

數學公式

廣告

結果

f(x) evaluated at x = 4
6
f(a) 計算結果
a·x² 平方項 16
b·x 一次項 -12
c(常數項) 2

什麼是函數求值?

所謂函數求值,就是針對某個特定的輸入值,求出函數對應的輸出。假設你有一個函數 f(x),想知道它在 x = a 時的值,只要把每一個 x 都換成 a,再計算即可。符號 f(a) 唸作「f of a」,代表的正是這個輸出值。本計算機處理最常見的二次式 \(f(x) = ax^{2} + bx + c\),同時也涵蓋一次函數(令 \(a = 0\))與常數函數(令 \(a = 0\)、\(b = 0\))這兩種特例。

Function machine taking input x and producing output f(x)
Function evaluation: an input value x goes into the function and a single output f(x) comes out.

如何使用這個計算機

請輸入函數的三個係數:a(x² 的係數)、b(x 的係數)以及 c(常數項)。接著輸入你想求值的 x 值,計算機就會回傳 f(x) 的結果,並逐項拆解,讓你清楚看到答案是怎麼一步步算出來的。

公式說明

函數為 $$f(x) = ax^{2} + bx + c$$ 要在 \(x = a\) 時求值,計算機會分別算出三個部分:平方項 \(a \cdot x^{2}\)、一次項 \(b \cdot x\),以及常數 \(c\),再把它們相加。由於乘法的運算順序在加法之前,因此每一項都會先各自算出,最後才加總起來。

Advertisement
Quadratic formula broken into three colored terms: a x squared, b x, and c
The three contributions to f(x): the squared term ax², the linear term bx, and the constant c.

範例演練

假設 \(f(x) = x^{2} - 3x + 2\),而你想求 \(f(4)\)。將 \(x = 4\) 代入:平方項為 \(1 \cdot (4^{2}) = 16\),一次項為 \(-3 \cdot 4 = -12\),常數則是 \(2\)。相加後得到 $$16 - 12 + 2 = 6$$ 所以 \(f(4) = 6\)。

Advertisement
Point plotted on an upward parabola curve at evaluated x value
Evaluating f(a) gives the y-coordinate of the point on the parabola at x = a.

常見問題

可以用來計算一次函數嗎?可以——只要令 \(a = 0\),函數就會變成 \(f(x) = bx + c\)。

那常數函數呢?令 \(a = 0\)、\(b = 0\),函數對任何輸入都會等於 \(f(x) = c\)。

能處理負數或小數嗎?可以,所有係數與 x 的值都能是負數或帶有小數。

最後更新: