# Polynomial interpolation

Let $P=[a,b]\times (c,d)$. Assume that we have given $n$ points $(x_1,y_1),...,(x_n,y_n)\in P$, such that $x_i\neq x_j$ for $i\neq j$; $i,j=1,...,n$. Does there exist a polynomial $f$ such that $f(x_i)=y_i$ for $i=1,...,n$ and $c<f(x)<d$ for $x \in [a,b]$?

-
I think you mean $f(x_i)=y_i$, and I think you need the $x_i$ to be distinct. – Gerry Myerson Feb 18 '12 at 21:59
and $\forall i\ c<y_i < d$ – yohBS Feb 18 '12 at 22:04
All points are from $P$, in particular $c<y_i<d$. – Richard Feb 18 '12 at 22:06

Of course, Lagrange interpolation will give you a polynomial going through all the points, but with no guarantee of obeying the bounds. But I think there's a stronger form of interpolation that lets you get local maxima or minima at the interpolation points (see Hermite interpolation at, e.g., http://en.wikipedia.org/wiki/Hermite_interpolation), and I think that can solve the problem. For each $i$, if $y_i$ is bigger than both $y_{i-1}$ and $y_{i+1}$, make the polynomial have a local maximum at $x_i$; if $y_i$ is smaller than both $y_{i-1}$ and $y_{i+1}$, make the polynomial have a local minimum at $x_i$. To avoid bad behavior left of $x_1$ and right of $x_n$, add, say, a local maximum at $(a,d)$ and a local minimum at $(b,c)$.