1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Maximizing electrostatic potential (Calculus 3 Optimization Problem)

  1. Mar 20, 2012 #1

    s3a

    User Avatar

    1. The problem statement, all variables and given/known data
    The electrostatic potential at each point in the region 4x^2 + 9y^2 <= 36 is given by f(x,y) = 3x^2 + 2xy - y^2 + 5. Find the maximum potentials in the region.

    (Without using Lagrange Multipliers).

    The solution also said how to do it with Lagrange Multipliers but I think I understand that but I want to understand how to do it using this method. Also, if someone could tell me what this method is called it would be appreciated.


    2. Relevant equations
    Partial derivatives and parametrization.

    3. The attempt at a solution
    I looked through the full solution and I can see how to do it algebraically but I have some questions/confusions I need to settle.:

    1) Why is f(0,0) = 5 not a valid final answer?
    2) Why does parameterizing things to use a single variable t help?
    3) What's the reasoning behind the 0 <= t < 2π constraint on t?

    Any input would be GREATLY appreciated!
    Thanks in advance!
     

    Attached Files:

  2. jcsd
  3. Mar 20, 2012 #2

    lanedance

    User Avatar
    Homework Helper

    Just like a single variable question, you must check the "interior" extremum and the points on the boundary.

    With this mind, and without checking the working:
    1) as there is a larger value (fmax) obtained on the boundary
    2) the curve parameterised by t represents the boundary of the region of interest
    3) the boundary is a circle so (0,2pi) is a natural choice, though you could choice any interval to parametrise over
     
  4. Mar 20, 2012 #3

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    Actually, the boundary is an ellipse, but you can re-scale x and y to turn it into a circle; just choose X = 2x and Y = 3y. The boundary becomes X^2 + Y^2 = 36, and f(x,y) becomes F(X,Y).

    RGV
     
    Last edited: Mar 20, 2012
  5. Mar 20, 2012 #4

    lanedance

    User Avatar
    Homework Helper

    good point
     
  6. Mar 21, 2012 #5

    s3a

    User Avatar

    Thanks for the answers but I have more questions.

    1) I can see why the interval would be [0,2π] since it's a circle. Just to be clear, it can be any interval as long as it's an interval covering a full period, right?

    2) Why do the solutions say [0,2π) instead of [0,2π]?

    3) Why do ∂f/∂x and ∂f/∂y only yield x = 0? Is it because, linearly, a circle only has rate of change 0 at the top and bottom (thinking of a 2D unit circle here for simplicity) which has a "shadow" down to x = 0?

    4) What is the boundary in this problem algebraically (geometrically it is a sphere/circle as you guys stated)?

    5) What is the "interior" in this problem algebraically?

    Sorry for the stupid questions but please answer them as it will improve my grasp of the concepts.
     
  7. Mar 21, 2012 #6

    lanedance

    User Avatar
    Homework Helper

    1) yes as long as the parametrisation cpovers the whole boundary, you could use [0,1) if you wanted, you would just need to re-think the parameterisation

    2) [0,2pi] would repeat one point on the boundary twice (x(0),y(0)) = (x(2pi),y(2pi))

    3) don't understand the question

    4) its given as [itex] \frac{x^2}{4} + \frac{y^2}{9}=1 [/itex] which is an ellipse

    5) the interior is all points in R^2 within the ellipse [itex] \frac{x^2}{4} + \frac{y^2}{9}=1 [/itex]
     
  8. Mar 21, 2012 #7

    s3a

    User Avatar

    For the third point, I think I mixed in some nonsense with my question so I will rephrase it.

    Basically, I was trying to ask why doing it the way with the partial derivatives involving x and y variables yields only x = y = 0 such that f(0,0) = 5 which is a minimum and doesn't yield a maximum whereas parameterizing it to a variable t successfully yields the maximum (as well as other extrema).
     
  9. Mar 21, 2012 #8

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    Because if the extremum occurs on the boundary the partial derivatives don't have be zero there.
     
  10. Mar 24, 2012 #9

    s3a

    User Avatar

    1) Why and how does the equation with the t variables take into consideration the boundaries?

    2) Why are there four values for t and not three? I ask this because 2π radians covers the entire circle so why is there an answer with +3π (the t_4 part)?
     
  11. Mar 24, 2012 #10

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    On the boundary there are two local maxima and two local minima, for a total of 4 extrema.

    RGV
     
  12. Mar 24, 2012 #11

    s3a

    User Avatar

    That only answers the most recent #2 and how am I supposed to know that there are four extrema?
     
  13. Mar 25, 2012 #12

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    What is preventing you from drawing a graph of the function f(t) for 0<= t <= 2Pi?

    RGV
     
  14. Mar 25, 2012 #13

    lanedance

    User Avatar
    Homework Helper

    The boundary is given by the constraint [itex] 4x^2 + 9y^2 \eq 36 [/itex]

    the following paramsterisation represents the curve (an ellipse) defined by the constraint [itex] 4x^2 + 9y^2 = 36 [/itex]
    [tex] \begin{pmatrix} x(t) \\ y(t) \end{pmatrix} = \begin{pmatrix} 3cos(t) \\ 2sin(t) \end{pmatrix} [/tex]

    to see this, substitute in as follows
    [tex] 4x(t)^2 + 9y(t)^2 = 36 [/tex]
    [tex] 4(3cos(t))^2 + 9(2sin(t))^2 = 36 [/tex]
    [tex] 4.9cos^2(t)) + 9.4sin^2(t) = 36 [/tex]
    [tex] 36(cos^2(t)) + sin^2(t)) = 36 [/tex]

    if you read the answer you will see
    [tex] 2t_4 \approx 0.369+3 \pi[/tex]

    which gives
    [tex] t_4 \approx 4.897 \leq 2 \pi[/tex]
     
  15. Mar 27, 2012 #14

    s3a

    User Avatar

    Earlier you/Dick said, that "if the extremum occurs on the boundary the partial derivatives [of the function f(x,y)] don't have be zero there." but let's consider the equation of the boundary with x and y variables. Why is it still giving me x = y = 0 instead of a maximum like the version with t variables does?

    C(x,y) = x^2 /9 + y^2 /4 - 1
    ∂C/∂x = 2/9 * x = 0, ∂C/∂y = 2/4 * y = 1/2 * y = 0

    x = y = 0
     
  16. Mar 27, 2012 #15

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    The function f(x,y) = 3x^2 + 2xy - y^2 + 5 has no max or min inside the region; the point (0,0) is NOT a max and NOT a min; it is a saddle point! You don't believe it? Look at f(t,0) for small t ≠ 0. You have f(t,0) = 2t^2 + 5 > f(0,0), so t = 0 is a min. That is, (0,0) is a min along the x-axis. Now look at f(0,t) = 5 - t^2. We have f(t,0) < f(0,0), so (0,0) is a max; that is, (0,0) is a max along the y-axis. So, within any neighbourhood of (0,0) there are points (x,y) giving f(x,y) > f(0,0) and other points (x,y) giving f(x,y) < f(0,0).

    You should have tested this yourself; an application of the second order tests would have shown it right away.

    RGV
     
  17. Mar 27, 2012 #16

    s3a

    User Avatar

    Ray, your point was valuable to me and it made me have some other kind of epiphany but didn't quite address my confusion. The solution I attached in the initial post says "Then f[x(t), y(t)] = 27cos^2 (t) + 12cos(t) sin(t) - 4sin^2 (t) + 5 = F(t) on the boundary" but isn't f(x,y) the function describing the curve that's within (but not on) the boundary? That was my logic when taking partials ∂C/∂x = 2/9 * x = 0, and ∂C/∂y = 2/4 * y = 1/2 * y = 0 since C(x,y) is the function for the boundary - I called it C for constraint.

    Sorry for asking too many questions. :(
     
  18. Mar 28, 2012 #17

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    I don't understand your confusion. The function f(x,y) does not have a max or a min inside the region, so we need to look on the boundary; that is, we must deal with the problem max/min f(x,y), subject to g(x,y) = 0. The derivatives of f need not (and usually will not) be zero at the optimal solution. That is why we use Lagrangians instead.

    It so happens that in this particular problem we can parametrize the constraint curve in terms of an angle t in [0, 2*pi) and can therefore express the CONSTRAINED value of f as a function of t. That reduces the problem to a unidimensional optimization problem. That means that in this problem we can forget about using a Lagrangian and instead, use f itself---but f on the boundary, not anywhere else. You could arrive at exactly the same solutions by using the Lagrange multiplier method, but it takes more work.

    Please tell me clearly: what part of the previous explanation do you not understand? I really cannot see what your problem is.

    RGV
     
  19. Apr 5, 2012 #18

    s3a

    User Avatar

    Ray Vickson, I really liked that last post you made! I just need to ask the a similar thing that I asked earlier though (but in a better expressed form): would the multi-dimensional alternative of getting f on the boundary be to solve for x and y at the intersection of f(x,y) = 0 = 3x^2 + 2xy – y^2 + 5 and 4x^2 + 9y^2 – 36 = 0? I ask because it seems that the exact same thing was done in the solution except that 4x^2 + 9y^2 – 36 = 0 was re-parametrized to a unidimensional problem (like you said) using the variable t.

    The values of x and y seem to give f(x,y) = 0 (so I must be doing something wrong but I feel I'm actually getting closer):
    http://www.wolframalpha.com/input/?i=0+%3D+3x^2+%2B+2xy+-+y^2+%2B+5,+4x^2+%2B+9y^2+-+36+%3D+0

    I insist on this because I feel that understanding the alternative (multi-dimensional) setup would help the concept sink in my head.

    (Hopefully, I did not say anything stupid this time.)
     
  20. Apr 5, 2012 #19

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    If you want to maximize f(x,y) [or minimize it] you do _not_ want to set f(x,y) = 0; that might not even be possible, as the example f(x,y) = (x + 2y - 3)^2 + (4x - y)^2 shows (this f is > 0 for all real numbers x and y).

    The problem you started with is max/min f(x,y) = 3x^2 + 2xy - y^2 + 5, subject to 4x^2 + 9y^2 <= 36. This has a max at (x,y) = +-(A1/C1,B1/C1), where A1 = 18*sqrt(2), B1 = sqrt(2)*[sqrt(1105) - 31] and C1 = sqrt[1105 - 31*sqrt(1105)] (so (x,y) = +-(2.94899,0.36724) and f = 33.1208). It has a min at (x,y) = +-(A2/C2,B2/C2), where A2 = -18*sqrt(2), B2 = sqrt(2)*[31 + sqrt(1105)] and C2 = sqrt[1105 + 31*sqrt(1105)] (so (x,y) = +-(-0.55086,1.96599) and f = -0.12077).

    You seem to be confused about the nature of the point (0,0), where the derivatives of f vanish. As I already said _several times_, the point (0,0) is NOT a max or a min; it is a saddle point. The max and min of f lie on the boundary of the constraint set, and the derivatives of f do not vanish there.

    RGV
     
  21. Apr 8, 2012 #20

    s3a

    User Avatar

    Can you elaborate on how you got A_1, B_1, C_1, A_2, B_2, and C_2 as well as how you get max (x,y) = +-(A_1/C_1,B_1/C_1) and min (x,y) = +-(A_2/C_2,B_2/C_2)? It seems to me that this is the two dimensional approach I was requesting but I just don't see how the very first step(s) required to get to what you got is/are. Like, I'm thinking it's the outcome of the intersection of f(x,y) = 3x^2 + 2xy – y^2 + 5 and g(x,y) = 4x^2 + 9y^2 – 36 and if so, I'm asking for the steps after this and before what you wrote or at least how to vaguely conduct the algebra myself without actually doing all the tedious stuff if it's tedious.
     
  22. Apr 9, 2012 #21

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    For the problem [itex] \max/\min f(x,y) = 3x^2 + 2xy – y^2 + 5,[/itex] subject to [itex]g(x,y) = 4x^2 + 9y^2 – 36 \leq 0,[/itex] the optimum occurs on the boundary g = 0. Letting the Lagrangian be [itex]L = f - u g [/itex] (where u is the Lagrange multiplier), the optimality conditions are
    [tex] L_x \equiv \partial{L}/\partial{x} = (6-8u)x +2y = 0 \text{ and }
    L_y \equiv \partial{L}/\partial{y} = 2x -(2+18u)y = 0.[/tex] This system of equations is linear in x and y and homogeneous. In order to have a nonzero solution we need to have the determinant of the coefficient matrix = 0, that is, we need
    [tex] \left| \begin{array}{cc} 6-8u & 2 \\ 2 & -2-18u \end{array}\right| = 0,[/tex]
    or [tex] 144u^2 - 92u - 16 = 0 \longrightarrow u = u_1 = \frac{23}{72} + \frac{\sqrt{1105}}{72} \text{ or } u = u_2 = \frac{23}{72} -\frac{\sqrt{1105}}{72}.[/tex]

    Using [itex] u = u_1 \text{ in } L_x = 0 [/itex] gives
    [tex] \left(\frac{31}{9} - \frac{\sqrt{1105}}{9}\right) x + 2y = 0,[/tex] so we can get
    [tex] x = \frac{18 y}{31 - \sqrt{1105}}, [/tex] and substituting this into the equation g = 0 we get two roots for y, in the form [itex] y = \pm \, y_1.[/itex] Substituting these back into the formula for x gives two values of x. These two points are the constrained maxima.

    Similarly, if we use [itex] u = u_2[/itex] and repeat the above steps we obtain two mirror-image points that are the minima.

    RGV
     
  23. Apr 9, 2012 #22

    s3a

    User Avatar

    Okay, so it is mandatory (out of the two options we're considering at least) to use the Lagrange Multiplier method to compute the multi-dimensional variant of this problem?
     
  24. Apr 9, 2012 #23

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    No, there is no such a thing as "mandatory" in these cases. Sometimes one method works well, but sometimes another method works better---it depends on the problem---and (unfortunately) the only way to know what works is to try it out. Sometimes you spend a lot of time and effort trying to solve a problem using method A, only to learn that was a poor choice, so you go back and do it over again using method B. We have all faced that situation.

    RGV
     
  25. Apr 9, 2012 #24

    s3a

    User Avatar

    I meant for this particular problem and not generally speaking. Did you opt for the Lagrange Multiplier method because there wasn't any other good way to do this in two dimensions?

    Would something along the lines of solving for x in the g(x,y) = 0 = 4x^2 + 9y^2 - 36 equation and then plugging that value of x into the f(x,y) = 3x^2 + 2xy - y^2 + 5 equation work?
     
  26. Apr 9, 2012 #25

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    I generally start by trying the Lagrange multiplier method *if the constraints are nonlinear*. If the constraints are linear, one method is about as good as another; depending on exactly what is the problem, one method may definitely be better than another, but not by an overwhelming factor.

    As to your question about solving/substituting: there is always the problem of solution choice: the equation g = 0 is quadratic in y, so has two roots:
    [tex] y= y_1(x) \equiv \frac{2}{3}\sqrt{9-x^2}, \; y = y_2(x) \equiv - \frac{2}{3}\sqrt{9-x^2}.[/tex]
    Also, using the method can produce a very much more complicated problem, but in a lower number of variables. For example, using y = y_1(x) in f(x,y) gives
    [tex] f_1(x) = f(x,y_1(x)) = 1+\frac{31}{9}x^2 + \frac{4}{3} x \sqrt{9 - x^2}.[/tex] If we want to find the stationary points we need to solve
    [tex]f_1'(x) = \frac{2(54 - 12x^2 + 31x \sqrt{9-x^2})}{9\sqrt{9-x^2}} = 0,[/tex]
    or [itex] 54 - 12x^2 + 31 x \sqrt{9 - x^2} = 0.[/itex] How do you like that last equation?

    RGV
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook