# 经典正交多项式介绍及其应用

3 篇文章 0 订阅

## 1 正交多项式的定义

### 1.1 正交多项式定义

∫ a b w ( x ) p m ( x ) p n ( x ) d x = h n δ m n \int_a^b {w(x){p_m}(x){p_n}(x)dx = } {h_n}{\delta _{mn}}

μ n = ∫ a b w ( x ) x n d x , n = 0 , 1 , 2 , ⋯ {\mu _n}{\rm{ = }}\int_a^b {w(x){x^n}dx,{\rm{ }}n = 0,1,2, \cdots }

⟨ f , g ⟩ : = ∫ a b w ( x ) f ( x ) g ( x ) d x \left\langle {f,g} \right\rangle : = \int_a^b {w(x)f(x)g(x)dx}

∫ 0 2 π sin ⁡ ( n θ ) cos ⁡ ( m θ ) d θ = δ m n \int_0^{2\pi } {\sin (n\theta )\cos (m\theta )d\theta } = {\delta _{mn}}

### 1.2 施密特正交化（Schmidt orthogonalization）

β 1 = α 1 β 2 = α 2 − ⟨ α 2 , β 1 ⟩ ⟨ β 1 , β 1 ⟩ β 1 ⋯ β n = α n − ⟨ α n , β 1 ⟩ ⟨ β 1 , β 1 ⟩ β 1 − ⟨ α n , β 2 ⟩ ⟨ β 2 , β 2 ⟩ β 2 − ⋯ − ⟨ α n , β n − 1 ⟩ ⟨ β n − 1 , β n − 1 ⟩ β n − 1 \begin{array}{l} {\beta _1} = {\alpha _1} \\ {\beta _2} = {\alpha _2} - \frac{{\left\langle {{\alpha _2},{\beta _1}} \right\rangle }}{{\left\langle {{\beta _1},{\beta _1}} \right\rangle }}{\beta _1} \\ \cdots \\ {\beta _n} = {\alpha _n} - \frac{{\left\langle {{\alpha _n},{\beta _1}} \right\rangle }}{{\left\langle {{\beta _1},{\beta _1}} \right\rangle }}{\beta _1} - \frac{{\left\langle {{\alpha _n},{\beta _2}} \right\rangle }}{{\left\langle {{\beta _2},{\beta _2}} \right\rangle }}{\beta _2} - \cdots - \frac{{\left\langle {{\alpha _n},{\beta _{n - 1}}} \right\rangle }}{{\left\langle {{\beta _{n - 1}},{\beta _{n - 1}}} \right\rangle }}{\beta _{n - 1}} \\ \end{array}

x = a y = b − ⟨ b , x ⟩ ⟨ x , x ⟩ x = ∣ b ∣ cos ⁡ ( θ ) ∣ a ∣ a z = c − ⟨ c , x ⟩ ⟨ x , x ⟩ x − ⟨ c , y ⟩ ⟨ y , y ⟩ y \begin{array}{l} x = a \\ y = b - \frac{{\left\langle {b,x} \right\rangle }}{{\left\langle {x,x} \right\rangle }}x = \frac{{\left| b \right|\cos (\theta )}}{{\left| a \right|}}a \\ z = c - \frac{{\left\langle {c,x} \right\rangle }}{{\left\langle {x,x} \right\rangle }}x - \frac{{\left\langle {c,y} \right\rangle }}{{\left\langle {y,y} \right\rangle }}y \\ \end{array}

## 2 经典正交多项式

### 2.1 雅克比多项式

∫ − 1 1 ( 1 − x ) α ( 1 + x ) β P m ( α , β ) ( x ) P n ( α , β ) ( x ) d x = 2 α + β + 1 2 n + α + β + 1 Γ ( α + n + 1 ) Γ ( β + n + 1 ) n ! Γ ( α + β + n + 1 ) δ m n \begin{array}{l} \int_{ - 1}^1 {{{(1 - x)}^\alpha }{{(1 + x)}^\beta }P_m^{(\alpha ,\beta )}(x)P_n^{(\alpha ,\beta )}(x)dx} \\ = \frac{{{2^{\alpha + \beta + 1}}}}{{2n + \alpha + \beta + 1}}\frac{{\Gamma (\alpha + n + 1)\Gamma (\beta + n + 1)}}{{n!\Gamma (\alpha + \beta + n + 1)}}{\delta _{mn}} \\ \end{array}

### 2.2 勒让德多项式

P n ( x ) = 1 2 n n ! d n d x n [ ( x 2 − 1 ) n ] {P_n}(x) = \frac{1}{{{2^n}n!}}\frac{{{d^n}}}{{d{x^n}}}\left[ {{{({x^2} - 1)}^n}} \right]

( n + 1 ) P n + 1 ( x ) = ( 2 n + 1 ) x P n ( x ) − n P n − 1 ( x ) (n + 1){P_{n + 1}}(x) = (2n + 1)x{P_n}(x) - n{P_{n - 1}}(x)

∫ − 1 1 P m ( x ) P n ( x ) d x = 2 2 n + 1 δ m n \int_{ - 1}^1 {{P_m}(x){P_n}(x)dx} = \frac{2}{{2n{\rm{ + }}1}}{\delta _{mn}}

P 0 ( x ) = 1 {P_0}(x) = 1
P 1 ( x ) = x {P_1}(x) = x
P 2 ( x ) = 3 2 x 2 − 1 2 {P_2}(x) = \frac{3}{2}{x^2} - \frac{1}{2}
P 3 ( x ) = 5 2 x 3 − 3 2 x {P_3}(x) = \frac{5}{2}{x^3} - \frac{3}{2}x
P 4 ( x ) = 35 8 x 4 − 15 4 x 2 + 3 8 {P_4}(x) = \frac{{35}}{8}{x^4} - \frac{{15}}{4}{x^2} + \frac{3}{8}
P 5 ( x ) = 63 8 x 5 − 35 4 x 3 + 15 8 x {P_5}(x) = \frac{{63}}{8}{x^5} - \frac{{35}}{4}{x^3} + \frac{{15}}{8}x
P 6 ( x ) = 231 16 x 6 − 315 16 x 4 + 105 16 x 2 − 5 16 {P_6}(x) = \frac{{231}}{{16}}{x^6} - \frac{{315}}{{16}}{x^4} + \frac{{105}}{{16}}{x^2} - \frac{5}{{16}}

### 2.3 切比雪夫多项式

#### 2.3.1 第一类切比雪夫多项式

T n ( x ) = cos ⁡ ( n θ ) {T_n}(x) = \cos (n\theta )

x = c o s ( θ ) x=cos(\theta) ，则 T n ( x ) = cos ⁡ ( n arccos ⁡ ( x ) ) {T_n}(x) = \cos (n\arccos (x))

KaTeX parse error: Unknown column alignment: * at position 90: …{\begin{array}{*̲{20}{c}} {0\…

T n + 1 ( x ) = 2 x T n ( x ) − T n − 1 ( x ) {T_{n + 1}}(x) = 2x{T_n}(x) - {T_{n - 1}}(x)

T 0 ( x ) = 1 {T_0}(x) = 1
T 1 ( x ) = x {T_1}(x) = x
T 2 ( x ) = 2 x 2 − 1 {T_2}(x) = 2{x^2} - 1
T 3 ( x ) = 4 x 3 − 3 x {T_3}(x) = 4{x^3} - 3x
T 4 ( x ) = 8 x 4 − 8 x 2 + 1 {T_4}(x) = 8{x^4} - 8{x^2} + 1
T 5 ( x ) = 16 x 5 − 20 x 3 + 5 x {T_5}(x) = 16{x^5} - 20{x^3} + 5x
T 6 ( x ) = 32 x 6 − 48 x 4 + 18 x 2 − 1 {T_6}(x) = 32{x^6} - 48{x^4} + 18{x^2} - 1

#### 2.3.2 第二类切比雪夫多项式

U n ( x ) = sin ⁡ [ ( n + 1 ) θ ] sin ⁡ θ {U_n}(x) = \frac{{\sin [(n + 1)\theta ]}}{{\sin \theta }}

KaTeX parse error: Unknown column alignment: * at position 78: …{\begin{array}{*̲{20}{c}} {0m…

U n + 1 ( x ) = 2 x U n ( x ) − U n − 1 ( x ) {U_{n + 1}}(x) = 2x{U_n}(x) - {U_{n - 1}}(x)

U 0 ( x ) = 1 {U_0}(x) = 1
U 1 ( x ) = 2 x {U_1}(x) = 2x
U 2 ( x ) = 4 x 2 − 1 {U_2}(x) = 4{x^2} - 1
U 3 ( x ) = 8 x 3 − 4 x {U_3}(x) = 8{x^3} - 4x
U 4 ( x ) = 16 x 4 − 12 x 2 + 1 {U_4}(x) = 16{x^4} - 12{x^2} + 1
U 5 ( x ) = 32 x 5 − 32 x 3 + 6 x {U_5}(x) = 32{x^5} - 32{x^3} + 6x
U 6 ( x ) = 64 x 6 − 80 x 4 + 24 x 2 − 1 {U_6}(x) = 64{x^6} - 80{x^4} + 24{x^2} - 1

### 2.4 拉盖尔多项式

∫ 0 + ∞ x α e − x L m ( α ) ( x ) L n ( α ) ( x ) d x = ( n + α ) ! n ! δ m n \int_0^{ + \infty } {{x^\alpha }{e^{ - x}}L_m^{(\alpha )}(x)L_n^{(\alpha )}(x)dx} = \frac{{\left( {n + \alpha } \right)!}}{{n!}}{\delta _{mn}}

L n + 1 ( x ) = ( 2 n + 1 − x ) L n ( x ) − n L n − 1 ( x ) n + 1 {L_{n + 1}}(x) = \frac{{(2n + 1 - x){L_n}(x) - n{L_{n - 1}}(x)}}{{n + 1}}

L 0 ( x ) = 1 {L_0}(x) = 1
L 1 ( x ) = − x + 1 {L_1}(x) = - x + 1
L 2 ( x ) = 1 2 x 2 − 2 x + 1 {L_2}(x) = \frac{1}{2}{x^2} - 2x + 1
L 3 ( x ) = − 1 6 x 3 + 3 2 x 2 − 3 x + 1 {L_3}(x) = - \frac{1}{6}{x^3} + \frac{3}{2}{x^2} - 3x + 1
L 4 ( x ) = 1 24 x 4 − 2 3 x 3 + 3 x 2 − 4 x + 1 {L_4}(x) = \frac{1}{{24}}{x^4} - \frac{2}{3}{x^3} + 3{x^2} - 4x + 1
L 5 ( x ) = − 1 120 x 5 + 5 24 x 4 − 5 3 x 3 + 5 x 2 − 5 x + 1 {L_5}(x) = - \frac{1}{{120}}{x^5} + \frac{5}{{24}}{x^4} - \frac{5}{3}{x^3} + 5{x^2} - 5x + 1
L 6 ( x ) = 1 720 x 6 − 1 20 x 5 + 5 8 x 4 − 10 3 x 3 + 15 2 x 2 − 6 x + 1 {L_6}(x) = \frac{1}{{720}}{x^6} - \frac{1}{{20}}{x^5} + \frac{5}{8}{x^4} - \frac{{10}}{3}{x^3} + \frac{{15}}{2}{x^2} - 6x + 1

### 2.5 埃尔米特多项式

H n ( x ) = ( − 1 ) n e x 2 d n d x n e − x 2 {H_n}(x) = {( - 1)^n}{e^{{x^2}}}\frac{{{d^n}}}{{d{x^n}}}{e^{ - {x^2}}}

∫ − ∞ + ∞ H m ( x ) H n ( x ) e − x 2 d x = π 2 n n ! δ m n \int_{ - \infty }^{ + \infty } {{H_m}(x){H_n}(x){e^{ - {x^2}}}dx} = \sqrt \pi {2^n}n!{\delta _{mn}}

H n + 1 ( x ) = 2 x H n ( x ) − 2 n H n − 1 ( x ) {H_{n + 1}}(x) = 2x{H_n}(x) - 2n{H_{n - 1}}(x)

H 0 ( x ) = 1 {H_0}(x) = 1
H 2 ( x ) = 2 x {H_2}(x) = 2x
H 3 ( x ) = 4 x 2 − 2 {H_3}(x) = 4{x^2} - 2
H 4 ( x ) = 16 x 4 − 48 x 2 + 12 {H_4}(x) = 16{x^4} - 48{x^2} + 12
H 5 ( x ) = 32 x 5 − 160 x 3 + 120 x {H_5}(x) = 32{x^5} - 160{x^3} + 120x
H 6 ( x ) = 64 x 6 − 480 x 4 + 720 x 2 − 120 {H_6}(x) = 64{x^6} - 480{x^4} + 720{x^2} - 120

## 3 正交多项式的应用

% 正交多项式测试
clear
clc
% 采样点数
N = 1000 ;
% 正交多项式阶数
M = 3 ;
% 拟合函数区间为（-2,2）
x = linspace(-2,2,N)' ;
% 生成被拟合的函数，包括指数函数，余弦函数，幂函数成分
y =  4*x + 3*x.^2 + cos(x) + exp(x) + sin(2*x);

% 生成幂级数组成的基矩阵
P1 = power_p(x,M) ;
% 生成勒让德多项式组成的基矩阵
P2 = legendre_p(N,M) ;
% 生成切比雪夫多项式组成的基矩阵
P3 = chebyshev_p(N,M) ;
% 生成拉盖尔多项式组成的基矩阵
P4 = laguerre_p(N,M) ;
% 生成诶尔米特多项式组成的基矩阵
P5 = hermite_p(N,M) ;

%% 用最小二乘拟合y
% c1对应幂级数系数
c1 = P1\y ;
% c2对应勒让德系数
c2 = P2\y ;
% c3对应切比雪夫系数
c3 = P3\y ;
% c4对应拉盖尔系数
c4 = P4\y ;
% c5对应埃尔米特系数
c5 = P5\y ;

%% 求MSE和NMSE
MSE_power = norm(y-P1*c1)/N
NMSE_power = norm(y-P1*c1)/norm(y)

MSE_legendre = norm(y-P2*c2)/N
NMSE_legendre = norm(y-P2*c2)/norm(y)

MSE_chebyshev = norm(y-P3*c3)/N
NMSE_chebyshev = norm(y-P3*c3)/norm(y)

MSE_laguerre = norm(y-P4*c4)/N
NMSE_laguerre = norm(y-P4*c4)/norm(y)

MSE_hermite = norm(y-P5*c5)/N
NMSE_hermite = norm(y-P5*c5)/norm(y)

figure(1)
plot(x,y,'r-',x,P1*c1,'b-',x,P2*c2,'k-',x,P3*c3,'y-',x,P4*c4,'g-',x,P5*c5,'m-')
legend('original','power','legendre','chebyshev','laguerre','hermite')

function [P] = power_p(x,M)

for m = 1:M
P(:,m) = x.^(m-1) ;
end
end

function [P] = legendre_p(N,NN)
% 本函数生成N*M的勒让德基矩阵
s = linspace(-1,1,N)' ;
P = zeros(N,NN) ;
P(:,1) = ones(N,1) ;
P(:,2) = s ;
for n = 3 : NN
P(:,n) = ((2 * n - 3) * s .* P(:,n - 1) - (n - 2) * P(:,n - 2)) / ( n -1 ) ;
end
end

function [P] = chebyshev_p(N,M)
% 本函数生成N*M的切比雪夫基矩阵
x = linspace(-1,1,N)' ;
P = zeros(N,M) ;
P(:,1) = ones(N,1) ;
P(:,2) = x ;
for k = 3:M
P(:,k) = 2*x.*P(:,k-1) - P(:,k-2) ;
end
end

function [P] = laguerre_p(N,M)
% 本函数生成N*M的拉盖尔基矩阵
x  = linspace(-2,2,N)' ;
P = zeros(N,M) ;
P(:,1) = ones(N,1) ;
P(:,2) = -x + ones(N,1) ;
for m = 3:M
P(:,m) = ((2*(m-2)+1-x).*P(:,m-1)-(m-2)*P(:,m-2))./(m-1) ;
end
end

function [P] = hermite_p(N,M)
% 本函数生成N*M的埃尔米特基矩阵
x = linspace(-2,2,N)' ;
P = zeros(N,M) ;
P(:,1) = ones(N,1) ;
P(:,2) = 2*x ;

for m = 2:M
P(:,m+1) = 2*x.*P(:,m) - 2*(m-1)*P(:,m-1) ;
end
end


• 4
点赞
• 1
评论
• 24
收藏
• 一键三连
• 扫一扫，分享海报

11-01
03-03

06-06 7202
05-19
07-09
12-06
08-07 8567
11-10 2万+
04-25 7693
12-01 1018
11-22
07-01 1025