We have the following system
a(1) + b(1) + 2 = 5
a(2) + b(2) + 2 = 8 simplify
a + b = 3
2a + 2b = 6 → a + b = 3
Since we have two equal equations, we have infinite answers for a and b
For instance...if a = 1, then b = 2
And our function becomes
f(x) = x + 2x + 2 = 3x + 2
Then f(3) = 3(3) + 2 = 11
Maybe you meant that f(x) = ax^2 + bx + c ???