# Constructing Polynomials

1. Aug 22, 2009

### Bleys

There's a question in Calculus by Spivak about polynomials and I was wondering about how to construct them to have specific roots or values at certain points. For example it says if
$$x_{1}$$, ..., $$x_{n}$$ are distinct numbers, find a polynomial $$f_{i}$$ such that it's of degree n-1 which is 1 at $$x_{i}$$ and 0 at $$x_{j}$$ for $$j \neq i$$. Now I know that for roots it's simply the product $$\prod (x-x_{j})$$ running from j=1 to n and $$j \neq i$$. That evaluates the polynomial to 0 correctly. But I don't know how to add the additional condition of $$x_{i}$$ to make it evaluate to 1. I know I can't multiply another factor $$(x-x_{k})$$ because that would increase the degree to n and it wouldn't do any good anyway. Is it a piecewise defined function? That seems a little too trivial. Any hints you could give me?

2. Aug 22, 2009

### boboYO

hehe i remember doing this question a few months ago

What value does the polynomial you have at the moment take at x_i?

3. Aug 22, 2009

### HallsofIvy

Multiply that product by some number, a: $$a\prod_{j\ne i} (x-x_{j})$$.

Now you can choose a to make the value at $$x= x_i$$ 1. That is, you want $$a\prod (x_i-x_{j})= 1$$ so you must have $$a= \frac{1}{\prod (x_i- x_j)}$$.

That gives $$\frac{\prod (x- x_j)}{\prod (x_i- x_j)}$$

In fact, by adding things of that type, you can get a polynomial of degree n-1 that takes on specified values at n points- the "Lagrange Interpolation Polynomial".