令f(x)滿足:f(1)=1/2;f(2)=1/4;f(3)=1/4;得f(x)。從而得f(4)。
方法之一:令f(x)是一個二次函數。
f(x) = a*x^2 + b*x + c
用係數待定法求a,b,c
f(1) = a + b + c = 1/2 ----------------------(1)
f(2) = 4a + 2b + c = 1/4 ---------------------(2)
f(3) = 9a + 3b + c = 1/4 ---------------------(3)
(3)-(2)
5a + b = 0 ---------------------------(4)
(2)-(1)
3a + b = -1/4 ------------------------(5)
(4)-(5)
2a = 1/4
a = 1/8
將a值代入(5)得
b = -5/8
將a,b值代入(1)得
c = 1/2 - 1/8 + 5/8 = 1
將a,b,c 值代入f(x)得
f(x)= 1/8*x^2 - 5/8*x + 1
令x = 4
f(4)= 1/8*16 - 5/8*4 + 1 = 2 - 5/2 + 1 = 1/2