f {\displaystyle f\,} is a cubic, so must be of the form f ( x ) = a x 3 + b x 2 + c x + d {\displaystyle f(x)=ax^{3}+bx^{2}+cx+d\,} .
Therefore, f ( 0 ) = d = 0 {\displaystyle f(0)=d=0\,} , so now f ( x ) = a x 3 + b x 2 + c x {\displaystyle f(x)=ax^{3}+bx^{2}+cx\,}
Looking at other values:
f ( 1 ) = a + b + c = 6 {\displaystyle f(1)=a+b+c=6\,}
f ( − 1 ) = − a + b − c = 0 {\displaystyle f(-1)=-a+b-c=0\,}
f ( 2 ) = 8 a + 4 b + 2 c = 0 {\displaystyle f(2)=8a+4b+2c=0\,}
Try to solve simulatenously:
( a + b + c ) + ( − a + b − c ) = 6 {\displaystyle (a+b+c)+(-a+b-c)=6\,}
2 b = 6 {\displaystyle 2b=6\,} , thus b = 3 {\displaystyle b=3\,} .
( a + b + c ) − ( − a + b − c ) = 6 {\displaystyle (a+b+c)-(-a+b-c)=6\,}
2 a + 2 c = 6 {\displaystyle 2a+2c=6\,} , thus a + c = 3 {\displaystyle a+c=3\,} .
Thus,
a + c = 3 {\displaystyle a+c=3\,}
8 a + 2 c = − 12 {\displaystyle 8a+2c=-12\,}
Solve simultaneous equation:
( 2 a + 2 c ) − ( 8 a + 2 c ) = 18 {\displaystyle (2a+2c)-(8a+2c)=18\,}
− 6 a = 18 {\displaystyle -6a=18\,} therefore a = − 3 {\displaystyle a=-3\,} .
If b = 3 , a = − 3 {\displaystyle b=3,a=-3\,} then:
f ( 1 ) = − 3 + 3 + c = 6 {\displaystyle f(1)=-3+3+c=6\,} , thus c = 6 {\displaystyle c=6\,} .
Therefore, we have a = − 3 , b = 3 , c = 6 {\displaystyle a=-3,b=3,c=6\,} and our function is given by f ( x ) = − 3 x 3 + 3 x 2 + 6 x {\displaystyle f(x)=-3x^{3}+3x^{2}+6x\,} .