设 f(x) = ax^2 + bx + c
则:f(x+1) = a(x+1)^2 + b(x+1) + c = ax^2 + (2a+b)x + (a+b+c)
f(x-1) = a(x-1)^2 + b(x-1) + c = ax^2 + (-2a+b)x + (a-b+c)
所以:
f(x+1) + f(x-1) = 2ax^2 + 2bx + 2(a+c)
= 2x^2 - 4x
对比系数,得:
2a = 2
2b = -4
2(a+c) = 0
解得:a = 1 ,b = -2 ,c = -1
所以:
f(x) = x^2 - 2x - 1