16—Calculus of Variations 395
Not quite yet. What abouty′(a)andy′(b)? The endpointsy(a)andy(b)aren’t changing, but that
doesn’t mean that the slope there is fixed. At these two points, I can’t use the centered difference
scheme for the derivative, I’ll have to use an asymmetric form to give
Idiscrete=
∆
2
F
(
a,y(a),(y(x 1 )−y(x 0 ))/∆
)
+
∆
2
F
(
b,y(b),(y(xN)−y(xN− 1 ))/∆
)
+
N∑− 1
1
F
(
xk,y(xk),(y(xk+1)−y(xk− 1 ))/2∆
)
∆
(16.33)
When you keep the endpoints fixed, this is a function ofN− 1 variables,{yk=y(xk)}for
1 ≤k≤N− 1 , and to find the minimum or maximum you simply take the partial derivative with
respect to each of them. It isnota function of any of the{xk}because those are defined and fixed by
the partitionxk=a+k∆. The clumsy part is keeping track of the notation. When you differentiate
with respect to a particulary`, most of the terms in the sum (16.33) don’t contain it. There are only
three terms in the sum that contribute: and
± 1. In the figureN = 5, and the`= 2coordinate
(y 2 ) is being changed. For all the indices`except the two next to the endpoints ( 1 andN− 1 ), this is
∂
∂y`
Idiscrete=
∂
∂y`
[
F
(
x− 1 ,y
− 1 ,(y−y
− 2 )/2∆
)
+
F
(
x,y
,(y+1−y
− 1 )/2∆
)
+
F
(
x+1,y
+1,(y+2−y
)/2∆
)]
∆ 0 1 2 3 4 5
An alternate standard notation for partial derivatives will help to keep track of the manipulations:
D 1 F is the derivative with respect to the firstargument
The above derivative is then
[
D 2 F
(
x,y
,(y+1−y
− 1 )/2∆
)
+
1
2∆
[
D 3 F
(
x− 1 ,y
− 1 ,(y−y
− 2 )/2∆
)
−D 3 F
(
x+1,y
+1,(y+2−y
)/2∆
)]]
∆
(16.34)
There is noD 1 Fbecause thex`is essentially an index.
If you now take the limit∆→ 0 , the third argument in each function returns to the derivative
y′evaluated at variousxks:
[
D 2 F
(
x,y
,y`′
)
+
1
2∆
[
D 3 F
(
x− 1 ,y
− 1 ,y′`− 1
)
−D 3 F
(
x+1,y
+1,y`′+1
)]]
∆
=
[
D 2 F
(
x,y(x
),y′(x`)
)
(16.35)
+
1
2∆
[
D 3 F
(
x− 1 ,y(x
− 1 ),y′(x`− 1 )
)
−D 3 F
(
x+1,y(x
+1),y′(x`+1)
)]]
∆
Now take the limit that∆→ 0 , and the last part is precisely the definition of (minus) the derivative