Riemann surface
matlab

Problem 19. Consider the points $\left{x_0=\frac{\pi}{2}, x_1=\frac{3 \pi}{4}\right}$ in $[0, \pi]$. What should $\left{A_0, A_1\right}$ be so that the estimate $\int_0^\pi f(x) d x \approx A_0 \cdot f\left(x_0\right)+A_1 \cdot f\left(x_1\right)$ is exact for $f(x)$ all polynomials of degree $k \leq 1$ ?

.

Solution. Let let $f(x)$ be a function on $[0, \pi]$. Then the estimate will be $\int_0^\pi p(x) d x$ where $p(x)$ is the Lagrange polynomial which is $f\left(\frac{\pi}{2}\right)$ at $\frac{\pi}{2}$ and $f\left(\frac{3 \pi}{4}\right)$ at $\frac{3 \pi}{4}$. Now $p(x)=f\left(\frac{\pi}{2}\right) \cdot p_0(x)+f\left(\frac{3 \pi}{4}\right) \cdot p_1(x)$ where $p_0(x)=\frac{\left(x-\frac{3 \pi}{4}\right)}{\left(\frac{\pi}{2}-\frac{3 \pi}{4}\right)}$ and $p_1(x)=\frac{\left(x-\frac{\pi}{2}\right)}{\left(\frac{3 \pi}{4}-\frac{\pi}{2}\right)}$. Now $\int_0^\pi p(x) d x=\int_0^\pi\left(f\left(\frac{\pi}{2}\right) \cdot p_0(x)+f\left(\frac{3 \pi}{4}\right) \cdot p_1(x)\right) d x$. This shows that $A_0=\int_0^\pi p_0(x) d x$ and $A_1=\int_0^\pi p_1(x) d x$. Thus, $A_0=\pi$ and $A_1=0$.

Problem 21. Determine the coefficients to compute the first derivative of $f(x)=\sin \left(x^2\right)$ at $a=2$ using the points ${a-2 h, a-h, a, a+h, a+2 h}$. Give the estimate of the derivative as a function of $h$. Determine the best value of $h$ for the greatest accuracy of the answer. How many digits accuracy can you expect with this choice of $h$ ?

E-mail: help-assignment@gmail.com  微信:shuxuejun

help-assignment™是一个服务全球中国留学生的专业代写公司