First put all the points (x,y) in order of the x value:
-2 89
-1 47
0 7
1 -20
2 -40
5 -50
6 -40
7 -20
8 10
9 46
When x=0 y=7, so the constant term in the function is 7 (y intercept).
There's a minimum (turning point) near x=5 because the values of y for x=2 and 6 (-40) are more positive than -50.
The gradient (dy/dx) gets positively steeper as x increases after x=5, and negatively steeper between x=-2 and +2.
The degree of the polynomial is even because the function is positive for larger magnitude positive and negative values of x. The zeroes are between x=0 and 1 and between x=7 and 8.
The function can be split into two parts: (1) y for -2<x<2 and (2) y for 5<x<9 where there are 5 function values each. By examining "differentials" progressively for each part we get: y' {-42 -40 -27 -20} from {47-89 7-47 -20-7 -40-(-20)} for part (1) and {10 20 30 36} from {-40-(-50) -20-(-40) 10-(-20) 46-10} for part (2). The next differential y" is {2 13 7} for part (1) and {10 10 6} for part (2). The third differential y'" is {11 -6} for part (1) and {0 -4} for part (2). The last differential y"" is -16 for part (1) and -4 for part (2). There is no further data to deduce more differentials.
For each part of the function we can work out a fitting polynomial. This has to be degree 4 because we reached the 4th derivative. Part (1) first: y=Ax^4+Bx^3+Cx^2+Dx+7 (7 is the y intercept). By substituting values for x we can work out the constants A to D:
a. x=-2: 16A-8B+4C-2D+7=89; 16A-8B+4C-2D=82
b. x=2: 16A+8B+4C+2D+7=-40; 16A+8B+4C+2D=-47
c. x=-1: A-B+C-D=40
d. x=1: A+B+C+D=-27
Add equations a and b: e. 32A+8C=35. c+d: f. 2A+2C=13
e-4f: 24A=-17, A=-17/24. C=(13-2A)/2=(156+17)/24=173/24.
b-a: g. 16B+4D=-129. d-c: h. 2B+2D=-67
g-2h: 12B=5, B=5/12. D=(-67-2B)/2=-(402+5)/12=-407/12
So part (1) y=-17x^4/24+5x^3/12+173x^2/24-407x/12+7 or 24y=-17x^4+10x^3+173x^2-814x+168.
This equation fits all the points in part (1).
To find a similar equation for part (2) we weight the values of x by using the central value of 7, to make calculations simpler, so we have y=A(x-7)^4+B(x-7)^3+C(x-7)^2+D(x-7)-20. -20 is the y value when x=7.
To simplify the expressions we'll put X=x-7 and solve for new A to D using X between -2 and +2 (x between 5 and 9). We'll call the equations a to h as we did before but these are new equations.
a. X=-2: 16A-8B+4C-2D-20=-50; 16A-8B+4C-2D=-30
b. X=2: 16A+8B+4C+2D-20=46; 16A+8B+4C+2D=66
c. X=-1: A-B+C-D=-20
d. X=1: A+B+C+D=30
Add equations a and b: e. 32A+8C=36. c+d: f. 2A+2C=10 (A+C=5)
e-4f: 24A=-4, A=-1/6, C=31/6
b-a: g. 16B+4D=96. d-c: h. 2B+2D=50 (B+D=25)
g-2h: 12B=-4, B=-1/3, D=76/3
So part (2) y=-X^4/6-X^3/3+31X^2/6+76X/3-20 or 6y=-X^4-2X^3+31X^2+152X-120, or
6y=-(x-7)^4-2(x-7)^3+31(x-7)^2+152(x-7)-120.
So f(x)=(-17x^4+10x^3+173x^2-814x+168)/24 [-2<x<2]
f(x)=(-(x-7)^4-2(x-7)^3+31(x-7)^2+152(x-7)-120)/6 [5<x<9]
or f(x)=(-x^4+26x^3-221x^2+796x-1380)/6 [5<x<9]
This is a piecewise solution that fits all the points. The function remains undefined between x=2 and 5. The zeroes are 0.2164 and 7.6965.