Using the polynomial of lowest order that interpolates $f(x)$ at $x_1$ and $x_2$, derive a numerical integration formula for $\int_{x_0}^{x_3}f(x)dx$.

153 Views Asked by At

Using the polynomial of lowest order that interpolates $f(x)$ at $x_1$ and $x_2$, derive a numerical integration formula for $\int_{x_0}^{x_3}f(x)dx$.

I know that we aren't assuming uniform spacing. We know that $x_0<x_1<x_2<x_3$. I think a linear equation will be the way to go. I'm not sure how to do this. Any solutions/hints are greatly appreciated.

1

There are 1 best solutions below

0
On

As you wrote in a comment, the polynomial to use is $$p(x)=y_1+\frac{y_2-y_1}{x_2-x_1}(x-x_1),\quad y_i=f(x_i)$$ Plug this into $\int_{x_0}^{x_3}p(x)dx$ to get $$y_1(x_3-x_0)+\frac{y_2-y_1}{x_2-x_1}\frac{(x_3-x_1)^2-(x_0-x_1)^2}{2}$$ which is the required approximation to the integral of $f$.


In the special case $x_1=x_0$ and $x_2=x_3$ this simplifies to $$ \frac{y_1+y_2}{2}(x_3-x_0) $$ which is the Trapezoidal rule.