Find the interpolating polynomial of $f$ at $x_0, x_1$ and use this to approximate $f\left(\frac{x_0+x_1}{2}\right)$

48 Views Asked by At

The following points are given $$(x_0,f(x_0))\;\;\;\; (x_1,f(x_1))$$

Find the interpolating polynomial of $f$ at $x_0,x_1$ and use this to approximate $f\left(\frac{x_0+x_1}{2}\right)$.


The interpolating polynomial is $$L\left(x\right)=\sum_{i=0}^{1}y_{i}l_{i}\left(x\right)=f(x_0)\frac{x-x_1}{x_0-x_1}+f(x_1)\frac{x-x_0}{x_1-x_0}$$

So $$f\left(\frac{x_0+x_1}{2}\right)≃L\left(\frac{x_0+x_1}{2}\right)=\frac{f(x_0)+f(x_1)}{2}=\frac{L(x_0)+L(x_1)}{2}$$

How much of my work is correct?

2

There are 2 best solutions below

0
On BEST ANSWER

All of your work is correct.

Here is an alternative way which requires little prerequisite knowledge: For $2$ points, the interpolating polynomial $L$ is the unique polynomial of degree $\leq 1$ such that $L(x_i)=f(x_i)$ for all $i\in \{0,1\}$ (by definition). Such can only be a straight line between the two points. Clearly, the slope of the line between the two points is $m=\frac{f(x_1)-f(x_0)}{x_1-x_0}$, and by using one of the points (plug into $L(x)=mx+c$ and solve for $c$) you arrive at the equation $$L(x)=\frac{f(x_1)-f(x_0)}{x_1-x_0}x+\frac{f(x_0)x_1-f(x_1)x_0}{x_1-x_0},$$ which is equivalent to the polynomial you have written. From geometric considerations, you obtain that $L\left(\frac{x_0+x_1}{2}\right)$ is the average of $f(x_0)$ and $f(x_1)$.

0
On

I would just add that, given enough regularity on $f$, namely if $f\in C^2$, you can estimate the error:

\begin{align*} \left|f\left(\frac{x_0+x_1}{2}\right)-\frac{f(x_0)+f(x_1)}{2} \right|=&\frac{|f''(\xi)|}{2}\left|(\frac{x_0+x_1}{2}-x_0)(\frac{x_0+x_1}{2}-x_1)\right|\\ \leq &\frac 12 \max |f''| \frac{(x_1-x_0)^2}{4} =\frac{\max |f''|}{8} (x_1-x_0)^2 \end{align*}

As a side note, I would avoid using $L(x)$ for the interpolating polynomial, as it may be easily confused with the Lagrange polynomials, commonly used in interpolation.