# 拉格朗日插值法

## 定義

$(x_0, y_0),\ldots,(x_k, y_k)$

$L(x) := \sum_{j=0}^{k} y_j \ell_j(x)$

$\ell_j(x) := \prod_{i=0,\, i\neq j}^{k} \frac{x-x_i}{x_j-x_i} = \frac{(x-x_0)}{(x_j-x_0)} \cdots \frac{(x-x_{j-1})}{(x_j-x_{j-1})} \frac{(x-x_{j+1})}{(x_j-x_{j+1})} \cdots \frac{(x-x_{k})}{(x_j-x_{k})}.$[3]

## 範例

• $f(4) = 10$
• $f(5) = 5.25$
• $f(6) = 1$

$\ell_0(x) = \frac{(x-5)(x-6)}{(4-5)(4-6)}$
$\ell_1(x) = \frac{(x-4)(x-6)}{(5-4)(5-6)}$
$\ell_2(x) = \frac{(x-4)(x-5)}{(6-4)(6-5)}$

$p(x) = f(4)\ell_0(x) + f(5)\ell_1(x) + f(6)\ell_2(x)$
$.\, \, \, \, \, \, \, \, \, \, = 10 \cdot \frac{(x-5)(x-6)}{(4-5)(4-6)} + 5.25 \cdot \frac{(x-4)(x-6)}{(5-4)(5-6)} + 1 \cdot \frac{(x-4)(x-5)}{(6-4)(6-5)}$
$.\, \, \, \, \, \, \, \, \, \, = \frac{1}{4}(x^2 - 28x + 136)$

## 證明

### 存在性

$L(x_j) = \sum_{i=0}^{k} y_i \ell_i(x_j) = 0 + 0 + \cdots + y_j + \cdots + 0 = y_j$

$(x-x_0) \cdots (x-x_{j-1})(x-x_{j+1}) \cdots (x-x_{k})$

$\ell_j(x) := \prod_{i=0,\, i\neq j}^{k} \frac{x-x_i}{x_j-x_i} = \frac{(x-x_0)}{(x_j-x_0)} \cdots \frac{(x-x_{j-1})}{(x_j-x_{j-1})} \frac{(x-x_{j+1})}{(x_j-x_{j+1})} \cdots \frac{(x-x_{k})}{(x_j-x_{k})}$

## 幾何性質

$P = \lambda_0 \ell_0 + \lambda_1 \ell_1 + \cdots + \lambda_n \ell_n = 0$

$\lambda_0 = \lambda_1 = \cdots = \lambda_n = 0$

## 重心拉格朗日插值法

$\ell(x) = (x - x_0)(x - x_1) \cdots (x - x_k)$

$\ell_j(x) = \frac{\ell(x)}{x-x_j} \frac{1}{\prod_{i=0,i \neq j}^k(x_j-x_i)}$

$w_j = \frac{1}{\prod_{i=0,i \neq j}^k(x_j-x_i)}$

$\ell_j(x) = \ell(x)\frac{w_j}{x-x_j}$

$L(x) = \ell(x) \sum_{j=0}^k \frac{w_j}{x-x_j}y_j \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (1)$

$\forall x, \, g(x) = \ell(x) \sum_{j=0}^k \frac{w_j}{x-x_j}$

$L(x) = \frac{\sum_{j=0}^k \frac{w_j}{x-x_j}y_j}{\sum_{j=0}^k \frac{w_j}{x-x_j}} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (2)$[7]

## 參考來源

1. ^ E. Waring. Problems Concerning Interpolations. Philosophical Transactions of the Royal Society of London. 1779, 69: 59–67.
2. ^ （英文）E. Meijering. A chronology of interpolation: From ancient astronomy to modern signal and image processing,. Proceedings of the IEEE: 323.
3. ^ （英文）Julius Orion Smith III. Lagrange_Interpolation. Center for Computer Research in Music and Acoustics (CCRMA), Stanford University.
4. ^ 馮有前，《數值分析》，第63頁
5. ^ 李慶揚，《數值分析》第4版，第31頁
6. ^ 馮有前，《數值分析》，第64頁
7. ^ 7.0 7.1 7.2 7.3 Jean-Paul Berrut, Lloyd N. Trefethen. Barycentric Lagrange Interpolation. SIAM Review. 2004, 46 (3): 501–517. doi:10.1137/S0036144502417715.
8. ^ 王兆清，李淑萍，唐炳濤. 一維重心型插值：公式、算法和應用. 山東建築大學學報. 2007, 22 (5): 447–453.
9. ^ NICHOLAS J. HIGHAM. The numerical stability of barycentric Lagrange Interpolation. IMA Journal of Numerical Analysis. 2004, 24 (4): 547–556.