I want to understand the Euler-Maclaurin sum formula. On page 136 of A First Course in Numerical Analysis by Anthony Ralston and Philip Rabinowitz there is a derivation of the Euler-Maclaurin sum formula. They leave out the details and define non-standard Bernoulli polynomials. My derivation will fill in the details and use standard Bernoulli polynomials.
Our interest is in approximating the sum
|
We begin by introducing the polynomials Sk(x), defined to be the polynomials of degree
k
|
|
|
The DERIVE results are:
S(k,x):=k*SUM(p^(k-1),p,1,x-1)
k:epsilonInteger
;User=Simp(User) S(k,1)=0
k:epsilonInteger (1, inf)
;User=Simp(User) S(k,0)=0
Using DERIVE we can find the first few polynomials:
|
|
|
|
S(k,x):=k*SUM(p^(k-1),p,1,x-1)
;Expd(User') VECTOR(S(k,x),k,0,3)=[0,x-1,x^2-x,x^3-3*x^2/2+x/2]
The constants Bk are the Bernoulli numbers. The following two idenities
are of particular interest to us:
|
|
Using DERIVE we can verify these idenities for several values of k.
B(k):=IF(k=0,1,IF(k=1,-1/2,-k*ZETA(1-k)))
;User=Simp(User) VECTOR(B(2*k+1),k,1,12)=[0,0,0,0,0,0,0,0,0,0,0,0]
S(k,x):=k*SUM(p^(k-1),p,1,x-1)
;User=Simp(User)
VECTOR(DIF(S(k,x),x)-k*(S(k-1,x)+B(k-1)),k,3,12)=[0,0,0,0,0,0,0,0,0,0]
Now we define
|
Using DERIVE we find M1(x,h).
[F(x):=, S(k,x):=k*SUM(p^(k-1),p,1,x-1)]
M(k,x,h):=INT(S(2*k,(y-x)/h)*DIF(F(y),y,2*k),y,x,x+h)/(2*k)!
For k=1
|
;Simp(User') S(2,(y-x)/h)=(x-y)*(x-y+h)/h^2
Evaluate S.
|
M(1,x,h)=INT((x-y)*(x-y+h)*F''(y),y,x,x+h)/(2*h^2)
Substute that value of S.
|
INT((x-y)*(x-y+h)*F''(y),y,x,x+h)/(2*h^2)
[V(y):=(y-x)*(y-x-h), U(y):=DIF(F(y),y,1)]
INT(V(y)*DIF(U(y),y),y,x,x+h)=
V(x+h)*U(x+h)-V(x)*U(x)-INT(U(y)*DIF(V(y),y),y,x,x+h)
Integrate M1 by parts.
|
|
|
;Simp(User') INT((x-y)*(x-y+h)*F''(y),y,x,x+h)=
(2*x+h)*F(x+h)-(2*x+h)*F(x)-2*INT(y*F'(y),y,x,x+h)
Evaluate the integral.
|
[F(x):=,S(k,x):=k*SUM(p^(k-1),p,1,x-1)]
[U(y):=F(y), V(y):=y]
INT(V(y)*DIF(U(y),y),y,x,x+h)=
V(x+h)*U(x+h)-V(x)*U(x)-INT(U(y)*DIF(V(y),y),y,x,x+h)
Integrate by parts again.
|
|
;Simp(#3) INT(y*F'(y),y,x,x+h)=(x+h)*F(x+h)-x*F(x)-INT(F(y),y,x,x+h)
Evaluate the integral.
|
;Simp(#6') INT((x-y)*(x-y+h)*F''(y),y,x,x+h)=
-h*F(x+h)-h*F(x)+2*INT(F(y),y,x,x+h)
Subsitute the last integral.
|
;Expd(#10') M(1,x,h)=-F(x+h)/(2*h)-F(x)/(2*h)+INT(F(y),y,x,x+h)/h^2
Subsitute this result to get the value of M1.
|
Now to find the other values of Mk we will find a recurrence relationship.
Start again with the definition of Mk.
|
M(k,x,h):=INT(S(2*k,(y-x)/h)*DIF(F(y),y,2*k),y,x,x+h)/(2*k)!
Integrate Mk by parts.
|
|
|
[V(y):=, U(y):=]
INT(V(y)*DIF(U(y),y),y,x,x+h)=
LIM(V(y)*U(y),y,x+h,0)-LIM(V(y)*U(y),y,x,0)-
INT(U(y)*DIF(V(y),y),y,x,x+h)
[V(y):=S(2*k,(y-x)/h), U(y):=DIF(F(y),y,2*k-1)]
;Simp(#4) INT(S(2*k,(y-x)/h)*DIF(F(y),y,2*k),y,x,x+h)=
-INT(DIF(F(y),y,2*k-1)*LIM(DIF(S(2*k,@),@),@,(y-x)/h,0),y,x,x+h)/h+
LIM(S(2*k,(y-x)/h)*DIF(F(y),y,2*k-1),y,x+h,0)-
LIM(S(2*k,(y-x)/h)*DIF(F(y),y,2*k-1),y,x,0)
[U(y)=DIF(F(y),y,2*k-1),U(y):=]
;Simp(User) INT(S(2*k,(y-x)/h)*DIF(F(y),y,2*k),y,x,x+h)=
-INT(U(y)*LIM(DIF(S(2*k,@),@),@,(y-x)/h,0),y,x,x+h)/h+
U(x+h)*S(2*k,1)-U(x)*S(2*k,0)
[S(k,x):=k*SUM(p^(k-1),p,1,x-1),k:epsilonInteger (1, inf)]
;User=Simp(User) [S(2*k,1),S(2*k,0)]=[0,0]
[S(k,x):=,B(k):=]
;Simp(User) INT(S(2*k,(y-x)/h)*DIF(F(y),y,2*k),y,x,x+h)=
-INT(U(y)*LIM(DIF(S(2*k,@),@),@,(y-x)/h,0),y,x,x+h)/h
LIM(DIF(S(2*k,@),@),@,(y-x)/h,0)=LIM(DIF(S(2*k,t),t),t,(y-x)/h,0)
[DIF(S(k,x),x)=k*(S(k-1,x)+B(k-1)),k>2]
;Sub(User) DIF(S(2*k,t),t)=(2*k)*(S(2*k-1,t)+B(2*k-1))
;Sub(#13') LIM(DIF(S(2*k,@),@),@,(y-x)/h,0)=
LIM((2*k)*(S(2*k-1,t)+B(2*k-1)),t,(y-x)/h,0)
B(k):=IF(k=0,1,IF(k=1,-1/2,-k*ZETA(1-k)))
;Simp(#16') LIM(DIF(S(2*k,@),@),@,(y-x)/h,0)=2*k*S(2*k-1,(y-x)/h)
;Simp(User) INT(S(2*k,(y-x)/h)*DIF(F(y),y,2*k),y,x,x+h)=
-2*k*INT(U(y)*S(2*k-1,(y-x)/h),y,x,x+h)/h
U(y):=DIF(F(y),y,2*k-1)
;Simp(#19) INT(S(2*k,(y-x)/h)*DIF(F(y),y,2*k),y,x,x+h)=
-2*k*INT(S(2*k-1,(y-x)/h)*DIF(F(y),y,2*k-1),y,x,x+h)/h
Evaluate the integral.
|
|
|
|
|
|
We also know B2 k-1=0 so it simplifys even more.
|
Substitute that result into the integral.
|
;Simp(User') M(k,x,h)=
-INT(S(2*k-1,(y-x)/h)*DIF(F(y),y,2*k-1),y,x,x+h)/(h*(2*k-1)!)
Substitute the integral in the definition of Mk.
|
M(k,x,h):=INT(S(2*k,(y-x)/h)*DIF(F(y),y,2*k),y,x,x+h)/(2*k)!
M(k,x,h)=-INT(S(2*k-1,(y-x)/h)*DIF(F(y),y,2*k-1),y,x,x+h)/(h*(2*k-1)!)
[V(y):=S(2*k-1,(y-x)/h), U(y):=DIF(F(y),y,2*k-2)]
;Simp(#5) INT(S(2*k-1,(y-x)/h)*DIF(F(y),y,2*k-1),y,x,x+h)=
-INT(DIF(F(y),y,2*k-2)*LIM(DIF(S(2*k-1,@),@),@,(y-x)/h,0),y,x,x+h)/h+
LIM(S(2*k-1,(y-x)/h)*DIF(F(y),y,2*k-2),y,x+h,0)-
LIM(S(2*k-1,(y-x)/h)*DIF(F(y),y,2*k-2),y,x,0)
[U(y)=DIF(F(y),y,2*k-2),U(y):=]
;Simp(User) INT(S(2*k-1,(y-x)/h)*DIF(F(y),y,2*k-1),y,x,x+h)=
-INT(U(y)*LIM(DIF(S(2*k-1,@),@),@,(y-x)/h,0),y,x,x+h)/h+
U(x+h)*S(2*k-1,1)-U(x)*S(2*k-1,0)
[S(k,x):=k*SUM(p^(k-1),p,1,x-1),k:epsilonInteger (1, inf)]
;User=Simp(User) [S(2*k-1,0),S(2*k-1,1)]=[0,0]
[S(k,x):=,B(k):=]
;Simp(User) INT(S(2*k-1,(y-x)/h)*DIF(F(y),y,2*k-1),y,x,x+h)=
-INT(U(y)*LIM(DIF(S(2*k-1,@),@),@,(y-x)/h,0),y,x,x+h)/h
LIM(DIF(S(2*k-1,@),@),@,(y-x)/h,0)=LIM(DIF(S(2*k-1,t),t),t,(y-x)/h,0)
[DIF(S(k,x),x)=k*(S(k-1,x)+B(k-1)),k>2]
;Sub(User) DIF(S(2*k-1,t),t)=(2*k-1)*(B(2*k-2)+S(2*k-2,t))
;Simp(User) LIM(DIF(S(2*k-1,@),@),@,(y-x)/h,0)=
(2*k-1)*(B(2*k-2)+S(2*k-2,(y-x)/h))
;Simp(User) INT(S(2*k-1,(y-x)/h)*DIF(F(y),y,2*k-1),y,x,x+h)=
(1-2*k)*(B(2*k-2)*INT(U(y),y,x,x+h)+
INT(U(y)*S(2*k-2,(y-x)/h),y,x,x+h))/h
U(y):=DIF(F(y),y,2*k-2)
;Simp(User) INT(S(2*k-1,(y-x)/h)*DIF(F(y),y,2*k-1),y,x,x+h)=
(1-2*k)*(B(2*k-2)*(LIM(DIF(F(y),y,2*k-3),y,x+h,0)-
LIM(DIF(F(y),y,2*k-3),y,x,0))+
INT(S(2*k-2,(y-x)/h)*DIF(F(y),y,2*k-2),y,x,x+h))/h
Integrate Mk by parts again.
|
|
|
Evaluate the integral.
|
|
|
|
|
|
Substitute that result into the integral.
|
|
;Simp(User') M(k,x,h)=
(INT(S(2*k-2,(y-x)/h)*DIF(F(y),y,2*k-2),y,x,x+h)-
B(2*k-2)*(LIM(DIF(F(y),y,2*k-3),y,x+h,0)-
LIM(DIF(F(y),y,2*k-3),y,x,0)))/(h^2*(2*k-2)!)
;User=Simp(User) M(k-1,x,h)=
INT(S(2*(k-1),(y-x)/h)*DIF(F(y),y,2*(k-1)),y,x,x+h)/(2*k-2)!
;User=Simp(User) M(k,x,h):=
M(k-1,x,h)*(2*k-2)!=
INT(S(2*(k-1),(y-x)/h)*DIF(F(y),y,2*(k-1)),y,x,x+h)
;Simp(User) M(k,x,h)=B(2*k-2)*(LIM(DIF(F(y),y,2*k-3),y,x+h,0)-
LIM(DIF(F(y),y,2*k-3),y,x,0))/(h^2*(2*k-2)!)+M(k-1,x,h)/h^2
Substitute the integral in the definition of Mk.
|
Expand the integral.
|
Form the definition we can see Mk-1.
|
We substitute Mk-1 in the recurrence relation for Mk.
|
Our interest is in approximating the sum
|
|
|
|
|
|
|
|
|
|
Now we can verify some examples using DERIVE.
;Simp(User') M(k,x,h):=
IF(k=1,-F(x+h)/(2*h)-F(x)/(2*h)+INT(F(y),y,x,x+h)/h^2,
B(2*k-2)*(LIM(DIF(F(y),y,2*k-3),y,x+h,0)-
LIM(DIF(F(y),y,2*k-3),y,x,0))/(h^2*(2*k-2)!)+M(k-1,x,h)/h^2)
(F(x+h)+F(x))/2=INT(F(y),y,x,x+h)/h+
SUM(h^(2*k-1)*B(2*k)*(LIM(DIF(F(y),y,2*k-1),y,x+h,0)-
LIM(DIF(F(y),y,2*k-1),y,x,0))/(2*k)!,k,1,l)-h^(2*l+1)*M(l+1,x,h)
l=12
;Simp(Sub(#3)) true
Now using derive we can find
|
F(x):=
B(k):=
M(k,x,h):=
;Sub(User) (F(x+h)+F(x))/2=INT(F(y),y,x,x+h)/h+
SUM(h^(2*k-1)*B(2*k)*(LIM(DIF(F(y),y,2*k-1),y,x+h,0)-
LIM(DIF(F(y),y,2*k-1),y,x,0))/(2*k)!,k,1,l)-h^(2*l+1)*M(l+1,x,h)
This is results on the previous page.
|
|
SUM(F(x0+j*h),j,0,n)=F(h*n+x0)/2+F(x0)/2+
SUM(F(h*j+x0),j,1,n)/2+SUM(F(h*j+x0),j,0,n-1)/2
Expand the sumation into four parts.
|
;Sub(User) SUM(F(h*j+x0),j,0,n)=F(h*n+x0)/2+F(x0)/2+
SUM((F(h*j+h+x0)+F(h*j+x0))/2,j,0,n-1)
Combine two of the parts.
|
;Sub(#5) (F((x0+j*h)+h)+F(x0+j*h))/2=
INT(F(y),y,x0+j*h,(x0+j*h)+h)/h+
SUM(h^(2*k-1)*B(2*k)*(LIM(DIF(F(y),y,2*k-1),y,(x0+j*h)+h,0)-
LIM(DIF(F(y),y,2*k-1),y,x0+j*h,0))/(2*k)!,k,1,l)-
h^(2*l+1)*M(l+1,x0+j*h,h)
Substitute for the last part.
|
|
;Sub(#7) SUM(F(h*j+x0),j,0,n)=F(h*n+x0)/2+
F(x0)/2+SUM(INT(F(y),y,x0+j*h,(x0+j*h)+h)/h+
SUM(h^(2*k-1)*B(2*k)*(LIM(DIF(F(y),y,2*k-1),y,(x0+j*h)+h,0)-
LIM(DIF(F(y),y,2*k-1),y,x0+j*h,0))/(2*k)!,k,1,l)-
h^(2*l+1)*M(l+1,x0+j*h,h),j,0,n-1)
;Simp(#9) SUM(F(h*j+x0),j,0,n)=F(h*n+x0)/2+F(x0)/2+
SUM(-h^(2*l+1)*M(l+1,h*j+x0,h)+INT(F(y),y,h*j+x0,h*j+h+x0)/h+
SUM(h^(2*k)*B(2*k)*(LIM(DIF(F(y),y,2*k-1),y,h*j+h+x0,0)-
LIM(DIF(F(y),y,2*k-1),y,h*j+x0,0))/(2*k)!,k,1,l)/h,j,0,n-1)
;Sub(#11) SUM(F(h*j+x0),j,0,n)=F(h*n+x0)/2+F(x0)/2+
(-h^(2*l+1)*SUM(M(l+1,h*j+x0,h),j,0,n-1)+ INT(F(y),y,x0,h*n+x0)/h+
SUM(h^(2*k)*B(2*k)*(LIM(DIF(F(y),y,2*k-1),y,h*n+x0,0)-
LIM(DIF(F(y),y,2*k-1),y,x0,0))/(2*k)!,k,1,l)/h)
Simplify the sums.
|
|