Maxima/minima with constraints Very often we want to find maxima/minima but subject to some constraint Example: A wire is bent to a shape y = 1 x 2. If a string is stretched from the origin to the wire, at what point along the wire is the length of the string minimized? We want to minimize d 2 = x 2 + y 2. We can eliminate the y 2 using y 2 = (1 x 2 ) 2, so we minimize the function f (x) = x 2 + (1 x 2 ) 2 = x 4 x 2 + 1 We find df dx = 4x 3 2x. The minimum occurs at 2x 2 1 = 0 so x = ± 1/2. We also find a local maxima at x = 0. Check with second derivatives!
Another approach... Let s do the same problem, but starting from f (x, y) = x 2 + y 2, and then the differential Or we can write as, df = 2xdx + 2ydy df dx = 2x + 2y dy dx Then we can obtain dy dx y = 1 x 2 from the equation of constraint dy dx = 2x
Another approach continued... Then we substitute into df dx = 0, df = 2x 4xy = 0 dx We can also solve df = 0 since dx is arbitrary, so 2x 4xy = 0 We still get 2x 4x(1 x 2 1 ) = 0 so that x = ± 2 or x = 0 as before
Method of Lagrange multipliers The approaches above work, either by substituting and eliminating a variable, or by finding dy dx However, these approaches can often lead to inconvenient algrebra We note that we can write the constraint φ(x, y) = constant (sometimes we write it so that φ(x, y) = 0) Then we have, for minimization of f (x, y) with constraint φ(x, y) = constant, df = dx + x y dy = 0 Note that this is what we solve since f is really a function of one variable due to the constraint dφ = φ φ dx + x y dy = 0
Lagrange multipliers continued... We can obviously add df + λdφ = 0, where λ is a Lagrange muliplier We will find a λ such that we can solve separate equations, x + λ φ x = 0 y + λ φ y = 0 We can do this because λ is purely arbitrary! We can choose however we want. Back to example above, we have f (x, y) = x 2 + y 2 and φ(x, y) = y + x 2 = 1, we create F (x, y) to minimize F (x, y) = f (x, y) + λφ(x, y) = x 2 + y 2 + λ(y + x 2 )
Example of Lagrange mulitpliers, continued Next we solve the following two equation, x = 2x(1 + λ) = 0 y = 2y + λ = 0 We could have λ = 1, then y = 1 2 and from y = 1 x 2 we get x = ± 1/2 Alternately we could have x = 0, and then y = 1, and λ = 2 Same points as before! Still need to check with second derivatives whether this is a local minima or a maxima
Langrange multipliers in three dimensions and beyond We might want to minimize f (x, y, z) subject to constraint φ(x, y, z) = constant Due to constraint, only two of the variables can be considered independent, for example x,y We construct the function to minimize F (x, y, z) Then df = df + λdφ is df = F (x, y, z) = f (x, y, z) + λφ(x, y, z) ( ) ( ) ( ) x + λ φ dx + x y + λ φ dy + y z + λ φ dz z Then we choose λ such that z + λ φ z = 0
Lagrange multipliers in more dimensions Then, since dx and dy are independent, we can always take either dx = 0 or dy = 0, and then we have x + λ φ x = 0 y + λ φ y = 0
Lagrange multipliers with multiple constraint equations Say we want to minimize f (x, y, z, w) with constraints φ 1 (x, y, z, w) = constant and φ 2 (x, y, z, w) = constant Now we introduce two multipliers λ 1 and λ 2 There are two independent variables, so we can choose, for example, dx = 0 or dy = 0 We minimize then F (x, y, z, w) = f (x, y, z, w) + λ 1 φ 1 (x, y, z, w) + λ 2 φ 2 (x, y, z, w) We wind up with equations to solve, w + λ φ 1 1 w + λ φ 2 2 w = 0 And we can write identical equations for partials with respect to z, and then x and y.
Change of variables Sometimes problems are more easily solved in a different set of variables Best example is Cartesian, polar, cylindrical, spherical, etc. coordinate systems Example: Write the wave equation in terms of r = x + vt and s = x vt 2 F x 2 1 v 2 2 F t 2 = 0 df t = r dr t + s ds t Then dr t = r x dx = dx, and ds t = s x dx = dx x = r + s We can then see x = r + s, and t = v ( r ) s
Change of variables, wave equation 2 F r s = 0 Solutions F = f (s) + g(r) = f (x vt) + g(x + vt) One solution is f (x vt) = e ik(x vt) and g(x + vt) = e ik(x+vt) for right/left traveling waves
Laplace equation in polar coordinates The Laplace equation is given by 2 F x 2 + 2 F y 2 = 0 We have x = r cos θ, y = r sin θ, and also r 2 = x 2 + y 2, tan θ = y/x We have for the partials with respect to x and y, x = r r x + θ θ x Then 2rdr = 2xdx + 2ydy, and d tan θ = (1 + sin 2 θ/ cos 2 θ)dθ = y dx + 1 x 2 x dy The first relation shows r x = x/r = cos θ The second relation shows θ x = sin θ r
Laplace equation in polar coordinates, continued So finally we get for x, and also y x y = cos θ r sin θ r θ = sin θ r + cos θ r θ We can repeat this process, taking y of the above results Finally we obtain Laplace equation in polar coordinates, 1 r r x and ( r ) + 1 2 F r r 2 2 θ = 0
Another example of change of variables, Hamiltonian and Lagrangian Legendre transformations are also a way to change the independent variables In classical mechanics, we can work with L(q, q) or H(q, p) Since L(q, q) depends on independent variables q and q, we can find dl It turns out that dl = L q L dq + q d q is give by, dl = ṗdq + pd q Define H = qp L (A Legendre transformation!) dh = pd q + qdp dl = ṗdq + qdp Therefore H(q, p) (function of independent variables q and p Constructing H(q, p) is the usual starting point for quantum mechanics Chapter 4, section 11, problem 11