We can solve this with the following system
 
a(2)^2  + b(2) + c = 23
a(4)^2 + b(4) + c = 55
a(10)^2 + b(10) + c  = 247      simplifying, we have
 
4a + 2b + c  = 23            (1)
16a + 4b + c = 55           (2)
100a + 10b + c   = 247     (3)
 
Subtract (1) from (2)    and  (2) from (3)    ...and we get the following system
 
12a + 2b  =   32
84a + 6b  =  192       these simplify to
 
6a + b = 16    →    b =  16 - 6a    (4)
28a + 2b  = 64        (5)
 
Substitute   (4) into (5)
 
28a + 2[16 - 6a] = 64   simplify
28a + 32 - 12a  = 64
16a + 32 = 64    subtract 32 from both sides
16a  = 32      divide both sides by 16
a = 2
 
And using (4)  .....
  b =  16 - 6(2)  = 16 - 12  = 4
 
 
And using (1) ......
4(2) + 2(4) + c = 23
8 + 8 + c = 23
16 + c = 23
So    c  = 7
 
And our cost function is :
 
c(x)  = 2x^2 + 4x + 7       and the cost to produce 8 widgets is
c(8)  = 2(8)^2 + 4(8) + 7   =   2*64 + 32 + 7  =  128 + 39  = $ 167