Variational Calculus

download Variational Calculus

of 22

description

An Introductory text on variational calculus.

Transcript of Variational Calculus

  • 5/21/2018 Variational Calculus

    1/22

    Physics 129a

    Calculus of Variations

    071113 Frank Porter

    Revision 081120

    1 Introduction

    Many problems in physics have to do with extrema. When the probleminvolves finding a function that satisfies some extremum criterion, we mayattack it with various methods under the rubric of calculus of variations.The basic approach is analogous with that of finding the extremum of afunction in ordinary calculus.

    2 The Brachistochrone Problem

    Historically and pedagogically, the prototype problem introducing the cal-culus of variations is the brachistochrone, from the Greek for shortesttime. We suppose that a particle of mass m moves along some curve underthe influence of gravity. Well assume motion in two dimensions here, andthat the particle moves, starting at rest, from fixed point a to fixed point b.We could imagine that the particle is a bead that moves along a rigid wirewithout friction [Fig. 1(a)]. The question is: what is the shape of the wire

    for which the time to get from a to b is minimized?

    First, it seems that such a path must exist the two outer paths inFig. 2(b) presumably bracket the correct path, or at least can be made tobracket the path. For example, the upper path can be adjusted to take anarbitrarily long time by making the first part more and more horizontal. Thelower path can also be adjusted to take an arbitrarily long time by makingthe dip deeper and deeper. The straight-line path from a to b must takea shorter time than both of these alternatives, though it may not be the

    shortest.It is also readily observed that the optimal path must be single-valued in

    x, see Fig. 1(c). A path that wiggles back and forth in x can be shortened intime simply by dropping a vertical path through the wiggles. Thus, we candescribe pathCas a function y(x).

    1

  • 5/21/2018 Variational Calculus

    2/22

    C

    a

    b

    a

    b

    (a) (b)

    y

    x

    (c)a

    b

    .

    .

    . .

    ..

    Figure 1: The Brachistochrone Problem: (a) Illustration of the problem; (b)Schematic to argue that a shortest-time path must exist; (c) Schematic toargue that we neednt worry about paths folding back on themselves.

    Well choose a coordinate system with the origin at pointaand they axisdirected downward (Fig. 1). We choose the zero of potential energy so thatit is given by:

    V(y) = mgy.The kinetic energy is

    T(y) = V(y) = 12

    mv2,

    for zero total energy. Thus, the speed of the particle is

    v(y) =

    2gy.

    An element of distance traversed is:

    ds=

    (dx)2 + (dy)2 =

    1 +

    dy

    dx

    2dx.

    Thus, the element of time to traverse dsis:

    dt=

    ds

    v =1 +

    dydx

    2

    2gy dx,and the total time of descent is:

    T = xb0

    1 +

    dydx

    2

    2gy dx.

    2

  • 5/21/2018 Variational Calculus

    3/22

    Different functionsy(x) will typically yield different values forT; we callTa functional ofy. Our problem is to find the minimum of this functionalwith respect to possible functions y. Note that y must be continuous it

    would require an infinite speed to generate a discontinuity. Also, the accel-eration must exist and hence the second derivative d2y/dx2. Well proceedto formulate this problem as an example of a more general class of problemsin variational calculus.

    Consider all functions, y(x), with fixed values at two endpoints; y(x0) =y0 and y(x1) = y1. We wish to find that y(x) which gives an extremum forthe integral:

    I(y) = x1x0

    F(y, y, x) dx,

    whereF(y, y, x) is some given function of its arguments. Well assume goodbehavior as needed.

    In ordinary calculus, when we want to find the extrema of a functionf(x , y , . . .) we proceed as follows: Start with some candidate point (x0, y0, . . .),Compute the total differential, df, with respect to arbitrary infinitesimalchanges in the variables, (dx,dy,. . .):

    df=

    f

    x

    x0,y0,...

    dx +

    f

    y

    x0,y0,...

    dy +. . .

    Now, df must vanish at an extremum, independent of which direction wechoose with our infinitesimal (dx,dy,. . .). If (x0, y0, . . .) are the coordinatesof an extremal point, then

    f

    x

    x0,y0,...

    =

    f

    y

    x0,y0,...

    = . . . = 0.

    Solving these equations thus gives the coordinates of an extremum point.Finding the extremum of a functional in variational calculus follows the

    same basic approach. Instead of a point (x0, y0, . . .), we consider a candidatefunctiony(x) =Y(x). This candidate must satisfy our specified behavior atthe endpoints:

    Y(x0) = y0Y(x1) = y1. (1)

    We consider a small change in this function by adding some multiple ofanother function, h(x):

    Y(x) Y(x) + h(x).

    3

  • 5/21/2018 Variational Calculus

    4/22

    0.9

    1.4

    1.9

    -1.1

    -0.6

    -0.1

    0.4

    0 0.2 0.4 0.6 0.8 1

    h

    YY+ h

    Figure 2: Variation on functionY by functionh.

    To maintain the endpoint condition, we must have h(x0) =h(x1) = 0. ThenotationY is often used for h(x).

    A change in functional form of Y(x) yields a change in the integral I.The integrand changes at each point xaccording to changes in y and y :

    y(x) = Y(x) + h(x),y(x) = Y (x) + h(x). (2)

    To first order in , the new value ofF is:

    F(Y+h,Y+h) F(Y, Y, x)+

    F

    y

    y=Y

    y=Y

    h(x)+

    F

    y

    y=Y

    y=Y

    h(x). (3)

    Well use I to denote the change in Idue to this change in functionalform:

    I = x1x0

    F(Y +h, Y +h, x) dx x1x0

    F(Y, Y, x) dx,

    x1x0

    Fy

    y=Y

    y=Y

    h +

    Fy

    y=Y

    y=Y

    hdx. (4)

    We may apply integration by parts to the second term: x1x0

    F

    y h dx=

    x1x0

    hd

    dx

    F

    y

    dx, (5)

    4

  • 5/21/2018 Variational Calculus

    5/22

    where we have used h(x0) = h(x1) = 0. Thus,

    I= x1

    x0

    F

    y

    + d

    dx

    F

    y

    y=Yy=Y

    hdx. (6)

    When I is at a minimum, I must vanish, since, if I > 0 for some ,then changing the sign of givesI 0 such that f(x)>0 for all x ( , +). Let

    h(x) =

    (x +)2(x )2, x +0 otherwise.

    (9)

    Note that h(x) is continuously differentiable in [x0, x1] and vanishes at x0andx1. We have that x1

    x0

    f(x)h(x) dx = +

    f(x)(x +)2(x )2 dx (10)> 0, (11)

    sincef(x) is larger than zero everywhere in this interval. Thus, f(x) cannot

    be larger than zero anywhere in the interval. The parallel argument followsfor f(x)

  • 5/21/2018 Variational Calculus

    6/22

    whenever y = Y such that I is an extremum, at least if the expression onthe right is continuous. We call the expression on the right the Lagrangianderivative ofF(y, y, x) with respect to y(x), and denote it by F

    y.

    The extremum condition, relabeling Y y, is then:F

    y F

    y d

    dx

    F

    y

    = 0. (13)

    This is called the Euler-Lagrange equation.Note that I= 0 is a necessary condition for I to be an extremum, but

    not sufficient. By definition, the Euler-Lagrange equation determines pointsfor which I is stationary. Further consideration is required to establishwhether Iis an extremum or not.

    We may write the Euler-Lagrange equation in another form. Let

    Fa(y, y, x) F

    y . (14)

    Then

    d

    dx

    F

    y

    =

    dFadx

    =Fa

    x +

    Fay

    y + Fa

    y y (15)

    = 2F

    xy+

    2F

    yyy +

    2F

    y 2y. (16)

    Hence the Euler-Lagrange equation may be written:

    2F

    y 2y +

    2F

    yyy +

    2F

    xy F

    y = 0. (17)

    Let us now apply this to the brachistochrone problem, finding the ex-tremum of:

    2gT = xb0

    1 + y2

    y dx. (18)

    That is:

    F(y, y, x) =

    1 + y2

    y . (19)

    Notice that, in this case, Fhas no explicit dependence onx, and we cantake a short-cut. Starting with the Euler-Lagrange equation, if F has noexplicit x-dependence we find:

    0 =

    F

    y d

    dx

    F

    y

    y (20)

    6

  • 5/21/2018 Variational Calculus

    7/22

    = F

    yy y d

    dx

    F

    y (21)

    = dF

    dxF

    yy

    y

    d

    dx

    F

    y

    (22)

    = d

    dx

    F yF

    y

    . (23)

    Hence,

    F yFy

    = constant =C. (24)

    In this case,

    yF

    y = (y)

    2/

    y (1 + y2). (25)

    Thus,

    1 + y2

    y (y)2 /

    y (1 + y2) = C, (26)

    or

    y

    1 + y2

    = 1

    C2 A. (27)

    Solving for x, we find

    x=

    y

    A y dy. (28)

    We may perform this integration with the trigonometric substitution: y =A

    2

    (1

    cos ) =A sin2 2

    . Then,

    x = sin2 2

    1 sin2 2

    A sin

    2cos

    2d (29)

    = A

    sin2

    2d (30)

    = A

    2( sin ) + B. (31)

    We determine integration constant B by letting = 0 at y = 0. Wechose our coordinates so that xa = ya = 0, and thus B = 0. ConstantA is

    determined by requiring that the curve pass through (xb, yb):

    xb = A

    2(b sin b), (32)

    yb = A

    2(1 cos b). (33)

    7

  • 5/21/2018 Variational Calculus

    8/22

    This pair of equations determines A and b. The brachistochrone is givenparametrically by:

    x = A

    2( sin ), (34)y =

    A

    2(1 cos ). (35)

    In classical mechanics, Hamiltons principle for conservative systems thatthe action is stationary gives the familiar Euler-Lagrange equations of clas-sical mechanics. For a system with generalized coordinates q1, q2, . . . , q n, theaction is

    S= tt0

    L ({qi} , {qi} , t) dt, (36)where Lis the Lagrangian. Requiring Sto be stationary yields:

    d

    dt

    L

    qi

    L

    qi= 0, i= 1, 2, . . . , n . (37)

    3 Relation to the Sturm-Liouville Problem

    Suppose we have the Sturm-Liouville operator:

    L= d

    dxp(x)

    d

    dx q(x), (38)

    with p(x) 0, q(x) 0, and x (0, U). We are interested in solving theinhomogeneous equation Lf=g, where g is a given function.

    Consider the functional

    J= U0

    pf2 +qf2 + 2gf

    dx. (39)

    The Euler-Lagrange equation for Jto be an extremum is:

    F

    f d

    dx

    F

    f

    = 0, (40)

    where F =pf2 +qf2 + 2gf. We have

    F

    f = 2qy+ 2g (41)

    d

    dx

    F

    f

    = 2pf + 2pf. (42)

    8

  • 5/21/2018 Variational Calculus

    9/22

    Substituting into the Euler-Lagrange equation gives

    d

    dxp(x)

    d

    dx

    f(x)q(x)f(x) = 0. (43)

    This is the Sturm-Liouville equation! That is, the Sturm-Liouville differentialequation is just the Euler-Lagrange equation for the functional J.

    We have the following theorem:

    Theorem: The solution to

    d

    dx

    p(x)

    d

    dxf(x)

    q(x)f(x) =g(x), (44)

    where p(x) > 0, q(x) 0, and boundary conditions f(0) = a and

    f(U) =b, exists and is unique.Proof: First, suppose there exist two solutions, f1 andf2. Thend = f1 f2

    must satisfy the homogeneous equation:

    d

    dx

    p(x)

    d

    dxd(x)

    q(x)d(x) = 0, (45)

    with homogeneous boundary conditionsd(0) =d(U) = 0. Now multi-ply Equation 45 by d(x) and integrate:

    U0

    d(x)d

    dxp(x) d

    dxd(x) dx

    U

    0

    q(x)d(x)2 dx= 0

    =d(x)p(x)dd(x)

    dx

    U0

    U0

    dd(x)

    dx

    2p(x) dx

    = U0

    pd2 dx. (46)

    Thus, U0

    pd2(x) + q(x)d(x)2

    dx= 0. (47)

    Since pd2 0 and qd2 0, we must thus have pd2 = 0 and qd2 = 0in order for the integral to vanish. Sincep > 0 and pd

    2

    = 0 it mustbe true that d = 0, that is d is a constant. Butd(0) = 0, therefored(x) = 0. The solution, if it exists, is unique.

    The issue for existence is the boundary conditions. We presume thata solution to the differential equation exists for some boundary con-ditions, and must show that a solution exists for the given boundary

    9

  • 5/21/2018 Variational Calculus

    10/22

    condition. From elementary calculus we know that two linearly inde-pendent solutions to the homogeneous differential equation exist. Leth1(x) be a non-trivial solution to the homogeneous differential equation

    withh1(0) = 0. This must be possible because we can take a suitablelinear combination of our two solutions. Because the solution to theinhomogeneous equation is unique, it must be true that h1(U)= 0.Likewise, let h2(x) be a solution to the homogeneous equation withh2(U) = 0 (and therefore h2(0)= 0). Suppose f0(x) is a solution tothe inhomogeneous equation satisfying some boundary condition. Formthe function:

    f(x) =f0(x) + k1h1(x) + k2h2(x). (48)

    We adjust constantsk1 andk2 in order to satisfy the desired boundarycondition

    a = f0(0) + k2h2(0), (49)

    b = f0(U) + k1h1(U). (50)

    That is,

    k1 = b f0(U)

    h1(U) , (51)

    k2 = a f0(0)

    h2(U) . (52)

    We have demonstrated existence of a solution.

    This discussion leads us to the variational calculus theorem:

    Theorem: For continuously differentiable functions in (0, U) satisfyingf(0) =aand f(U) =b, the functional

    J= U0

    pf2 +qf2 + 2gf

    dx, (53)

    withp(x)> 0 and q(x) 0, attains its minimum if and only iff(x) isthe solution of the corresponding Sturm-Liouville equation.

    Proof: Lets(x) be the unique solution to the Sturm-Liouville equation sat-isfying the given boundary conditions. Let f(x) be any other continu-ously differentiable function satisfying the boundary conditions. Thend(x) f(x) s(x) is continuously differentiable and d(0) =d(U) = 0.

    10

  • 5/21/2018 Variational Calculus

    11/22

    Solving forf, squaring, and doing the same for the dervative equation,yields

    f2 = d2 +s2 + 2sd, (54)

    f2 = d2 +s2 + 2sd. (55)

    Let

    J J(f) J(s) (56)=

    U0

    pf2 +qf2 + 2gfps2 qs2 2gs

    dx (57)

    = U0

    p

    d2 + 2sd

    +q

    d2 + 2ds

    + 2gf

    dx (58)

    = 2 U

    0

    (pds +qds +gd) dx + U

    0pd2 +qd2dx. (59)

    But

    U0

    (pds +qds +gd) dx = dpsU0

    + U0

    d(x) d

    dx(ps) + qds +gd

    dx

    = U0

    d(x)

    d

    dx(ps) + qs +g

    dx, since d(0) =d(U) = 0

    = 0; integrand is zero by the differential equation. (60)

    Thus, we have that

    J= U

    0

    pd +qd2

    dx 0. (61)

    In other words, f does no better than s, hence s corresponds to aminimum. Furthermore, if J= 0, then d= 0, since p >0 implies d

    must be zero, and therefored is constant, but we know d(0) = 0, henced= 0. Thus, f=s at the minimum.

    4 The Rayleigh-Ritz Method

    Consider the Sturm-Liouville problem:d

    dx

    p(x)

    d

    dxf(x)

    q(x)f(x) =g(x), (62)

    with p > 0, q 0, and specified boundary conditions. For simplicity here,lets assume f(0) = f(U) = 0. Imagine expanding the solution in some set

    11

  • 5/21/2018 Variational Calculus

    12/22

    of complete functions,{n(x)} (not necessarily eignefunctions):

    f(x) =

    n=1

    Ann(x).

    We have just shown that our problem is equivalent to minimizing

    J= U0

    pf2 +qf2 + 2gf

    dx. (63)

    Substitute in our expansion, noting that

    pf2 =m

    n

    AmAnp(x)

    m(x)

    n(x). (64)

    Let

    Cmn U

    0

    pm

    n dx, (65)

    Bmn U0

    pmn dx, (66)

    Gn U0

    gn dx. (67)

    Assume that we can interchange the sum and integral, obtaining, for example,

    U0

    pf2 dx=m

    n

    CmnAmAn. (68)

    ThenJ=

    m

    n

    (Cmn+Bmn) AmAn+ 2n

    GnAn. (69)

    LetDmn Cmn+Bmn=Dnm. The Dmn and Gn are known, at least inprinciple. We wish to solve for the expansion coefficients{An}. To accom-plish this, use the condition that J is a minimum, that is,

    J

    An= 0, n. (70)

    Thus,

    0 = JAn

    =

    m=1

    DnmAm+Gn, n= 1, 2, . . . (71)

    This is an infinite system of coupled inhomogeneous equations. If Dnm isdiagonal, the solution is simple:

    An = Gn/Dnn. (72)

    12

  • 5/21/2018 Variational Calculus

    13/22

    The reader is encouraged to demonstrate that this occurs if the n are theeigenfunctions of the Sturm-Liouville operator.

    It may be too difficult to solve the eigenvalue problem. In this case, we can

    look for an approximate solution via the Rayleigh-Ritz approach: Choosesome finite number of linearly independent functions {1(x), 2(x), . . . , N(x)}.In order to find a function

    f(x) =Nn=1

    An(n)(x) (73)

    that approximates closelyf(x), we find the values for An that minimize

    J(f) =N

    n,m=1

    DnmAmAn+ 2Nn=1

    GnAn, (74)

    where now

    Dnm U0

    (pn

    m+qnm) dx (75)

    Gn U0

    gn dx. (76)

    The minimum ofJ(f) is at:

    N

    m=1 DnmAm+ Gn= 0, n= 1, 2, . . . (77)

    In this method, it is important to make a good guess for the set of functions{n}.

    It may be remarked that the Rayleigh-Ritz method is similar in spiritbut different from the variational method we typically introduce in quantummechanics, for example when attempting to compute the ground state energyof the helium atom. In that case, we adjust parameters in a non-linearfunction, while in the Rayleigh-Ritz method we adjust the linear coefficientsin an expansion.

    5 Adding Constraints

    As in ordinary extremum problems, constraints introduce correlations, nowin the possible variations of the function at different points. As with theordinary problem, we may employ the method of Lagrange multipliers toimpose the constraints.

    13

  • 5/21/2018 Variational Calculus

    14/22

    We consider the case of the isoperimetric problem, to find the stationarypoints of the functional:

    J= ba F(f, f

    , x) dx, (78)

    in variationsfvanishing at x = a, b, with the constraint that

    C ba

    G(f, f, x) dx (79)

    is constant under variations.We have the following theorem:

    Theorem: (Euler) The function fthat solves this problem also makes thefunctionalI=J+ Cstationary for some , as long as C

    f= 0 (i.e., f

    does not satisfy the Euler-Lagrange equation for C).

    Proof: (partial) We make stationary the integral:

    I=J+ C= ba

    (F+G)dx. (80)

    That is,f must satisfy

    F

    f d

    dx

    F

    f+

    G

    f d

    dx

    G

    f

    = 0. (81)

    Multiply by the variation f(x) and integrate:

    ba

    F

    f d

    dx

    F

    f

    f(x) dx +

    ba

    G

    f d

    dx

    G

    f

    f(x) dx= 0.

    (82)Here, f(x) is arbitrary. However, only those variations that keep Cinvariant are allowed (e.g., take partial derivative with respect to andrequire it to be zero):

    C= baG

    f d

    dx

    G

    f f(x) dx= 0. (83)

    5.1 Example: Catenary

    A heavy chain is suspended from endpoints at (x1, y1) and (x2, y2). Whatcurve describes its equilibrium position, under a uniform gravitational field?

    14

  • 5/21/2018 Variational Calculus

    15/22

    The solution must minimize the potential energy:

    V = g 2

    1

    ydm (84)

    = g 2

    1

    yds (85)

    = g x2x1

    y

    1 + y2dy, (86)

    where is the linear density of the chain, and the distance element along thechain isds= dx

    1 + y2.

    We wish to minimize V, under the constraint that the length of the chainisL, a constant. We have,

    L= 2

    1

    ds= x2

    x1 1 + y2dx. (87)To solve, let (we multiply Lby gand divide out of the problem)

    F(y, y, x) =y

    1 + y2 +

    1 + y2, (88)

    and solve the Euler-Lagrange equation for F.Notice thatFdoes not depend explicitly on x, so we again use our short

    cut that

    F yFy

    = constant =C. (89)

    Thus,

    C = F yFy

    (90)

    = (y+)

    1 + y2 y

    2

    1 + y2

    (91)

    = (y+)

    (

    1 + y2. (92)

    Some manipulation yields

    dy

    (y+)

    2

    C2

    =dx

    C

    . (93)

    With the substitution y + = Ccosh , we obtain = x+kC

    , wherek is anintegraton constant, and thus

    y+= Ccosh

    x+k

    C

    . (94)

    15

  • 5/21/2018 Variational Calculus

    16/22

    There are three unknown constants to determine in this expression, C, k,and. We have three equations to use for this:

    y1+ = Ccoshx1+k

    C

    , (95)

    y2+ = Ccosh

    x2+k

    C

    , and (96)

    L = x2x1

    1 + y2dx. (97)

    6 Eigenvalue Problems

    We may treat the eigenvalue problem as a variational problem. As an exam-

    ple, consider again the Sturm-Liouville eigenvalue equation:d

    dx

    p(x)

    df(x)

    dx

    q(x)f(x) = w(x)f(x), (98)

    with boundary conditions f(0) =f(U) = 0. This is of the form

    Lf= wf. (99)

    Earlier, we found the desired functional to make stationary was, forLf=0,

    I= U0pf

    2

    +qf2

    dx. (100)We modify this to the eigenvalue problem with q q w, obtaining

    I= U0

    pf2 +qf2 wf2

    dx, (101)

    which possesses the Euler-Lagrange equation giving the desired Sturm-Liouvilleequation. Note that is an unknown parameter - we want to determine it.

    It is natural to regard the eigenvalue problem as a variational problemwith constraints. Thus, we wish to vary f(x) so that

    J= U0

    pf2 +qf2

    dx (102)

    is stationary, with the constraint

    C= U0

    wf2dx= constant. (103)

    16

  • 5/21/2018 Variational Calculus

    17/22

    Notice here that we may takeC= 1, corresponding to normalized eigenfunc-tionsf, with respect to weight w .

    Lets attempt to find approximate solutions using the Rayleigh-Ritz method.

    Expandf(x) =

    n=1

    Anun(x), (104)

    where u(0) =u(U) = 0. Theun are some set of expansion functions, not theeigenfunctions if they are the eigenfunctions, then the problem is alreadysolved! Substitute this into I, giving

    I=

    m=1

    n=1

    (Cmn Dmn) AmAn, (105)

    where

    Cmn U0

    (pumun+qumun) dx (106)

    Dmn U0

    wumundx. (107)

    RequiringIto be stationary,

    I

    Am= 0, m= 1, 2, . . . , (108)

    yields the infinite set of coupled homogeneous equations:

    n=1

    (Cmn

    Dmn) An= 0, m= 1, 2, . . . (109)

    This is perhaps no simpler to solve than the original differential equation.However, we may make approximate solutions for f(x) by selecting a finiteset of linearly independent functions 1, . . . , N and letting

    f(x) =Nn=1

    Ann(x). (110)

    Solve for the best approximation of this form by finding those{An} thatsatisfy

    N

    n=1

    Cmn Dmn An= 0, m= 1, 2, . . . , N , (111)

    where

    Cmn U0

    (pm

    n+qmn) dx (112)

    Dmn U0

    wmndx. (113)

    17

  • 5/21/2018 Variational Calculus

    18/22

    This looks likeNequations in theN+1 unknowns, {An}, but the overallnormalization of the Ans is arbitrary. Hence there are enough equations inprinciple, and we obtain

    =

    Nm,n=1 CmnAmAnNm,n=1 DmnAmAn

    . (114)

    Notice the similarity of Eqn. 114 with

    =

    U0 (pf

    2 +qf2) dxU0 wf

    2dx=

    J(f)

    C(f). (115)

    This follows since I= 0 for fa solution to the Sturm-Liouville equation:

    I = U0

    pf

    2

    +qf2

    wf2

    dx

    = pffU0

    + U0

    f d

    dx(pf) + qf2 wf2

    dx

    = 0 + U0

    qf2 +wf2 +qf2 wf2

    dx

    = 0, (116)

    where we have used the both the boundary condition f(0) =f(U) = 0 andSturm-Liouville equation d

    dx(pf) =qf wfto obtain the third line. Also,

    = J(f)C(f)

    , (117)

    since, for example,

    J(f) = U0

    pf2 +qf2

    dx

    = U0

    pm,n

    AnAm

    m

    n+qm,n

    AnAmmn

    dx

    =

    m,nCmnAnAm. (118)

    That is, iffis close to an eigenfunction f, thenshould be close to aneigenvalue.

    Lets try an example: Find the lowest eigenvalue of f =f, withboundary conditions f(1) = 0. We of course readily see that the firsteigenfunction is cos(x/2) with 1 =

    2/4, but lets try our method to see

    18

  • 5/21/2018 Variational Calculus

    19/22

    how we do. For simplicity, well try a Rayleigh-Ritx approximation with onlyone term in the sum.

    As we noted earlier, it is a good idea to pick the functions with some

    care. In this case, we know that the lowest eigenfunction wont wiggle much,and a good guess is that it will be symmetric with no zeros in the interval(1, 1). Such a function, which satisfies the boundary conditions, is:

    f(x) = A

    1 x2

    , (119)

    and well try it. With N= 1, we have 1= = 1 x2, and

    C C11= 1

    1

    p2 +q2

    dx. (120)

    In the Sturm-Liouville form, we have p(x) = 1, q(x) = 0,w(x) = 1.WithN= 1, we have 1= = 1 x2, and

    C= 1

    1

    4x2dx=8

    3. (121)

    Also,

    D D11 = 1

    1

    w2dx= 1

    1

    1 x2

    2dx=

    16

    15. (122)

    The equation

    Nn=1

    Cmn

    Dmn

    An= 0, m= 1, 2, . . . , N , (123)

    becomes(C D)A= 0. (124)

    IfA = 0, then=

    C

    D =

    5

    2. (125)

    We are within 2% of the actual lowest eigenvalue of1 =2/4 = 2.467. Of

    course this rather good result is partly due to our good fortune at picking aclose approximation to the actual eigenfunction, as may be seen in Fig. 6.

    19

  • 5/21/2018 Variational Calculus

    20/22

    0.6

    0.8

    1

    1.2

    0

    0.2

    0.4

    -1.5 -1 -0.5 0 0.5 1 1.5

    x

    f(x)

    cos x1-x2

    Figure 3: Rayleigh-Ritz eigenvalue estimation example, comparing exact so-lution with the guessed approximation.

    7 Extending to Multiple Dimensions

    It is possible to generalize our variational problem to multiple independentvariables, e.g.,

    I(u) =

    D F

    u,

    u

    x ,

    u

    y , x , y

    dxdy, (126)

    where u = u(x, y), and bounded regionD has u(x, y) specified on its bound-aryS. We wish to find u such that Iis stationary with respect to variationofu.

    We proceed along the same lines as before, letting

    u(x, y) = u(x, y) +h(x, y), (127)

    where h(x, y)|S= 0. Look for stationary I: dId=0

    = 0. Let

    ux ux

    , uy uy

    , hx hx

    , etc. (128)

    ThendI

    d =

    D

    F

    uh+

    F

    uxhx+

    F

    uyhy

    dxdy. (129)

    20

  • 5/21/2018 Variational Calculus

    21/22

    We want to integrate by parts the last two terms, in analogy with thesingle-variable case. Recall Greens theorem:

    S (P dx +Qdy) =

    D

    Qx

    P

    y

    dxdy, (130)

    and let

    P =hF

    ux, Q= h F

    uy. (131)

    With some algrbra, we find that

    dI

    d =

    S

    h

    F

    uxdx F

    uydy

    +

    Dh

    F

    u D

    Dx

    F

    ux

    D

    Dy

    F

    uy

    dxdy,

    (132)where

    DfDx fx + fu ux + fux 2

    ux2 + fuy

    2

    uxy (133)

    is the total partial derivative with respect to x.The boundary integral over S is zero, since h(x {S}) = 0. The re-

    maining double integral over D must be zero for arbitrary functions h, andhence,

    F

    u D

    Dx

    F

    ux

    D

    Dy

    F

    uy

    = 0. (134)

    This result is once again called the Euler-Lagrange equation.

    8 Exercises

    1. Suppose you have a string of lengthL. Pin one end at (x, y) = (0, 0)and the other end at (x, y) = (b, 0). Form the string into a curve suchthat the area between the string and the x axis is maximal. Assumethat b and L are fixed, with L > b. What is the curve formed by thestring?

    2. We considered the application of the Rayleigh-Ritz method to findingapproximate eigenvalues satisfying

    y

    = y, (135)with boundary conditionsy(1) =y(1) = 0. Repeat the method, nowwith two functions:

    1(x) = 1 x2, (136)2(x) = x

    2(1 x2). (137)

    21

  • 5/21/2018 Variational Calculus

    22/22

    You should get estimates for two eigenvalues. Compare with the exacteigenvalues, including a discussion of which eigenvalues you have man-aged to approximate and why. If the eigenvalues you obtain are not

    the two lowest, suggest another function you might have used to getthe lowest two.

    3. The Bessel differential equation is

    d2y

    dx2+

    1

    x

    dy

    dx+

    k2 m

    2

    x2

    y= 0. (138)

    A solution is y(x) = Jm(kx), the mth order Bessel function. Assumea boundary condition y(1) = 0. That is, k is a root ofJm(x). Use theRayleigh-Ritz method to estimate the first non-zero root of J3(x). I

    suggest you try to do this with one test function, rather than a sum ofmultiple functions. But you must choose the function with some care.In particular, note thatJ3 has a third-order root at x = 0. You shouldcompare your result with the actual value of 6.379. If you get within,say, 15% of this, declare victory.

    22