Think about "UNderiving".

To get 3x^2, you needed to start with an x^3 f(x) = x^3, f '(x) = 3x^2

To get 2, you needed to start with 2x f(x) = 2x f '(x) = 2

We always put in a constant, C, because if you started with f(x) = C, f '(x) would be 0 and it would not be seen in the derivative.

So: f(x) = x^3 + 2x + C

And to find the constant, if there was one, plug in the initial conditions that when x=2, y=5

f(2) = 2^3 + 2(2) + C = 5

8 + 4 + C = 5 or C = -7

FINAL ANSWER: f(x) = x^{3} + 2x - 7

check: find f '(x) and see if it is 3x^2 + 2, and be sure that f(2) = 5