---
# System prepended metadata

title: Numerical Analysis HW3
tags: [Numerical Analysis]

---

# Numerical Analysis HW3
###### tags: `Numerical Analysis`
## Q1 
We know that the tuncation error of forward difference formula to approximate $f'(x)$ is of $O(h)$ with step size $h$.
$$
\tau_h = \left[\frac{f(x+h)-f(x)}{h}\right]-f'(x) = \frac{f''(\xi)}{2}h = O(h)
$$
Please derive the formulas of $f'(x)$ with the given order of truncation error. 
    $O(h^2), O(h^3), O(h^4)$
    **[hint]** for $O(h^3), O(h^4)$ you may use extrapolation method. 

先推出二階 $\rightarrow$ 四階 (外插)
利用一階 $\rightarrow$ 三階 (外插)

---

## Q2
Please determine the precision of Trapezoidal Rule and Simpson Rule.
決定性因素在最後的誤差，如果誤差項有2階微分，代表1階精度 $(x)'' = 0$

---
## Q3 
Please derive the Simpson's Three-Eights rule.

**[hint]**
p.196 Newton Cotes formula

---
## Q4
Find the constants $c_0, c_1, x_1$ such that the quadrature formula has the highest possible degree of precision.
$$
\displaystyle \int_0^1 f(x)dx = c_0f(0)+ c_1f(x_1)
$$

**[hint]** 給兩個點，考慮插值多項式

---
## Q5
1. Please derive the first few Legendre polynomials:
   $P_0, P_1, P_2, P_3, P_4$
2. Please evaluate $\displaystyle\int_{-1}^1 x^5+x^2+1 dx$

p.231 thm 4.7

---
## Q6
Please show that the quadurate formula $Q(P) = \displaystyle\sum_{i=1}^nc_iP(x_i)$ cannot have degree of precision greator than $2n-1$, regardless of choice of $c_1\cdots c_n, x_0\cdots x_n$.

假設有deg = 2n，各個點都是平方次方，討論$Q(P) >0? <0?$


---
## Q7
Use the method of undetermined coefficients to set up the 5 × 5 Vandermonde system
that would determine a fourth-order accurate finite difference approximation to $u''(x)$
based on 5 equally spaced points
$$
u''(x) = c_{−2}u(x − 2h) + c_{−1}u(x − h) + c_0u(x) + c_1u(x + h) + c_2u(x + 2h) + O(h^4)
$$
每個去泰勒展開，然後解方程式。

---
## Trick or Treat
[萬聖節禮包](https://weblis.lib.ncku.edu.tw/search~S1*cht/X?searchtype=X&searcharg=isaacson+and+keller+analysis+of+numerical+methods+&searchscope=1) 
**[Isaacson & 	Keller]** Analysis of Numericl methods p.308 Newton Cotes formula

$\lipsum[5]$