# Solve for f(x) given various x, f(x) correspondences

I have a real-world problem.

Let $$x$$ = cost of goods

Let $$f(x)$$ be profit as a function of $$x$$.

I want to know the expression/solution for $$f(x)$$ such that:

$$f(250) = 30$$

$$f(500) = 40$$

$$f(1000) = 50$$

$$f(2000) = 70$$

$$f(5000) = 200$$

$$f(10,000) = 300$$

Is it possible to solve the expression/solution for $$f(x)$$? What's the answer? Show working out, please.

Now, I don't actually want a function that is too complicated or qualified such as a polynomial with too many terms. So even better as a solution, I want the simplest recognizable common function that would approximate this function.

• Given functional values at a finite number of points, infinitely many functions pass through them. – The Long Night Nov 3 '18 at 11:30
• That's a good point. I'm not a mathematically fluent, but intuitively I think what I'm after is the most parsimonious function, the best fit, minimizing deviation, the tightest fit. Does that make sense? – ptrcao Nov 3 '18 at 11:32

$$f(x) = 13.68244 + 0.08149843\cdot x - 0.00007274243\cdot x^2 + 3.263991e-8\cdot x^3 - 5.354894e-12\cdot x^4 + 2.765461e-16\cdot x^5$$
$$= (-16)\cdot x^5 + (-12) \cdot x^4 + (-8) \cot x^3 + (-0.00007274243) \cdot x^2 + 0.08149843 \cdot x + (13.68244 - 5.354894 \cdot e)$$
If you want an even simpler function, you could use the cubic, $$f(x) = (-10) \cdot x^3 + 0.000009219122 \cdot x^2+ 0.004897218 \cdot x + ( 32.39645 - 7.032359 \cdot e)$$, but it will be less accurate.