Explanation:
a cubic function (that means its degree or highest exponent of x is 3) looks like :
y = ax³ + bx² + cx + d
we have 4 variables (a, b, c, d) to solve.
that means we need 4 equations with them.
we do this by using coordinates of the 4 given points. each point then gives us a needed equation :
(0, -8)
-8 = a×0³ + b×0² + c×0 + d = d
so, d = -8
(1, 0)
0 = a×1³ + b×1² + c×1 - 8 = a + b + c - 8
(2, 0)
0 = a×2³ + b×2² + c×2 - 8 = 8a + 4b + 2c - 8
(4, 0)
0 = a×4³ + b×4² + c×4 - 8 = 64a + 16b + 4c - 8
so, we have these remaining 3 equations with 3 remaining variables:
1. 0 = a + b + c - 8
2. 0 = 8a + 4b + 2c - 8
3. 0 = 64a + 16b + 4c - 8
let's multiply 1. by 8 and then subtract 2. from that result :
0 = 8a + 8b + 8c - 64
- 0 = 8a + 4b + 2c - 8
‐---------------‐--------------------
0 = 0 + 4b + 6c - 56
1a. 56 = 4b + 6c
28 = 2b + 3c
28 - 3c = 2b
b = (28 - 3c)/2
now, we do the same thing with 2. and 3. :
0 = 64a + 32b + 16c - 64
- 0 = 64a + 16b + 4c - 8
----------------------------------------
0 = 0 + 16b + 12c - 56
2a. 56 = 16b + 12c
14 = 4b + 3c
14 - 3c = 4b
b = (14 - 3c)/4
1a. and 2a. describe now the same value b :
(28 - 3c)/2 = (14 - 3c)/4
4×(28 - 3c)/2 = (14 - 3c)
2×(28 - 3c) = 14 - 3c
56 - 6c = 14 - 3c
42 - 6c = - 3c
42 = 3c
c = 42/3 = 14
b = (28 - 3c)/2 = (28 - 3×14)/2 = (28 - 42)/2 = -14/2 = -7
now we pick one of the original equations to get a (1. is the easiest) :
0 = a + b + c - 8
8 = a + -7 + 14 = a + 7
a = 8 - 7 = 1
the cubic function is
y = x³ - 7x² + 14x - 8