Re-write your equation in the form
f(x+1) = f(x) - 3x^2.
This equation allows you to move one step forward and calculate f(x+1), as soon as you know x and f(x).
This formula is recursive and allows you to move as far in x-axis as you want.