Question 25017
Hi,

I'm guessing that you want a polynomial (or at least continuous) function from the reals to the reals that goes through those data points. If you don't then please write back and explain exactly what you're after.

There are many different ways to do this, but my favourite is Lagrange interpolation, so let's do that. For ease let's call the data points *[tex x_i] and *[tex y_i] where *[tex i] ranges from 1 to 4.

Imagine that we can make four functions *[tex h_i(x)] that are one when *[tex x=x_i] and zero when *[tex x=x_j, j\neq i]. By multiplying these *[tex h] functions by *[tex y_i] We have four functions, each correct at one data point and the others are zero at that datapoint, add them up and we're done!

You may worry that this won't produce the same answer as other methods, but there is a very simple proof by contradiction to show any interpolating polynomial of degree *[tex n-1] given *[tex n] data points will be the same.

So the problem comes down to trying to figure out these *[tex h] functions. Luckily they're quite easy to make. Let's try and make *[tex h_2(x)]. The first thing we need to do is to make it zero at *[tex x_1], *[tex x_3], and *[tex x_4]. Hopefully you can see the obvious choice of *[tex (x-x_1)(x-x_3)(x-x_4)]. The second property we need to worry about is that the function needs to be one at *[tex x_2]. Our current function evaluates to *[tex (x_2-x_1)(x_2-x_3)(x_2-x_4)] when *[tex x=x_2] so if we divide by that we're done.

*[tex h_2(x)=\frac{(x-x_1)(x-x_3)(x-x_4)}{(x_2-x_1)(x_2-x_3)(x_2-x_4)}]

Subbing the numbers in gives 

*[tex h_2(x)=\frac{(x-1)(x-3)(x-4)}{2}]

Hopefully you get the idea and can construct the other *[tex h] functions in a similar way. My answers are:

*[tex h_1(x)=\frac{(x-2)(x-3)(x-4)}{-6}]

*[tex h_3(x)=\frac{(x-1)(x-2)(x-4)}{-2}]

*[tex h_4(x)=\frac{(x-1)(x-2)(x-3)}{6}]

Now all you have to do is multiply by *[tex y_i] and add everything up. A persom smarter than me would have read the question and realise that you don't need *[tex h_2] because you're going to multiply it by zero, but never mind :)

This should give the final answer as (with a bit of adding and factoring)

*[tex f(x)=\frac{(2-x)}{2}((x-3)(x-4) + 3(x-1)(x-4) + 2(x-1)(x-3))]

Don't forget to check it works, and you may need to write in the standard form of a cubic.

Hope that helps

Kev