真分数的幂级数展开
求2*x/(1-2x+x^2)
相关的系数的差分方程为x^2-2*x+1=0
所以设置a(n)=A*n+B,特解有:
a(0)=B=0
a(1)=A+B=2
Go
A=2
B=0
Go
a(n)=2*n
所以S=2*x/(1-2x+x^2)=2*x+(2*2)*x^2+(2*3)*x^3+...+(2*n)*x^n
S*x=2*x^2+(2*2)*x^3+(2*3)*x^4+...+(2*n)*x^(n+1)
Go
S-S*x=2*x+2*(x^2+x^3+...+x^n)-(2*n)*x^(n+1)
Go
S*(1-x)=2*x+2*{x^2-x^(n+1)}/(1-x) -(2*n)*x^(n+1)
Go
S*(1-x)=2*x+2*{x^2-x^(n+1)}/(1-x) -(2*n)*x^(n+1)
当x<1,而n比较大的时候,x^(n+1)=0,
GO
S*(1-x)=2*x+2*{x^2}/(1-x)
Go
S=2*x/(1-x)^2得到证明。
从上面也可以看出这种推导方法也是母函数的来历。
下面写程序来证明:
(defun pow (num count)
(if (or (> count 1) (eq count 1) )
(* num
(pow num
(- count 1) ) )
1))
(defun slayer ( count)
(if (or (> count 1) (eq count 1) )
(* count
(slayer
(- count 1) ) )
1))
(defun expr (n x)
(if (= n 0)
0
(+ (expr (1- n)
x)
(* (* 2.0
n)
(pow x
n)))))
(defun formula ( x)
(/ (* 2.0
x)
(pow (- 1 x)
2)))
(defun test (n)
(if (> n 0)
(progn
(print (expr n 0.9))
(print 'compare)
(print (formula 0.9))
(test (- n 1)))
(print 'over)))
(test 50)
x的值越小,n的值越大,两者的值越吻合。